Fetch and check region from player in water?

  • 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.

mmaalex22112

New Member
Aug 3, 2020
5
0
0
25
Hey all,
I've been recently trying to figure out how to check the region of a player who enters water. Right now I have this:
Code:
on any movement:
    if block above the block below player is water:
        if block below region "pk1-aqua-w1":
            message "&8&lCrazed Man: &r&aThis is water"

I would prefer to not use on any movement to spare resources so I also tried something like this.
Code:
on walking on water:
    if block above the block below player is water:
        set block above the block below player to {watertest}
        if region at {watertest} contains "pk1-aqua-w1":
            message "&8&lCrazed Man: &r&aThis is water"

Nothing I have tried works so far.
Help would be greatly appreciated!
Thank you.
 
Hey mmaalex22112,

Try using:
Code:
 on move on water:

More information on this can be found at: http://en.njol.ch/projects/skript/doc/events/#move_on

Also, you will not need any of the other if statements checking if they are in water once you use this.

Just another note relating to your code: you do not need
Code:
block above block below player
when
Code:
block at player
should give the result you want.

Another thing is I believe you are trying to set {watertest} to the block not the block to {watertest} however in your code you are trying to set the block to {watertest}. This is possibly the reason it is not getting past there.

I hope this helps!
 
Last edited:
Hey mmaalex22112,

Try using:
Code:
 on move on water:

More information on this can be found at: http://en.njol.ch/projects/skript/doc/events/#move_on

Also, you will not need any of the other if statements checking if they are in water once you use this.

Just another note relating to your code: you do not need
Code:
block above block below player
when
Code:
block at player
should give the result you want.

Another thing is I believe you are trying to set {watertest} to the block not the block to {watertest} however in your code you are trying to set the block to {watertest}. This is possibly the reason it is not getting past there.

I hope this helps!

Hey, thanks for the reply.

I now have

Code:
on move on water:
    if block at player is water:
        set {watertest} to block at player
        if region at {watertest} contains "pk1-aqua-w1":
            message "&8&lCrazed Man: &r&aThis is water"

It still does not work sadly.
"Can't understand this event 'on move on water'"
 
Last edited:
Status
Not open for further replies.