Class ItemTossEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event

public class ItemTossEvent extends ItemEvent
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.
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraftforge.event.entity.EntityEvent

    EntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.Size

    Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event

    net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Player
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ItemTossEvent(ItemEntity entityItem, Player player)
    Creates a new event for EntityItems tossed by a player.
  • Method Summary

    Modifier and Type
    Method
    Description
    The player tossing the item.

    Methods inherited from class net.minecraftforge.event.entity.item.ItemEvent

    getEntity

    Methods inherited from class net.minecraftforge.eventbus.api.Event

    getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.