Class 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
- Enclosing class:
ItemEntityPickupEvent
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.player.ItemEntityPickupEvent
ItemEntityPickupEvent.Post, ItemEntityPickupEvent.Pre -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the current pickup state.voidsetCanPickup(TriState state) Changes if the player may pickup the item.Methods inherited from class net.neoforged.neoforge.event.entity.player.ItemEntityPickupEvent
getItemEntity, getPlayer
-
Field Details
-
canPickup
-
-
Constructor Details
-
Pre
-
-
Method Details
-
setCanPickup
Changes if the player may pickup the item. SettingTriState.TRUEorTriState.FALSEwill allow/deny the pickup respectively.The default rules require that
ItemEntity.pickupDelayis zero, and thatItemEntity.targetmatches (or is null).- Parameters:
state- The new pickup state.
-
canPickup
Returns the current pickup state.- Returns:
- the current pickup state
- See Also:
-