类 ItemEntityPickupEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.entity.player.ItemEntityPickupEvent
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
.- 另请参阅:
-
嵌套类概要
嵌套类修饰符和类型类说明static 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. -
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Returns theItemEntity
that was collided with.返回 the player who collided with the item。
-
字段详细资料
-
player
-
item
-
-
构造器详细资料
-
ItemEntityPickupEvent
-
-
方法详细资料
-
getPlayer
返回 the player who collided with the item。- 返回:
- 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.
-