Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1.  
  2. public void onMove(PlayerMoveEvent e) {
  3. //Check del limite
  4. player.teleport(player.getLocation().add(e.getFrom().toVector().subtract(e.getTo().toVector()).normalize().multiply(2)));
  5.  
  6. }
  7.  
  8. public void onTeleport(PlayerTeleportEvent e) {
  9. if (e.getCause() != PlayerTeleportEvent.TeleportCause.SPECTATE) return;
  10. e.setCancelled(true);
  11. e.getPlayer().setSpectatorTarget(null);
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement