Playermoveevent distance > 1

Discussion in 'Plugin Development' started by Kingzuck, May 25, 2014.

Thread Status:
Not open for further replies.
  1. Hello all,

    how can i check if a Player is move one Block ?
    i tried this :
    [​IMG]
    But it dosent work...
     
  2. Offline

    rfsantos1996

    on PlayerMoveEvent:

    Location from = e.getFrom();
    Location to = e.getTo();

    if(from.getBlockX() != to.getBlockX() || from.getBlockZ() != to.getBlockZ()) {
    // player is on a different block
    }
     
  3. Offline

    mythbusterma

    This is defintely the way to do this, as the first one will only check fof a movement of greater than one in one move event, an extremely unlikely occurance, whereas this method will check for them being on a different block.
     
    rfsantos1996 likes this.
Thread Status:
Not open for further replies.

Share This Page