Minecraft – Delete all TNT within a range

minecraft-commandsminecraft-java-edition

I was experimenting with redstone and command blocks and now I have tons of TNT scattered all over my (near) world. I know I shouldn't have scattered the TNT in the first place, but it's too late now, and I'm worried about a creeper blowing up my universe. Is there a way to turn them all into air? I thought of putting

/fill ~10 ~10 ~10 ~-10 ~-10 ~-10 air 0 replace tnt

in a repeating command block, or even entering

/execute @p ~ ~ ~ fill ~10 ~10 ~10 ~-10 ~-10 ~-10 air 0 replace tnt

but then I'd still have to run around my world for a few hours, getting close enough to TNT to delete it. Is there an easier way?

Best Answer

Your fill command is already the best you can do. You could make a system of self-cloning armor stands or command blocks, but that would generate more problems than it solves. But you can make a few improvements:

  • Replace the 10s in your command with 15s to increase your reach:
    execute @p ~ ~ ~ fill ~-15 ~-15 ~-15 ~15 ~15 ~15 air 0 replace tnt
  • If you know a range where the TNTs are, you can limit one coordinate and increase the others. For example if you know that they are all in the first three layers above the surface of a superflat world, you can use execute @p ~ ~ ~ fill ~-51 ~-1 ~-51 ~51 ~1 ~51.
  • You can go into gamemode 3 and scroll the mousewheel up to increase your speed. Pressing the sprint key also helps.

And lastly, if the TNTs are close enough to each other, a flint and steel could solve your problem very quickly. ;)