im looking for a better way to detect if a player has destroyed a special block type.
I used the following command in a repeating block, but that way i have to make a command block for every block i wanna check, i would like to use a command that detected if any block of that type in the world was destroyed.
/execute if block -187 4 236 minecraft:air run scoreboard players add @a gold_ore 1
Hi,
im looking for a better way to detect if a player has destroyed a special block type.
I used the following command in a repeating block, but that way i have to make a command block for every block i wanna check, i would like to use a command that detected if any block of that type in the world was destroyed.
/execute if block -187 4 236 minecraft:air run scoreboard players add @a gold_ore 1
Any help is welcome.
There are built-in scoreboard criteria which do this automatically. Just define your objective like this:
and now the "gold_ore" objective will automatically increase by 1 every time you mine that block.
Command block engineer // Developer // #TeamTrees