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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
This event is fired when anItemEntity
on the ground has been picked up by the player and after the item is added to the player's inventory.static class
This event is fired when a player collides with anItemEntity
on the ground. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns theItemEntity
that was collided with.Returns the player who collided with the item.
-
Field Details
-
player
-
item
-
-
Constructor Details
-
ItemEntityPickupEvent
-
-
Method Details
-
getPlayer
Returns the player who collided with the item.- Returns:
- the player who collided with the item
-
getItemEntity
Returns theItemEntity
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 callItemEntity.setItem(ItemStack)
, as it will incur undefined behavior.
-