Class DropItemEvent.PlayerRequest

All Implemented Interfaces:
ICancellableEcsEvent
Enclosing class:
DropItemEvent

public static final class DropItemEvent.PlayerRequest extends DropItemEvent
An event that is called when a player attempts to drop an item from their inventory.

If cancelled, the players request to drop the item will not be processed. The event arrives already cancelled when the player's active gamemode type prevents item drops, and handlers may un-cancel it to allow the drop anyway.

  • Constructor Details

    • PlayerRequest

      public PlayerRequest(int inventorySectionId, short slotId)
      Default Constructor for a DropItemEvent instance.
      Parameters:
      inventorySectionId - The section ID of the inventory the item is being dropped from.
      slotId - The slot ID of the item being dropped.
  • Method Details

    • getInventorySectionId

      public int getInventorySectionId()
      Returns:
      the section ID of the inventory the item is being dropped from.
    • getSlotId

      public short getSlotId()
      Returns:
      the slot ID of the item being dropped.