Interface InventoryClickHandler
- All Known Implementing Classes:
AbstractInventory, AnvilInventory, BeaconInventory, BrewingStandInventory, EnchantmentTableInventory, FurnaceInventory, Inventory, PlayerInventory, VillagerInventory
Represents an inventory which can receive click input.
All methods returning boolean returns true if the action is successful, false otherwise.
See the Minecraft wiki for more information.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidcallClickEvent(Player player, AbstractInventory inventory, int slot, ClickType clickType, ItemStack clicked, ItemStack cursor) booleanchangeHeld(Player player, int slot, int key) Called when aPlayerheld click in the inventorybooleandoubleClick(Player player, int slot) Called when aPlayerdouble click in the inventorybooleanbooleanCalled when aPlayerpress the drop buttondefault booleanhandleClick(Player player, Click click) Parses a click.booleanCalled when aPlayerleft click in the inventory.booleanmiddleClick(Player player, int slot) booleanrightClick(Player player, int slot) Called when aPlayerright click in the inventory.booleanshiftClick(Player player, int slot, int button) Called when aPlayershift click in the inventory
-
Method Details
-
handleClick
-
leftClick
-
rightClick
-
shiftClick
Called when aPlayershift click in the inventory- Parameters:
player- the player who clickedslot- the slot numberbutton- the button (same behaviour in vanilla, but can be used for custom behaviour)- Returns:
- true if the click hasn't been cancelled, false otherwise
-
changeHeld
-
middleClick
-
drop
-
dragging
-
doubleClick
-
callClickEvent
default void callClickEvent(Player player, AbstractInventory inventory, int slot, ClickType clickType, ItemStack clicked, ItemStack cursor)
-