The PlayerInteractWithBlockAfterEvent interface in @minecraft/server.
Interface in @minecraft/server
Extended by PlayerInteractWithBlockBeforeEvent
import type { PlayerInteractWithBlockAfterEvent } from '@minecraft/server';Subscribe to it with world.afterEvents.playerInteractWithBlock.
Example
Section titled “Example”import { world, type PlayerInteractWithBlockAfterEvent } from '@minecraft/server';
world.afterEvents.playerInteractWithBlock.subscribe((event: PlayerInteractWithBlockAfterEvent) => { console.log('playerInteractWithBlock', event.player.name, event.block.typeId, event.itemStack?.typeId);});import { world } from '@minecraft/server';
world.afterEvents.playerInteractWithBlock.subscribe((event) => { console.log('playerInteractWithBlock', event.player.name, event.block.typeId, event.itemStack?.typeId);});Properties
Section titled “Properties”player
Section titled “player”read-only
readonly player: Player;Types
read-only
readonly block: Block;Types
blockFace
Section titled “blockFace”read-only
readonly blockFace: Direction;Types
itemStack
Section titled “itemStack”read-only
readonly itemStack: ItemStack | undefined;Types
isFirstEvent
Section titled “isFirstEvent”read-only
readonly isFirstEvent: boolean;Always true: Basalt fires once per click.
Used by
Section titled “Used by”WorldAfterEvents.playerInteractWithBlock, PlayerInteractWithBlockAfterEventSignal.subscribe, PlayerInteractWithBlockAfterEventSignal.unsubscribe