By using ClickInventoryEvent you can check the type of inventory that was clicked using event.getTargetInventory(). This way you won't be cancelling events that occur in inventories like chests to prevent items from being crafted.
ClickInventoryEvent extends AffectSlotEvent, so you aren't missing any previous functionality.
By using ClickInventoryEvent you can check the type of inventory that was clicked using
event.getTargetInventory()
. This way you won't be cancelling events that occur in inventories like chests to prevent items from being crafted.ClickInventoryEvent extends AffectSlotEvent, so you aren't missing any previous functionality.