/fill Command in Minecraft Java Edition

Fill Regions with Blocks Using /fill

Java EditionWorld & BlocksPermission: Level 2Bedrock version →

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.

Syntax (Java 26.3, 12 forms)

  1. /fill <from> <to> <block>
  2. /fill <from> <to> <block> destroy
  3. /fill <from> <to> <block> hollow
  4. /fill <from> <to> <block> keep
  5. /fill <from> <to> <block> outline
  6. /fill <from> <to> <block> replace
  7. /fill <from> <to> <block> replace <filter>
  8. /fill <from> <to> <block> replace <filter> destroy
  9. /fill <from> <to> <block> replace <filter> hollow
  10. /fill <from> <to> <block> replace <filter> outline
  11. /fill <from> <to> <block> replace <filter> strict
  12. /fill <from> <to> <block> strict

The forms you will use most

/fill <from> <to> <block>
Fills the entire region between the two coordinates with the chosen block.
/fill <from> <to> <block> destroy
Fills the region with the chosen block using the destroy mode.
/fill <from> <to> <block> hollow
Creates a hollow box of the chosen block across the selected region.
/fill <from> <to> <block> keep
Fills the area while keeping existing blocks according to the keep mode.
/fill <from> <to> <block> outline
Builds an outer frame of the chosen block around the boundary of the region.
/fill <from> <to> <block> replace <filter>
Replaces only the blocks inside the region that match the specified block ID or tag filter.
/fill <from> <to> <block> replace <filter> hollow
Applies the hollow fill mode while filtering for specific existing blocks.
/fill <from> <to> <block> strict
Fills the region between the coordinates using the strict placement option.

Arguments

ArgumentTypeWhat it means
<from>block positionThe starting block position using three x y z coordinates, where ~ represents relative coordinates and ^ represents local coordinates.
<to>block positionThe ending block position using three x y z coordinates, which can also use ~ for relative or ^ for local positions.
<block>blockThe block ID to place in the region, which can optionally include block states and NBT data like oak_stairs[facing=east].
<filter>block testA block test using a block ID or #tag, optionally with states, to match which blocks get replaced.

Examples

Fill Command GeneratorFill an area with blocks, hollow boxes, outlines or replace one block with another.Open generator →

Version history

Measured from the game files of every Java release from 1.13 to 26.3.

  1. 1.21.5 Syntax changed.
    + /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 more
  2. 1.13 Already in the game in 1.13, the oldest Java version we track.

Tips

Common mistakes

Java vs Bedrock

Bedrock 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.

See /fill in Bedrock Edition →

FAQ

Who has permission to use the /fill command?

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.

Did the /fill command syntax change in recent versions?

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.

How do I replace only one specific block type in an area?

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.

Related commands

/clone/difficulty/fillbiome/forceload/gamerule/locate/place/seed/setblock/setworldspawn/time/waypoint/weather/worldborder

More on 9Minecraft