Advertisement
Guest User

Untitled

a guest
May 4th, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. @EventHandler
  2. public void onMove(PlayerMoveEvent e){
  3.  
  4. Player p = e.getPlayer();
  5.  
  6. Location loc = p.getLocation();
  7.  
  8. Location spawn = new Location("Hubv2", x, y, z)
  9.  
  10. /*
  11.  
  12. I don't know your rank system replace this part.
  13.  
  14. if( player is admin or > ){
  15. return;
  16. }
  17. */
  18.  
  19. if(loc.getBlockX() > 100 || loc.getBlockZ() < -100){
  20.  
  21. e.isCancelled();
  22.  
  23. p.sendMessage(ChatColor.BOLD + "" + ChatColor.RED + "Out of bounds!");
  24.  
  25. p.playSound(loc, Sound.NOTE_BASS, 1, 1);
  26.  
  27. }
  28.  
  29. if(loc.getBlockY() < 20){
  30.  
  31. p.teleport(spawn);
  32.  
  33. }
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement