Find the location of a block

  • 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.
Jun 30, 2020
11
1
0
33
https://skriptlang.github.io/Skript/classes.html#location
says that blocks have locations, but I get an error saying "loop-block is not a location"
Code:
every 5 seconds:
    loop all blocks:
        if loop-block is pink concrete powder:
            loop all blocks in radius 1 around loop-block:
                set loop-block-2 to pink concrete powder

Here's the full error message:
Capture.PNG
 
You need to set a var as the location of the block:
Code:
every 5 seconds:
    loop all blocks:
        if loop-block is pink concrete powder:
            set {_l} to location of loop-block
            loop all blocks in radius 1 around {_l}:
                set loop-block-2 to pink concrete powder
You could also just make it this I think
Code:
loop all blocks in radius 1 around location of loop-block
 
You need to set a var as the location of the block:
Code:
every 5 seconds:
    loop all blocks:
        if loop-block is pink concrete powder:
            set {_l} to location of loop-block
            loop all blocks in radius 1 around {_l}:
                set loop-block-2 to pink concrete powder
You could also just make it this I think
Code:
loop all blocks in radius 1 around location of loop-block

I tried doing this and it has the same error message, "loop-block is not a location"
Please try to test it if you can for convenience as well
 
Status
Not open for further replies.