Hi there, I'm working on a plugin which involves teleporting the player, but I keep getting the 'Moved too quickly error...' Is there any way I can fix this? I see other people making teleport plugins, so what's the trick? :| I tried to look for a variable to set the maximum allowed moving distance, but couldn't find it... Cheers!
If you teleport a player from within a PLAYER_MOVE event, you'll have to do something like this to make it work correctly: Code: if(event.getPlayer().teleport(teleportTargetLocation)) { event.setTo(teleportTargetLocation); event.setFrom(teleportTargetLocation); event.setCancelled(true); } That means, if the teleport was successful, completely cancel the move event in every way possible.
Great, thanks! I'll try some stuff EDIT: Too bad, that didn't work either EDIT2: Misread the code xD Works perfectly! Thanks