Class ItemEntityPickupEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.entity.player.ItemEntityPickupEvent
Direct Known Subclasses:
ItemEntityPickupEvent.Post, ItemEntityPickupEvent.Pre

public abstract class ItemEntityPickupEvent extends net.neoforged.bus.api.Event
Parent class of the two events that fire when a Player collides with an ItemEntity.
See Also:
  • Field Details

  • Constructor Details

    • ItemEntityPickupEvent

      public ItemEntityPickupEvent(Player player, ItemEntity item)
  • Method Details

    • getPlayer

      public Player getPlayer()
      Returns the player who collided with the item.
      Returns:
      the player who collided with the item
    • getItemEntity

      public ItemEntity getItemEntity()
      Returns the ItemEntity that was collided with.

      Changes to this item entity will impact further processing by the game and other event handlers.

      Modification of the stored stack ItemEntity.getItem() is legal, but consumers of this event must not call ItemEntity.setItem(ItemStack), as it will incur undefined behavior.