The ItemUseAfterEvent interface in @minecraft/server.
Interface in @minecraft/server
Extended by ItemUseBeforeEvent
import type { ItemUseAfterEvent } from '@minecraft/server';Subscribe to it with world.afterEvents.itemUse.
Example
Section titled “Example”import { world, type ItemUseAfterEvent } from '@minecraft/server';
world.afterEvents.itemUse.subscribe((event: ItemUseAfterEvent) => { console.log('itemUse', event.source.name, event.itemStack.typeId);});import { world } from '@minecraft/server';
world.afterEvents.itemUse.subscribe((event) => { console.log('itemUse', event.source.name, event.itemStack.typeId);});Properties
Section titled “Properties”source
Section titled “source”read-only
readonly source: Player;Types
itemStack
Section titled “itemStack”read-only
readonly itemStack: ItemStack;Types
Used by
Section titled “Used by”WorldAfterEvents.itemUse, ItemUseAfterEventSignal.subscribe, ItemUseAfterEventSignal.unsubscribe