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.
/fill at a glance
Syntax
/fill <from> <to> <block>…Who may run it
OP (L2)
What it does
Fills a region between two coordinates with a specified block. Supports various fill modes and optional…
Three things /fill is actually used for
/fill ~-5 ~ ~-5 ~5 ~ ~5 minecraft:stoneLays an eleven by eleven stone floor centred on you, 121 blocks in one command.
/fill ~-5 ~ ~-5 ~5 ~4 ~5 minecraft:airClears a room five blocks tall around you, which is the fastest way to hollow out a build site.
/fill ~-8 ~ ~-8 ~8 ~ ~8 minecraft:glass replace minecraft:waterTurns only the water in that square into glass and leaves every other block alone.
/fill sits with the world commands in Minecraft, 9 of them in total. The ones with a guide here: /clone, /locate, /setblock, /summon.
Every command with its full argument list lives in the command reference.
Blocks and items in this guide
Target is named in the guide above. Look them up in the item database.
More guides on this site
Guides that go with this one
How to Use the /setblock Command in Minecraft
Place any block at exact coordinates with /setblock. Learn relative ~ and absolute syntax, block states,...
How to Use the /clone Command in Minecraft
Copy any region to a new spot with /clone. Learn the source and destination syntax, the replace, masked,...
How to Use the /summon Command in Minecraft
Spawn any mob with /summon, set exact coordinates with ~ ~ ~, and customize it using NBT tags like...
How to Use the /gamemode Command in Minecraft
<> One command swaps a player between Survival, Creative, Adventure and Spectator. Learn the full...
How to Make a Custom Command with Skript
Learn how to create a custom command in Minecraft using Skript. Step-by-step guide covering syntax,...
How to Hide Commands from Players on a Minecraft Server
Learn how to hide commands from players on a Minecraft server using Paper's command-block settings,...
Database →
Command Reference
Syntax, arguments and examples for every command.
Hosting →
Managed Hosting
Skip the setup: a managed server online in minutes.
Database →
Item Database
Every item with its stats, IDs, recipes and uses.
Guides →
More Server & Admin guides
Run a server: setup, hosting, permissions, worlds and crossplay.