How to check if player is in void?

Started by Kiriot22 on

Topic category: Advanced modding

Active 1 year ago
Joined Sep 2015
Points:
758

User statistics:

  • Modifications: 1
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 55
How to check if player is in void?

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?

Active 1 year ago
Joined Aug 2013
Points:
1162

User statistics:

  • Modifications: 4
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 737
You can check if Y coordinate
Thu, 03/31/2016 - 18:58

You can check if Y coordinate is lower than 0.

Active 1 year ago
Joined Sep 2015
Points:
758

User statistics:

  • Modifications: 1
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 55
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?

Active 1 year ago
Joined Sep 2015
Points:
758

User statistics:

  • Modifications: 1
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 55
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)

Active 1 year ago
Joined Aug 2013
Points:
1162

User statistics:

  • Modifications: 4
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 737
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.

Active 1 year ago
Joined Sep 2015
Points:
758

User statistics:

  • Modifications: 1
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 55
RE:Try make EventHandler class
Thu, 03/31/2016 - 20:38

@#3 Mind giving an example?