Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler(priority = EventPriority.HIGHEST)
- public void inventoryClick(InventoryClickEvent event){
- if(event.getWhoClicked() instanceof Player){
- Player p = (Player) event.getWhoClicked();
- if(event.getCurrentItem()!=null){
- if(event.getCurrentItem().getType()!=Material.AIR){
- event.setCancelled(true);
- if(event.getCurrentItem().getType()==Material.STONE){
- Inventory inv = Bukkit.getServer().createInventory(p, 54, "Some Name");
- p.playSound(p.getLocation(), Sound.ITEM_PICKUP, 10, 2);
- p.openInventory(inv);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement