Class PlayerDestroyItemEvent


public class PlayerDestroyItemEvent extends PlayerEvent
PlayerDestroyItemEvent is fired when a player destroys an item.
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.
  • Field Details

  • Constructor Details

  • Method Details