Minecraft /fill Command
Fills a 3D cuboid region between two coordinates with a specified block, supporting replace filters, hollow rooms, outer wall outlines, and destruction.
Version Compatibility
Command Syntax
/fill <from> <to> <block>[<states>] [destroy|hollow|keep|outline|replace] [<filter>]/fill <from> <to> <tileName> [tileData|blockStates] [replace|destroy|hollow|keep|outline] [<replaceTileName>]Arguments Explained
from (X Y Z)CoordinatesRequiredFirst corner of the 3D cuboid bounding box.
to (X Y Z)CoordinatesRequiredOpposite diagonal corner of the bounding box.
block / tileNameNamespaced Block IDRequiredBlock type to place (e.g. minecraft:stone, glass, oak_planks).
modeFill ModeHandling mode: replace (default), keep (fills air only), outline (outer perimeter shell), hollow (outer shell with air center), destroy (breaks blocks dropping items).
filter / replaceTileNameBlock FilterWhen mode is replace, only blocks matching this ID will be substituted.
Practical Examples
/fill ~-10 ~-1 ~-10 ~10 ~-1 ~10 minecraft:stone_bricksCreates a 21x21 stone brick floor directly beneath your feet.
Fast foundation platform builder.
/fill ~-5 ~ ~-5 ~5 ~8 ~5 minecraft:glass hollowCreates an 11x9x11 hollow glass room with an empty interior.
Instant greenhouse or underwater shelter.
/fill ~-15 ~-3 ~-15 ~15 ~15 ~15 minecraft:air replace minecraft:waterDrains water from an ocean or cave area without affecting stone or sand.
Clearing flooded structures.
/fill ~-20 ~-5 ~-20 ~20 ~15 ~20 minecraft:air replaceClears a massive 41x21x41 volume into empty air without spawning laggy item entities.
Terrain clearing for large-scale creative builds.
/fill ~-4 ~ ~-4 ~4 ~4 ~4 minecraft:oak_planks outlineConstructs the outer walls, floor, and ceiling of a cube without altering the interior.
Frame building without overwriting pre-placed furniture.
Common Mistakes
Mistake:
Exceeding the 32,768 block volume limit (e.g. filling a 35x35x35 cube is 42,875 blocks)
Fix:
Divide the volume into smaller coordinate chunks or vertical layers.
Mistake:
Using destroy mode on large volumes, generating thousands of floating items and crashing TPS
Fix:
Use "air replace" instead of "destroy" to delete blocks cleanly without item drops.
Mistake:
Forgetting that coordinates are inclusive: ~ ~ ~ to ~10 ~ ~ fills 11 blocks, not 10
Fix:
Remember the starting block counts as 1. For a 10-wide wall, offset by +9.
Java vs Bedrock Differences
Java Edition supports block states in square brackets [facing=north,waterlogged=false]. Bedrock Edition supports block states in JSON or legacy integer tileData, and in some platforms allows larger volume limits.
Command Block Usage & Automation
Connect an Impulse command block to an arena reset button: "/fill 100 64 100 120 64 120 stone_bricks replace air" to regenerate the floor after each battle, or clear hazardous lava puddles during puzzle runs.
Useful Tips
Use hollow mode to instantly generate houses or protective bubbles around yourself.
Use keep mode to fill in holes, caves, or ravines without destroying pre-existing structures.
Combine relative coordinates ~ with negative offsets (e.g. ~-5 ~-1 ~-5 to ~5 ~-1 ~5) to center floors around your avatar.
Important Notes
Minecraft enforces a hard limit of 32,768 blocks per /fill command execution to prevent server crashes. To fill larger zones, split the coordinates into multiple adjacent slices.
Frequently Asked Questions
Can I undo a /fill command if I made a mistake?
There is no native undo command in vanilla Minecraft. Always create a backup of your world or test coordinates with a smaller volume first.
Why did my fill command say "Cannot place blocks outside of the world"?
Either the coordinates are outside the world build limits (Y -64 to 320 in Java), or the target area is in unloaded chunks.
What is the difference between hollow and outline modes?
Outline fills the outer shell and leaves whatever blocks were already inside. Hollow fills the outer shell and forces all interior blocks to become air.
Related Commands
Ready to build your command?
Use our interactive generator to create error-free /fill commands with a visual interface.
Open Command Generator