Check if Y level is lower than before

Discussion in 'Plugin Development' started by Rowinvd, Aug 24, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    Rowinvd

    I use the PlayerMoveEvent. When a player is moving, I have to check if the Y level is lower than before. But how? Any ideas?
     
  2. Offline

    Signatured

    Check if e.getFrom().getY() > e.getTo().getY()
     
    mine-care likes this.
  3. Offline

    evilguy4000

    @Rowinvd
    Try to check for player movement and keep updating the Y position of the Player. If this is lower, then you need to do what you want to do.
     
  4. Offline

    au2001

    That would be called each time the player moves (so it would be almost every tick).
    You can either add a custom delay, or use the Location#getBlockY() method to check for when a player goes down by one block, not just 0.01 meter.
    (This method will basically do the same thing as Math.floor(Location.getY()))
     
Thread Status:
Not open for further replies.

Share This Page