I am trying to find out how to destroy certain blocks in the range of an entity.
Command block detects that cracked stone bricks is in range of the TNT item entity and then destroys the cracked stone bricks.
I am trying to find out how to destroy certain blocks in the range of an entity.
Command block detects that cracked stone bricks is in range of the TNT item entity and then destroys the cracked stone bricks.
It's pretty simple. All you need are two commands in repeat command blocks, and to add a new scoreboard objective.
First, run this command once:
/scoreboard objectives add TNT dummy
Then in the first command block (set to repeat mode):
/scoreboard players set @e[type=Item] TNT 1 {Item:{id:minecraft:tnt}}
Finally, in a second command block (also set to repeat):
/execute @e[score_TNT_min=1] ~ ~ ~ fill ~2 ~2 ~2 ~-2 ~-2 ~-2 minecraft:air 0 replace minecraft:stonebrick 2
This will replace any stone bricks in a 5x5x5 cube around the item with air. I haven't tested this, so it might not work, but I think it will. Good luck!