The PlayerBreakBlockAfterEvent interface in @minecraft/server.
Interface in @minecraft/server
import type { PlayerBreakBlockAfterEvent } from '@minecraft/server';Subscribe to it with world.afterEvents.playerBreakBlock.
Example
Section titled “Example”import { world, type PlayerBreakBlockAfterEvent } from '@minecraft/server';
world.afterEvents.playerBreakBlock.subscribe((event: PlayerBreakBlockAfterEvent) => { console.log('playerBreakBlock', event.player.name, event.block.typeId);});import { world } from '@minecraft/server';
world.afterEvents.playerBreakBlock.subscribe((event) => { console.log('playerBreakBlock', event.player.name, event.block.typeId);});Properties
Section titled “Properties”player
Section titled “player”read-only
readonly player: Player;Types
read-only
readonly block: Block;The block where it was, now air.
Types
brokenBlockPermutation
Section titled “brokenBlockPermutation”read-only
readonly brokenBlockPermutation: { readonly typeId: string };Used by
Section titled “Used by”WorldAfterEvents.playerBreakBlock, PlayerBreakBlockAfterEventSignal.subscribe, PlayerBreakBlockAfterEventSignal.unsubscribe