Interface PlayerEvent.PickupItemPredicate
- Enclosing interface:
- PlayerEvent
public static interface PlayerEvent.PickupItemPredicate
-
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.InteractionResult
canPickup
(net.minecraft.world.entity.player.Player player, net.minecraft.world.entity.item.ItemEntity entity, net.minecraft.world.item.ItemStack stack) Invoked when a player tries to pickup anItemEntity
.
-
Method Details
-
canPickup
net.minecraft.world.InteractionResult canPickup(net.minecraft.world.entity.player.Player player, net.minecraft.world.entity.item.ItemEntity entity, net.minecraft.world.item.ItemStack stack) Invoked when a player tries to pickup anItemEntity
. Equivalent to Forge'sEntityItemPickupEvent
event.- Parameters:
player
- The player picking up.entity
- TheItemEntity
that the player tries to pick up.stack
- The content of theItemEntity
.- Returns:
- Forge ignores the return value. On Fabric a
InteractionResult.FAIL
results in the event getting canceled and the item not being picked up.
-