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, Level, InteractionHand), MultiPlayerGameMode.useItemOn(LocalPlayer, ClientLevel, InteractionHand, BlockHitResult) , Player.attack(Entity), Player#hurtCurrentlyUsedShield(float), Player.interactOn(Entity, InteractionHand), ForgeHooks.getContainerItem(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 Cancelable.

This event does not have a result. Event.HasResult

This event is fired from ForgeEventFactory.onPlayerDestroyItem(Player, ItemStack, InteractionHand).
This event is fired on the MinecraftForge.EVENT_BUS.
  • Field Details

  • Constructor Details

  • Method Details