#I would like a command to be executed when breaking a coal ore
1 messages · Page 1 of 1 (latest)
use event.brokenBlockPermutation
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")
});
Ooh, nice! Thank you! 😊