How can i check in the PlayerMoveEvent if the player MOVES, atm its counting mouse movements too, i dont want that.
Code: Location old = event.getFrom(); Location new = event.getTo(); if (old.getX() != new.getX() || old.getY() != new.getY() || old.getZ() != new.getZ()) { // the player actually moved (this will also be true if they jump, as we checked their Y coord as well) }
I used it in my spawn delay, but when i move my mouse, its still the same: Code:java @EventHandler public void onMove(PlayerMoveEvent e){ Player p = e.getPlayer(); Location old = e.getFrom(); Location ne = e.getTo(); if(old.getX() != ne.getX() || old.getY() != ne.getY() || old.getZ() != ne.getZ()) { if(tplist.contains(p.getName())){ p.sendMessage(prefix+"Teleportation abgebrochen: Du hast dich Bewegt."); tplist.remove(p.getName()); } } }