Class InventoryBundleItemSelectEvent

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

public class InventoryBundleItemSelectEvent extends Object implements InventoryEvent, PlayerInstanceEvent
Called when a player selects an item from a Bundle
  • Constructor Details

    • InventoryBundleItemSelectEvent

      public InventoryBundleItemSelectEvent(Player player, AbstractInventory inventory, int slot, int selectedItemIndex)
  • Method Details

    • getPlayer

      public Player getPlayer()
      Gets the player who selected the item
      Specified by:
      getPlayer in interface PlayerEvent
      Returns:
      the player
    • getSlot

      public int getSlot()
      Returns the modified slot, relative to getInventory()
    • getSelectedItemIndex

      public int getSelectedItemIndex()
      Returns the index of the selected item in the bundle. -1 if the bundle is unhovered and the current item is deselected
    • getInventory

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