类 ItemEntityPickupEvent.Pre
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.entity.player.ItemEntityPickupEvent
net.neoforged.neoforge.event.entity.player.ItemEntityPickupEvent.Pre
This event is fired when a player collides with an
ItemEntity
on the ground.
It can be used to determine if the item may be picked up by the player.
If the pickup is successful (either by force or by default rules) ItemEntityPickupEvent.Post
will be fired.
This event is only fired on the logical server.
-
嵌套类概要
从类继承的嵌套类/接口 net.neoforged.neoforge.event.entity.player.ItemEntityPickupEvent
ItemEntityPickupEvent.Post, ItemEntityPickupEvent.Pre
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明返回 the current pickup state。void
setCanPickup
(TriState state) Changes if the player may pickup the item.从类继承的方法 net.neoforged.neoforge.event.entity.player.ItemEntityPickupEvent
getItemEntity, getPlayer
-
字段详细资料
-
canPickup
-
-
构造器详细资料
-
Pre
-
-
方法详细资料
-
setCanPickup
Changes if the player may pickup the item. SettingTriState.TRUE
orTriState.FALSE
will allow/deny the pickup respectively.The default rules require that
ItemEntity.pickupDelay
is zero, and thatItemEntity.target
matches (or is null).- 参数:
state
- The new pickup state.
-
canPickup
返回 the current pickup state。- 返回:
- the current pickup state
- 另请参阅:
-