Inventories
// Create the inventory
Inventory inventory = new Inventory(InventoryType.CHEST_1_ROW, "The inventory name");
// Open the inventory for the player
// (Opening the same inventory for multiple players would result in a shared interface)
player.openInventory(inventory);
// Close the current player inventory
player.closeInventory();Adding an inventory condition
inventory.addInventoryCondition((player, slot, clickType, inventoryConditionResult) -> {
player.sendMessage("click type inventory: " + clickType);
System.out.println("slot inv: " + slot);
inventoryConditionResult.setCancel(false);
});InventoryPreClickEvent (see the events page)
InventoryClickEvent (see the events page)
Last updated
Was this helpful?
