Commands / World Edit
How to Use the /fill Command in Minecraft
The /fill command places a whole region of blocks in one go. Give it two corners and a block and it fills the box between them, solid, hollow, outline, or replacing one block type with another.
The exact syntax
- 1Enable cheats or OPOpen to LAN with cheats on in singleplayer, or run /op <name> on a server. /fill needs permission level 2.
- 2Note both cornersStand at one corner and read your F3 coords, then the opposite corner. You need x y z and x2 y2 z2.
- 3Run the basic fillType /fill 0 64 0 5 64 5 stone to fill the whole box solid with stone.
- 4Pick a modeAdd hollow for walls only, outline for the frame, destroy to drop blocks, or keep to fill air only.
- 5Replace selectivelyUse /fill 0 64 0 5 64 5 glass replace stone to swap one block type for another inside the region.
What you need
Target block (stone)
Replacement block
Two corner coords
OP / cheats on
Quick answers
?
What is the block limit for /fill?
One /fill can affect up to 32,768 blocks (the volume of a 32x32x32 box). Larger regions must be split into several commands or done with a function/command block loop.
?
How do I make a hollow box?
Add the hollow keyword: /fill 0 64 0 9 70 9 stone hollow fills the outer shell with stone and sets the inside to air. Use outline to keep the inside untouched.
?
How do I replace only one block type?
Use replace with a filter: /fill 0 64 0 20 80 20 air replace dirt clears only dirt and leaves everything else. Without a filter, replace overwrites every block.
?
Can I use relative coordinates?
Yes. ~ means 'relative to you' and ^ means 'relative to your facing'. /fill ~-2 ~ ~-2 ~2 ~ ~2 stone fills a 5x5 floor centred on your feet.
?
Why does /fill say 'That position is not loaded'?
Both corners must be inside loaded chunks. Move closer so the whole region is rendered, or increase view/simulation distance before running the command.
?
What's the difference between keep and replace?
keep only fills blocks that are currently air, leaving existing blocks alone. The default (and replace) overwrites everything in the region, including air.