Minecraft – Why is this command not working properly

minecraft-commandsminecraft-java-edition

I'm working on a one command creation, Magical Weapons, and I'm currently working on a weapon called Black-Hole-In-A-Box. The idea is when you right-click with it, it clears all the blocks in a 5x5x5 box around you. So, I have this command (in a command block):

/execute @p ~ ~ ~ fill ~5 ~5 ~5 minecraft:air

but when I run it, I get this error message:

Failed to execute fill ~5 ~5 ~5 minecraft:air

But I don't know why it's not working. It should. I've worked for hours on this and I've tried tons of variations. What is the proper command to fill a 5x5x5 box around me with air?

Best Answer

Fill needs two sets of coordinates, one for each corner of the box you want to fill. Try this:

/execute @p ~ ~ ~ fill ~-2.5 ~-2.5 ~-2.5 ~2.5 ~2.5 ~2.5 minecraft:air
Related Topic