loop block between 2 location

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

NevenFish

Member
Jul 3, 2024
4
0
1
set {_loc} to location of event-block
set {_w} to world of {_loc}
set {_x} to x-coordinate of {_loc}
set {_y} to y-coordinate of {_loc}
set {_z} to z-coordinate of {_loc}
loop all blocks from location({_x}-1, {_y}-1, {_z}-1, {_w}) to location({_x}+1, {_y}-1, {_z}+1, {_w}):
set loop-block to diamond block
stop


why block setted to diamond block only in location 1 not all block between 2 location
location 1 is location({_x}-1, {_y}-1, {_z}-1, {_w})

i was tried between, loop blocks, within, and same
 
here is the easy fix to your issue.

Code:
set {_loc} to location of event-block
set {_w} to world of {_loc}
set {_x} to x-coordinate of {_loc}
set {_y} to y-coordinate of {_loc}
set {_z} to z-coordinate of {_loc}
loop all blocks from location({_x}-1, {_y}-1, {_z}-1, {_w}):
    loop all blocks from location({_x}+1, {_y}-1, {_z}+1, {_w}):
        set loop-block-1 to diamond block
        set loop-block-2 to diamond block