Class PlayerDestroyItemEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.entity.EntityEvent
net.neoforged.neoforge.event.entity.living.LivingEvent
net.neoforged.neoforge.event.entity.player.PlayerEvent
net.neoforged.neoforge.event.entity.player.PlayerDestroyItemEvent
PlayerDestroyItemEvent is fired when a player destroys an item.
This event is fired whenever a player destroys an item in
(@link #hand) contains the hand that the current item was held in.
This event is not
.
This event does not have a result.
This event is fired from
This event is fired on the
This event is fired whenever a player destroys an item in
MultiPlayerGameMode.destroyBlock(BlockPos)
,
MultiPlayerGameMode.useItem(Player, InteractionHand)
,
MultiPlayerGameMode.useItemOn(LocalPlayer, InteractionHand, BlockHitResult)
,
Player.attack(Entity)
,
Player#hurtCurrentlyUsedShield(float)
,
Player.interactOn(Entity, InteractionHand)
,
CommonHooks.getCraftingRemainingItem(ItemStack)
,
ServerPlayerGameMode.useItem(ServerPlayer, Level, ItemStack, InteractionHand)
,
ServerPlayerGameMode.useItemOn(ServerPlayer, Level, ItemStack, InteractionHand, BlockHitResult)
and ServerPlayerGameMode.destroyBlock(BlockPos)
.original
contains the original ItemStack before the item was destroyed. (@link #hand) contains the hand that the current item was held in.
This event is not
invalid reference
ICancellableEvent
This event does not have a result.
invalid reference
HasResult
This event is fired from
EventHooks.onPlayerDestroyItem(Player, ItemStack, InteractionHand)
.This event is fired on the
NeoForge.EVENT_BUS
.-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.player.PlayerEvent
PlayerEvent.BreakSpeed, PlayerEvent.Clone, PlayerEvent.HarvestCheck, PlayerEvent.ItemCraftedEvent, PlayerEvent.ItemSmeltedEvent, PlayerEvent.LoadFromFile, PlayerEvent.NameFormat, PlayerEvent.PlayerChangedDimensionEvent, PlayerEvent.PlayerChangeGameModeEvent, PlayerEvent.PlayerLoggedInEvent, PlayerEvent.PlayerLoggedOutEvent, PlayerEvent.PlayerRespawnEvent, PlayerEvent.SaveToFile, PlayerEvent.StartTracking, PlayerEvent.StopTracking, PlayerEvent.TabListNameFormat
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingVisibilityEvent
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.Size
-
Field Summary
-
Constructor Summary
ConstructorDescriptionPlayerDestroyItemEvent
(Player player, ItemStack original, @Nullable InteractionHand hand) -
Method Summary
Methods inherited from class net.neoforged.neoforge.event.entity.player.PlayerEvent
getEntity
-
Field Details
-
original
-
hand
-
-
Constructor Details
-
PlayerDestroyItemEvent
public PlayerDestroyItemEvent(Player player, ItemStack original, @Nullable @Nullable InteractionHand hand)
-
-
Method Details
-
getOriginal
-
getHand
-