#I would like a command to be executed when breaking a coal ore

1 messages · Page 1 of 1 (latest)

gritty bone
#

How do I run an event for the player after he breaks a coal ore?

split crystal
#
world.afterEvents.playerBreakBlock.subscribe(event => {
    let player = event.player;
    let brokenBlockId = event.brokenBlockPermutation.type.id;
    if (brokenBlockId != "minecraft:coal_ore") return;
    player.sendMessage("you brock coal ore")
});
gritty bone
#

Ooh, nice! Thank you! 😊