Hey everyone, I am struggling with the InventoryClickEvent problem, or more precisely, I do not know what to do to cancel the event when I click on an item in my inventory. I mean, it works, but not like with custom equipment (for example a chest). Code: Code: @EventHandler(priority = EventPriority.NORMAL) public void onInventoryClick(InventoryClickEvent e) { if(e.getClick().equals(ClickType.LEFT)) { if(e.getInventory().getType().equals(InventoryType.PLAYER)) { e.setCancelled(true); } } if(e.getClick().equals(ClickType.RIGHT)) { if(e.getInventory().getType().equals(InventoryType.PLAYER)) { e.setCancelled(true); } } } Video: I hope I explained my problem well Thank you in advance!
You are checking and cancelling every InventoryClickEvent. When you create a GUI or chest, give it a name and check if the clicked inventory name is equals the specified inventory name