Fill Regions with Blocks Using /fill
The /fill command lets you place blocks across an entire three-dimensional region between two sets of coordinates. You can choose to replace every block in the area, build hollow boxes, or swap out only specific blocks using a filter.
Players and server operators use this command to speed up building projects, clear out rooms, or construct walls and floors in seconds. Because it alters the world directly, you need Level 2 operator permissions or cheats turned on in single-player to run it.
/fill <from> <to> <block>/fill <from> <to> <block> destroy/fill <from> <to> <block> hollow/fill <from> <to> <block> keep/fill <from> <to> <block> outline/fill <from> <to> <block> replace/fill <from> <to> <block> replace <filter>/fill <from> <to> <block> replace <filter> destroy/fill <from> <to> <block> replace <filter> hollow/fill <from> <to> <block> replace <filter> outline/fill <from> <to> <block> replace <filter> strict/fill <from> <to> <block> strict/fill <from> <to> <block>/fill <from> <to> <block> destroy/fill <from> <to> <block> hollow/fill <from> <to> <block> keep/fill <from> <to> <block> outline/fill <from> <to> <block> replace <filter>/fill <from> <to> <block> replace <filter> hollow/fill <from> <to> <block> strict| Argument | Type | What it means |
|---|---|---|
<from> | block position | The starting block position using three x y z coordinates, where ~ represents relative coordinates and ^ represents local coordinates. |
<to> | block position | The ending block position using three x y z coordinates, which can also use ~ for relative or ^ for local positions. |
<block> | block | The block ID to place in the region, which can optionally include block states and NBT data like oak_stairs[facing=east]. |
<filter> | block test | A block test using a block ID or #tag, optionally with states, to match which blocks get replaced. |
/fill 10 64 10 20 64 20 stoneCreates a flat stone floor from coordinates 10, 64, 10 to 20, 64, 20.
/fill ~-3 ~ ~-3 ~3 ~4 ~3 glass hollowBuilds a hollow glass room around your current position using relative coordinates.
/fill 100 70 100 105 75 105 air destroyClears a region of blocks by filling it with air using the destroy mode.
/fill ~1 ~ ~1 ~10 ~ ~10 oak_stairs[facing=east] keepPlaces east-facing oak stairs near you while using the keep mode.
/fill -50 60 -50 -40 65 -40 cobblestone outlineConstructs an outer shell of cobblestone along the edges of the specified coordinate box.
/fill ~-5 ~-2 ~-5 ~5 ~2 ~5 grass_block replace dirtReplaces all dirt blocks near the player with grass blocks.
/fill ^ ^ ^2 ^5 ^3 ^7 stone_bricks replace #logs outlineUses local coordinates ahead of your view to replace any blocks matching the logs tag with a stone brick outline.
/fill 0 80 0 15 80 15 oak_planks strictFills a flat area at altitude 80 with oak planks using the strict keyword.
Measured from the game files of every Java release from 1.13 to 26.3.
+ /fill <from> <to> <block> replace+ /fill <from> <to> <block> replace <filter>+ /fill <from> <to> <block> replace <filter> destroy+ /fill <from> <to> <block> replace <filter> hollow+ /fill <from> <to> <block> replace <filter> outline+ /fill <from> <to> <block> replace <filter> strict− /fill <from> <to> <block> replace [<filter>]and 1 moreBedrock Edition also includes the /fill command, but the argument structure is slightly different. Instead of putting block states inside brackets attached to the block ID, Bedrock uses a separate <blockStates: block properties> argument after the block name, and the replace mode uses separate [replaceTileName: Block] and [replaceBlockStates: block properties] parameters.
You need permission level 2 to run /fill, which means you must be an operator on a multiplayer server or have cheats enabled in your single-player world.
Yes, the syntax changed in Java Edition 1.21.5, which added new combinations attaching modes like destroy, hollow, outline, and strict onto the end of replace <filter> commands.
Use the /fill <from> <to> <block> replace <filter> syntax and put the block ID or block tag you want to remove in the <filter> spot.
/clone/difficulty/fillbiome/forceload/gamerule/locate/place/seed/setblock/setworldspawn/time/waypoint/weather/worldborder