Class ItemTossEvent

java.lang.Object
net.neoforged.bus.api.Event
All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent

public class ItemTossEvent extends ItemEvent implements net.neoforged.bus.api.ICancellableEvent
Event that is fired whenever a player tosses (Q) an item or drag-n-drops a stack of items outside the inventory GUI screens. Canceling the event will stop the items from entering the world, but will not prevent them being removed from the inventory - and thus removed from the system.
  • Field Details

    • player

      private final Player player
  • Constructor Details

    • ItemTossEvent

      public ItemTossEvent(ItemEntity entityItem, Player player)
      Creates a new event for EntityItems tossed by a player.
      Parameters:
      entityItem - The EntityItem being tossed.
      player - The player tossing the item.
  • Method Details

    • getPlayer

      public Player getPlayer()
      The player tossing the item.