Class InventoryClickEvent
java.lang.Object
net.minestom.server.event.inventory.InventoryClickEvent
- All Implemented Interfaces:
Event
,EntityEvent
,EntityInstanceEvent
,InstanceEvent
,InventoryEvent
,PlayerEvent
,PlayerInstanceEvent
Called after
InventoryPreClickEvent
, this event cannot be cancelled and items related to the click
are already moved.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull ItemStack
Gets the clicked item.@NotNull ClickType
Gets the click type.@NotNull ItemStack
Gets the item in the player cursor.@Nullable Inventory
Gets the inventory.@NotNull Player
Gets the player who clicked in the inventory.int
getSlot()
Gets the clicked slot number.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minestom.server.event.trait.EntityInstanceEvent
getInstance
Methods inherited from interface net.minestom.server.event.trait.PlayerEvent
getEntity
-
Constructor Details
-
InventoryClickEvent
-
-
Method Details
-
getPlayer
Gets the player who clicked in the inventory.- Specified by:
getPlayer
in interfacePlayerEvent
- Returns:
- the player who clicked in the inventory
-
getSlot
public int getSlot()Gets the clicked slot number.- Returns:
- the clicked slot number
-
getClickType
Gets the click type.- Returns:
- the click type
-
getClickedItem
Gets the clicked item.- Returns:
- the clicked item
-
getCursorItem
Gets the item in the player cursor.- Returns:
- the cursor item
-
getInventory
Description copied from interface:InventoryEvent
Gets the inventory.- Specified by:
getInventory
in interfaceInventoryEvent
- Returns:
- the inventory, null if this is a player's inventory
-