Class ItemEvent

  • Direct Known Subclasses:
    ItemExpireEvent, ItemTossEvent

    public class ItemEvent
    extends EntityEvent
    Base class for all EntityItem events. Contains a reference to the EntityItem of interest. For most EntityItem events, there's little to no additional useful data from the firing method that isn't already contained within the EntityItem instance.
    • Constructor Summary

      Constructors 
      Constructor Description
      ItemEvent​(ItemEntity itemEntity)
      Creates a new event for an EntityItem.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ItemEntity getEntityItem()
      The relevant EntityItem for this event, already cast for you.
      • 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
    • Field Detail

    • Constructor Detail

      • ItemEvent

        public ItemEvent​(ItemEntity itemEntity)
        Creates a new event for an EntityItem.
        Parameters:
        itemEntity - The EntityItem for this event
    • Method Detail

      • getEntityItem

        public ItemEntity getEntityItem()
        The relevant EntityItem for this event, already cast for you.