Minecraft · Wiki · Command

/fill

Fills a region with a block.

TypeCommand

Data checked Oct 21, 2026

The /fill command fills a rectangular area with a block. It can build walls, floors and hollow boxes in seconds, clear huge areas, drain water, replace one block type with another and outline structures. It is one of the most powerful building tools in Minecraft. This command reference covers the full syntax in Java and Bedrock, every fill mode, block states, size limits, practical recipes and common errors. For beginners, the guide build faster with /fill and /setblock gives a gentle introduction.

Syntax

Edition Syntax
Java /fill <from> <to> <block> [destroy|hollow|keep|outline|replace [filter]|strict]
Bedrock /fill <from> <to> <tileName> [blockStates] [destroy|hollow|keep|outline|replace]
Bedrock replace /fill <from> <to> <tileName> [blockStates] replace [replaceTileName] [replaceBlockStates]
  • from and to: two opposite corners of the box, as X Y Z coordinates. Relative ~ coordinates work too.
  • block: the block ID, such as stone, glass or air. Java supports block states in square brackets, such as oak_stairs[facing=north].
  • mode: how to treat existing blocks; replace is the default.

Fill modes

Mode What it does
replace Replaces every block in the area (default). With a filter, only replaces that block type.
destroy Breaks existing blocks as if mined, dropping items, then places the new block
keep Only fills air; existing blocks stay
hollow Fills the outer shell and replaces the inside with air: a hollow room
outline Fills the outer shell but leaves the inside untouched
strict (Java) Places blocks without updating neighbors, useful for technical builds

Size limit

A single /fill can change up to 32,768 blocks by default, for example a 32 by 32 by 32 cube. Larger areas give an error. Split big jobs into several commands. In recent Java versions, operators can raise the limit with a game rule for block modification limits, but large changes can lag or crash weaker computers, so increase it carefully.

Practical /fill recipes

Goal Example
Flat stone floor /fill ~-10 ~-1 ~-10 ~10 ~-1 ~10 stone
Clear an area above ground /fill ~-15 ~ ~-15 ~15 ~20 ~15 air
Hollow glass box /fill ~ ~ ~ ~10 ~6 ~10 glass hollow
Walls only, keep inside /fill ~ ~ ~ ~10 ~6 ~10 stone_bricks outline
Drain water /fill ~-15 ~-10 ~-15 ~15 ~ ~15 air replace water
Remove lava in a cave /fill ~-10 ~-10 ~-10 ~10 ~10 ~10 air replace lava
Swap dirt for grass /fill ~-20 ~-3 ~-20 ~20 ~3 ~20 grass_block replace dirt
Fill only air with leaves /fill ~ ~ ~ ~5 ~5 ~5 oak_leaves keep

Draining oceans and ocean monuments

Replacing water with air is the fastest way to drain an area, such as around an ocean monument. Waterlogged blocks like seagrass, kelp and slabs need separate handling: replace seagrass and kelp with air too, or the water may come back. In Bedrock, you may need to run replace for water and flowing water.

Using block states

In Java, add properties in square brackets to control orientation and type, for example /fill ~ ~ ~ ~5 ~ ~ oak_stairs[facing=east,half=top]. In Bedrock, block states go in square brackets after the tile name using its own state names. Block states let you fill whole roofs with correctly facing stairs or upper slabs in one command.

Finding the corner coordinates

Stand at one corner and read your coordinates; see how to see coordinates. In Java, look at the block and check the Targeted Block line on the F3 screen for its exact coordinates. Write down both corners, then type them in. Relative coordinates with ~ are quicker for areas around you: ~-5 ~ ~-5 to ~5 ~5 ~5 creates an 11 by 6 by 11 area centered on you.

Permissions

/fill requires cheats or operator permission. In Bedrock, using commands disables achievements in that world. /fill only works in loaded chunks, so stay near the area you are changing.

Common errors

  • Too many blocks in the specified area: over 32,768 blocks; split it into smaller commands.
  • That position is not loaded: part of the area is too far away; move closer.
  • Unknown block type: misspelled ID; use underscores, such as stone_bricks.
  • No blocks were filled: the area already contains that block, or keep mode found no air.
  • Water came back: waterlogged blocks or flowing water remain; replace those too.
  • Dropped items everywhere: you used destroy mode, which drops blocks. Use replace to remove them without drops.

Tips for big builds

  • Make a backup before large fills, because there is no undo.
  • Use outline and hollow to create rooms, then fill details with /setblock.
  • Break huge areas into layers of 32 blocks.
  • Use /clone to copy finished sections instead of filling them again.
  • For terraforming beyond /fill, Java players often use the WorldEdit mod, which has an undo button.

Related commands

  • /setblock: place a single block.
  • /clone: copy an area to another place.
  • /tp: move to the area first.

/fill FAQ

What is the /fill limit?

32,768 blocks per command by default.

How do you make a hollow box?

Add hollow at the end of the command.

How do you remove water with /fill?

/fill corner1 corner2 air replace water.

Does /fill drop items?

Only in destroy mode.

/fill in command blocks

Command blocks running /fill power many map mechanics. A button that runs /fill on a doorway with air opens a secret passage, and a second button that fills it with stone closes it again. Arena maps reset destroyed floors by filling them back with the original block after each round. Parkour maps use /fill with replace to swap colored blocks on a timer, making platforms appear and disappear. Because command blocks run instantly and often, keep each fill small so the game does not lag, and test the coordinates carefully: a wrong corner can fill your whole map with stone.

Clearing land for a base

Flattening land is one of the most common uses. Stand in the middle of the area, then clear above ground with air in layers of about 30 blocks high and 30 blocks wide, and fill the ground level with grass_block or dirt. Afterwards, run a replace command to turn stray leaves, flowers and tall grass into air so the surface looks clean. Doing it in sections avoids the block limit and makes it easier to fix mistakes. On survival worlds, many players prefer to clear land by hand for the resources, and only use /fill in creative test worlds to plan the layout.

/fill and lighting

Filling large areas with air underground creates huge dark rooms where mobs can spawn. After clearing a cave or a big hall, add light sources, or fill the floor with a block mobs cannot spawn on, such as glass, slabs or carpet. Filling the area with light blocks in Java or Bedrock is another option for map makers, because light blocks are invisible and give light without visible torches.

/fill vs WorldEdit

/fill is built into vanilla Minecraft and works in single player, Realms and servers with operator access, with no mods. Its main limits are the block cap and the lack of undo. WorldEdit, a popular mod and server plugin for Java, adds selection tools, larger operations, brushes and undo, so big terraforming teams often use it. For everyday building jobs, though, /fill is fast and always available.

Always double-check both corners before pressing Enter, since the box between them is what changes.

A quick test on a small area first is a good habit.

Fill commands are also great for testing redstone, since you can reset a whole test area with one line.

More about Minecraft

See all