Advertisement
craftim_74

Untitled

Jan 16th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 KB | None | 0 0
  1. @EventHandler
  2.     public void onSignChange(SignChangeEvent e){
  3.         if(e.getLine(0).equalsIgnoreCase("[TP]")){
  4.             e.setLine(0, "ยง1[TP]");
  5.         }
  6.     }
  7.    
  8.     @EventHandler
  9.     public void onInteract(PlayerInteractEvent e) {
  10.         Player p = (Player) e.getPlayer();
  11.         if(e.getAction() == Action.RIGHT_CLICK_BLOCK) {
  12.             if(e.getClickedBlock().getType() == Material.WALL_SIGN) {
  13.                 Sign s = (Sign) e.getClickedBlock();
  14.                 if(s.getLine(0).equalsIgnoreCase("ยง1[TP]")){
  15.                     Location location = new Location(s.getWorld(), Integer.valueOf(s.getLine(1)), Integer.valueOf(s.getLine(2)), Integer.valueOf(s.getLine(3)));
  16.                     p.teleport(location);
  17.                 }
  18.             }
  19.         }
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement