Advertisement
Derison

PlayerInteract

Apr 19th, 2015
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1.    
  2.     @SuppressWarnings("deprecation")
  3.     @EventHandler
  4.     public void onPlayerInteractEvent(PlayerInteractEvent e) {
  5.         final Player p = e.getPlayer();
  6.        
  7.         if(e.getAction() == Action.RIGHT_CLICK_AIR | e.getAction() == Action.RIGHT_CLICK_BLOCK) {
  8.            
  9.             ItemStack speed1 = new ItemStack(Material.WOOL, 1, DyeColor.GREEN.getData());
  10.             ItemMeta meta1 = speed1.getItemMeta();
  11.             meta1.setDisplayName("§aSpeed I (§o5 Sekunden§r§a)");
  12.             speed1.setItemMeta(meta1);
  13.             plugin.inv.setItem(1, speed1);
  14.            
  15.             if(e.getMaterial().equals(speed1)) {
  16.                 p.sendMessage("§Test");
  17.             }
  18.            
  19.         }
  20.        
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement