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
ConstructorDescriptionInventoryClickEvent
(@NotNull AbstractInventory inventory, @NotNull Player player, int slot, @NotNull ClickType clickType, @NotNull ItemStack clicked, @NotNull ItemStack cursor) -
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.@NotNull AbstractInventory
Gets the inventory that was clicked.@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
public InventoryClickEvent(@NotNull @NotNull AbstractInventory inventory, @NotNull @NotNull Player player, int slot, @NotNull @NotNull ClickType clickType, @NotNull @NotNull ItemStack clicked, @NotNull @NotNull ItemStack cursor)
-
-
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 that was clicked.- Specified by:
getInventory
in interfaceInventoryEvent
-