Minecraft – How to change a certain block with air

minecraft-commandsminecraft-java-edition

I want to get rid of all one type of block in Minecraft 1.10.2. I saw online that

/fill [X1] [Y1] [Z1] [X2] [Y2] [Z2] air replace [Block To Remove]  

is supposed to do the trick, but when I did that the game told me that [X1] is not a valid number. I tried just deleting the [X1], but then it told me that [Y1] is not a valid number. Is there a different command to do this? Thanks!

Best Answer

You need to replace [X1] [Y1] [Z1] [X2] [Y2] [Z2] with the coordinates between which you want to replace the blocks.

If you press F3 to open up the debug menu, then look at a block, you can see its coordinates:

Looking at coordinates

You will need to specify two opposite corners of the cuboid that you want to fill/replace, as such:

Fill coordinates

I've used stone to demonstrate the area that is filled, but you'll need have air 0 replace [block] after the coordinates. With the coordinates added, your command might look like this, with different numbers:

1.12-: /fill 5 10 7 12 20 15 air 0 replace sponge  
1.13+: /fill 5 10 7 12 20 15 air replace sponge