Advertisement
Guest User

Untitled

a guest
May 14th, 2014
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1.     @EventHandler(priority = EventPriority.HIGHEST)
  2.     public void inventoryClick(InventoryClickEvent event){
  3.         if(event.getWhoClicked() instanceof Player){
  4.             Player p = (Player) event.getWhoClicked();
  5.             if(event.getCurrentItem()!=null){
  6.                 if(event.getCurrentItem().getType()!=Material.AIR){
  7.                     event.setCancelled(true);
  8.                     if(event.getCurrentItem().getType()==Material.STONE){
  9.                         Inventory inv = Bukkit.getServer().createInventory(p, 54, "Some Name");
  10.                         p.playSound(p.getLocation(), Sound.ITEM_PICKUP, 10, 2);
  11.                         p.openInventory(inv);
  12.                     }
  13.                 }
  14.             }
  15.         }
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement