Class InventoryClickEvent

java.lang.Object
net.minestom.server.event.inventory.InventoryClickEvent
All Implemented Interfaces:
Event, EntityEvent, EntityInstanceEvent, InstanceEvent, InventoryEvent, PlayerEvent, PlayerInstanceEvent

public class InventoryClickEvent extends Object implements InventoryEvent, PlayerInstanceEvent
Called after InventoryPreClickEvent, this event cannot be cancelled and items related to the click are already moved.
  • 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

      @NotNull public @NotNull Player getPlayer()
      Gets the player who clicked in the inventory.
      Specified by:
      getPlayer in interface PlayerEvent
      Returns:
      the player who clicked in the inventory
    • getSlot

      public int getSlot()
      Gets the clicked slot number.
      Returns:
      the clicked slot number
    • getClickType

      @NotNull public @NotNull ClickType getClickType()
      Gets the click type.
      Returns:
      the click type
    • getClickedItem

      @NotNull public @NotNull ItemStack getClickedItem()
      Gets the clicked item.
      Returns:
      the clicked item
    • getCursorItem

      @NotNull public @NotNull ItemStack getCursorItem()
      Gets the item in the player cursor.
      Returns:
      the cursor item
    • getInventory

      @NotNull public @NotNull AbstractInventory getInventory()
      Description copied from interface: InventoryEvent
      Gets the inventory that was clicked.
      Specified by:
      getInventory in interface InventoryEvent