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!
2 Answers
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:
You will need to specify two opposite corners of the cuboid that you want to fill/replace, as such:
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 The syntax you wrote was a bit wrong, use this instead:
/fill X1 Y1 Z1 X2 Y2 Z2 minecraft:air 0 replace WhatYouWantToReplaceReplace X1 - Z2 with the edges of the cube you want to fill and WhatYouWantToReplace with what type of block you want to replace.
Example: to replace all grass blocks with air in a 10-block area around YOU (or the command block that executed the command), use this:
/fill ~+5 ~+5 ~+5 ~-5 ~-5 ~-5 minecraft:air 0 replace minecraft:grass 5