The PlayerPlaceBlockAfterEvent interface in @minecraft/server.
Interface in @minecraft/server
import type { PlayerPlaceBlockAfterEvent } from '@minecraft/server';Subscribe to it with world.afterEvents.playerPlaceBlock.
Example
Section titled “Example”import { world, type PlayerPlaceBlockAfterEvent } from '@minecraft/server';
world.afterEvents.playerPlaceBlock.subscribe((event: PlayerPlaceBlockAfterEvent) => { console.log('playerPlaceBlock', event.player.name, event.block.typeId);});import { world } from '@minecraft/server';
world.afterEvents.playerPlaceBlock.subscribe((event) => { console.log('playerPlaceBlock', 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;Types
Used by
Section titled “Used by”WorldAfterEvents.playerPlaceBlock, PlayerPlaceBlockAfterEventSignal.subscribe, PlayerPlaceBlockAfterEventSignal.unsubscribe