Advertisement
Guest User

Untitled

a guest
Mar 25th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. @EventHandler
  2. public void onClickOnSetNavigationItems(InventoryClickEvent e) {
  3.  
  4. Player p = (Player) e.getWhoClicked();
  5.  
  6. if (e.getInventory().getName().equals("Test")) {
  7.  
  8. try {
  9.  
  10. if (e.getCurrentItem().getItemMeta().getDisplayName().equals("§cAbbrechen")) {
  11.  
  12. Location loc = p.getLocation();
  13.  
  14. p.closeInventory();
  15.  
  16. p.playSound(loc, Sound.ANVIL_BREAK, 10, 10);
  17.  
  18. }
  19.  
  20. } catch (NullPointerException ex) {
  21.  
  22.  
  23.  
  24. }
  25.  
  26. }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement