How to check if player is in void?

Started by Kiriot22 on Thu, 03/31/2016 - 18:45

Topic category: Advanced modding

Last seen on 22:33, 5. Aug 2017
Joined Sep 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
How to check if player is in void?
Thu, 03/31/2016 - 18:45

I want to make a custom event that if player falls into the void in my dimension then another event runs (teleporting). My question is, how to check if player fell in the void?

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
You can check if Y coordinate
Thu, 03/31/2016 - 18:58

You can check if Y coordinate is lower than 0.

Last seen on 22:33, 5. Aug 2017
Joined Sep 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
RE:You can check if Y coordinate
Thu, 03/31/2016 - 19:10

@#1 I know, but what event should I apply and what depencies?

Last seen on 22:33, 5. Aug 2017
Joined Sep 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
I tried to use this but it
Thu, 03/31/2016 - 19:42

I tried to use this but it doesn't work

On entity hurt:

    if variable isSkyFallEnabled is true

        if block at i, j, k is Block.air

            if block at i, j - 1, k is Block.air

                if block at i, j - 2, k is Block.air

                    if dimension id == 3

                        switch dimension for the entity to 0

                        teleport (i, j + 250, k)

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
Try make EventHandler class
Thu, 03/31/2016 - 19:56

Try make EventHandler class (you can use empty GUI overlay) and check here event "EntityUpdateEvent" or something called like this.

Last seen on 22:33, 5. Aug 2017
Joined Sep 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
RE:Try make EventHandler class
Thu, 03/31/2016 - 20:38

@#3 Mind giving an example?