Skip to main content
← All Guides
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.

server console, /fill
/fill 0 64 0 5 64 5 stone
✔ Successfully filled 36 blocks
/fill 0 64 0 5 64 5 stone hollow
✔ Filled 20 blocks, cleared 16
/fill 0 64 0 5 64 5 glass replace stone
✔ Replaced 36 blocks
The exact syntax
  1. 1
    Enable cheats or OP
    Open to LAN with cheats on in singleplayer, or run /op <name> on a server. /fill needs permission level 2.
  2. 2
    Note both corners
    Stand at one corner and read your F3 coords, then the opposite corner. You need x y z and x2 y2 z2.
  3. 3
    Run the basic fill
    Type /fill 0 64 0 5 64 5 stone to fill the whole box solid with stone.
  4. 4
    Pick a mode
    Add hollow for walls only, outline for the frame, destroy to drop blocks, or keep to fill air only.
  5. 5
    Replace selectively
    Use /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.
Hosting
Skip the setup
Get a managed server with one click instead of configuring it all yourself.
Database
Block & item IDs
Look up the exact minecraft: block name to drop into your /fill command.