Class ItemTossEvent


  • 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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      PlayerEntity getPlayer()
      The player tossing the item.
      • Methods inherited from class net.minecraftforge.eventbus.api.Event

        getListenerList, getParentListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setup
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ItemTossEvent

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

      • getPlayer

        public PlayerEntity getPlayer()
        The player tossing the item.