Class PlayerBundleItemSelectEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.inventory.InventoryEvent
io.papermc.paper.event.inventory.PlayerBundleItemSelectEvent

@NullMarked public final class PlayerBundleItemSelectEvent extends InventoryEvent
Called when a Player selects an item inside a bundle.
API Note:
This event does not fire for bundle item selections in creative mode player inventories.
  • Constructor Details

  • Method Details

    • getPlayer

      public Player getPlayer()
      Gets the player who triggered the event.
      Returns:
      the player
    • getBundle

      public ItemStack getBundle()
      Gets the bundle item.
      Returns:
      the bundle item
    • getSlot

      public int getSlot()
      Gets the slot number of the bundle, depending on which Inventory it is located in.
      Returns:
      the slot number
      See Also:
    • getRawSlot

      public int getRawSlot()
      Gets the raw slot number of the bundle inside the InventoryView.
      Returns:
      the raw slot number
      See Also:
    • getPreviousItem

      public ItemStack getPreviousItem()
      Gets the previously selected item inside the bundle. If no item was previously selected, this will return an empty item.
      Returns:
      the previously selected item
    • getSelectedItem

      public ItemStack getSelectedItem()
      Gets the selected item inside the bundle.
      Returns:
      the selected item
    • getPreviousIndex

      public int getPreviousIndex()
      Gets the previously selected index. If no item was previously selected, this will be -1.
      Returns:
      the previously selected index
    • getSelectedIndex

      public int getSelectedIndex()
      Gets the selected index.
      Returns:
      the selected index
    • getDirection

      Gets the direction from the previous selection to the new one.
      Returns:
      the direction
      API Note:
      The direction cannot be reliably determined if there are less than three item stacks inside the bundle, in which case this returns PlayerBundleItemSelectEvent.Direction.UNKNOWN.
    • getHandlers

      public HandlerList getHandlers()
      Overrides:
      getHandlers in class InventoryEvent
    • getHandlerList

      public static HandlerList getHandlerList()