Loop blocks within 2 locations

  • 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 comminuty!

    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!

Status
Not open for further replies.

kai1846456

New Member
Feb 18, 2018
5
0
1
20
Skript version: 2.4.1
Minecraft Version: 1.16.1

Code:
Code:
loop all blocks within block at {_location-1} and block at {_location-2}:

The code works - however, rather than looping all blocks within the 2 locations, its only looping blocks between the 2 locations. Any solutions?
 
That worked for me however when i use that in a loop, it does nothing.
Code:
loop all blocks between {_location-1} and {_location-2}:
 
Code:
            set {_location-1} to {_l}
            set {_location-2} to {_l}
            set {_location-1-complete} to false
            set {_location-2-complete} to false
            while {_location-1-complete} is false:
                add 1 to the x coord of {_location-1}
                if "%block at {_location-1}%" contains "bedrock":
                    remove 1 from the x coord of {_location-1}
                    exit loop
            while {_location-1-complete} is false:
                add 1 to the z coord of {_location-1}
                if "%block at {_location-1}%" contains "bedrock":
                    remove 1 from the z coord of {_location-1}
                    exit loop
            while {_location-2-complete} is false:
                remove 1 from the x coord of {_location-2}
                if "%block at {_location-2}%" contains "bedrock":
                    add 1 to the x coord of {_location-2}
                    exit loop
            while {_location-2-complete} is false:
                remove 1 from the z coord of {_location-2}
                if "%block at {_location-2}%" contains "bedrock":
                    add 1 to the z coord of {_location-2}
                    exit loop
            send "%{_location-1}%" to {_p}
            send "%{_location-2}%" to {_p}
            loop all blocks between {_location-1} and {_location-2}:
                set {_bk} to "%loop-block%" parsed as itemtype
                send "%location of loop-block%" to {_p}
                if {sell::%{_bk}%} is set:
                    sell({_p}, loop-block)
                    set loop-block to air
[doublepost=1593650498,1593650440][/doublepost]It finds the correct coordinates i have checked this via the 2 messages sent before the loop
However, no blocks are cleared and none of the code under the loop is executed.
 
Status
Not open for further replies.