Skip to content

Type to search across every guide and reference page.

CommandsBoth · 26.x

Minecraft /fill Command: Hollow, Replace and Other Modes

/fill sets every block between two corners to one block. Java and Bedrock syntax, relative coordinates, the hollow, outline, keep and replace modes.

By minecraft.bd Editorial Team·Updated

/fill sets every block in a box to one block type. You give it two opposite corners and a block: /fill ~-5 ~-1 ~-5 ~5 ~-1 ~5 stone lays an 11x11 stone floor under you. Add a mode at the end to make hollow boxes, replace specific blocks or avoid overwriting what’s there. One command can change up to 32,768 blocks.

/fill syntax

Java Edition

/fill <from> <to> <block> [destroy|hollow|keep|outline|replace [<filter>]]

Bedrock Edition

/fill <from> <to> <tileName> [blockStates] [destroy|hollow|keep|outline|replace]
/fill <from> <to> <tileName> [blockStates] replace [replaceTileName] [replaceBlockStates]

from and to are any two opposite corners. Use absolute coordinates (100 64 -200) or relative ones with ~ (~5 means five blocks from where you are).

Modes

Mode What happens
replace (default) Every block in the area becomes the new block. Optionally only replaces one type.
destroy Like replace, but old blocks drop as items, as if mined.
keep Only fills air. Existing blocks stay.
hollow Builds the outer shell; the inside becomes air.
outline Builds the outer shell; the inside is left untouched.

Worked examples

A 21x21 glass box around you, empty inside:

/fill ~-10 ~-1 ~-10 ~10 ~10 ~10 glass hollow

Clear all water in a 21x11x21 area (great for draining a monument):

/fill ~-10 ~-5 ~-10 ~10 ~5 ~10 air replace water

Turn all stone near you into diamond ore (for testing, not survival):

/fill ~-8 ~-8 ~-8 ~8 ~8 ~8 diamond_ore replace stone

Fill gaps in a floor without touching what’s there:

/fill ~-5 ~-1 ~-5 ~5 ~-1 ~5 oak_planks keep

Block states, Java style, for stairs facing east:

/fill ~ ~ ~ ~10 ~ ~ oak_stairs[facing=east]

On Bedrock, states are written as quoted key-value pairs, for example ["minecraft:cardinal_direction"="east"].

Common mistakes

  • Too many blocks. Over 32,768 and nothing happens. A 40x40x40 job needs to be split.
  • Unloaded chunks. Both corners and everything between must be loaded. Teleport closer first with /tp.
  • Filling yourself in. /fill with your own position inside the box will trap you in stone. Use hollow or move first.
  • Expecting the replace filter on destroy or hollow. Only replace takes a filter block.
  • Liquids. Water and lava placed by /fill are source blocks and will flow out once the area is opened.

For mass building on Java servers, the WorldEdit guide covers a faster tool without the block limit. To run /fill around every player at once, combine it with /execute. More commands are on the commands hub.

Common questions

What is the maximum area /fill can change?

32,768 blocks per command, which is a 32x32x32 cube. Split bigger jobs into several commands, or use WorldEdit on Java.

How do you replace one block with another using /fill?

Add replace and the block to replace at the end. Java: /fill ~-10 ~-5 ~-10 ~10 ~5 ~10 air replace water. Bedrock uses the same order.

How do you make a hollow box with /fill?

Use the hollow mode, which builds the outer shell and fills the inside with air, or outline, which builds the shell and leaves the inside alone.

Sources & verification

Facts on this page are checked against these references and in-game behavior for the stated edition(s). how we verify.

Keep reading