Hello Im wondering how to deny access to chests? Im am making my own privated chests plugin any help will be appreciated Thanks
Code (Text): public void onInventoryOpen(InventoryOpenEvent event) { if (event.getInventory().getType() == InventoryType.CHEST) { event.setCancelled(true); } } What this code is doing, is when you right click a chest, and the menu opens, it calls the InventoryOpenEvent. Here, you are listening for the event, and if the inventory type is equal to a chest, then you cancel the event, therefore not opening the chest. @PickNChew's method works just as well too.