Skip to content
WikilyWIKILY
All games23 Wikis · pick your game
Commands and cheatsAll commands

Switch game

23 Wikis · pick your game
/fill

Command

/fill

Fills a box-shaped area between two corners with one block.

Syntax

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

Arguments

ArgumentKind of valueWhat to type
<from>Block positionOne corner of the area, as block coordinates X Y Z.
<to>Block positionThe opposite corner of the area.
<block>BlockThe block to place, optionally with block states in square brackets and data in curly brackets.
<filter>Block testFor replace: which existing blocks are replaced. A block id or a block tag starting with #, optionally with block states and data.

Details

Permission level2: operators, worlds with cheats on, command blocks and functions
Works inOperators on multiplayer servers, singleplayer worlds with cheats enabled, and command blocks and functions.
ResultReports "Successfully filled" with the number of blocks. The number /execute store saves is the number of blocks changed.
Size limitThe area may contain at most as many blocks as the game rule max_block_modifications allows (default 32768). A larger area fails with "Too many blocks in the specified area".
No modeWithout a mode, every block in the area is replaced.
replaceReplaces every block, or with a filter only the blocks that match the filter. After a filter one more mode can follow: outline, hollow, destroy or strict.
keepFills only the positions that are empty (Air) and leaves all other blocks as they are.
outlinePlaces the block only on the outer faces of the area and leaves the inside untouched.
hollowPlaces the block on the outer faces of the area and fills the inside with Air.
destroyBreaks the existing blocks first so that they drop as items, then places the new block.
strictPlaces the blocks exactly as written and skips the side effects of placing them, such as updates to neighboring blocks.
Loaded areaBoth corners must be in loaded chunks and inside the world.
Nothing changedThe command fails with "No blocks were filled" if no block was changed, for example when the area already consists of that block.

Examples

/fill ~-5 ~-1 ~-5 ~5 ~-1 ~5 minecraft:stone

Makes an 11 by 11 floor of Stone under you.

/fill ~-3 ~ ~-3 ~3 ~4 ~3 minecraft:glass hollow

Builds a Glass box around you and clears its inside.

/fill ~-3 ~ ~-3 ~3 ~4 ~3 minecraft:oak_planks outline

Builds the outer shell of a box from Oak Planks and keeps whatever is inside.

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

Removes all Water in the area around you.

/fill ~-5 ~ ~-5 ~5 ~3 ~5 minecraft:air destroy

Breaks every block in the area so that the blocks drop as items.

/fill ~-5 ~-1 ~-5 ~5 ~-1 ~5 minecraft:smooth_stone keep

Fills only the gaps in the floor under you with Smooth Stone.

/fill 0 64 0 10 64 10 minecraft:redstone_block strict

Places Blocks of Redstone without updating the blocks next to them.

Join the creator communityThe people who build the Minecraft Java Edition wiki are on our Discord. Ask questions or suggest pages.Join Discord (opens Discord in a new tab)