To use the fill command in Minecraft, you replace every block inside a rectangular region with a block of your choice. The process is straightforward once you know the exact syntax and have cheats enabled.
Step 1: Enable cheats in your Minecraft world
Cheats must be enabled for the fill command to work. This enables cheats temporarily for that session.
Step 2: Understand the fill command syntax
The basic syntax is /fill <from> <to> <block>. You need two sets of x y z coordinates that define opposite corners of the region you want to fill. To get these coordinates, press F3 (Java Edition) or check your coordinates in the settings (Bedrock Edition). Stand at one corner and note the numbers, then move to the opposite corner and note those numbers.
Step 3: Execute a basic fill command
- Press the T key to open the chat window.
- Type a command such as
/fill ~ ~ ~ ~5 ~5 ~5 stone. The tilde (~) symbols mean relative to your current position, so this fills a 6x6x6 cube of stone starting at your feet. - Press Enter to execute the command and watch the blocks appear.
Optional fill modes: hollow, outline, destroy, and more
The optional fillMode arguments modify how the blocks are placed. There are five modes: destroy, hollow, keep, outline, and replace. You add one of these keywords at the end of your command.
- destroy replaces existing blocks and drops them as items. Use this when you want to collect the blocks you are removing.
- hollow fills only the outer edge of the region, leaving the inside empty. This is useful for building rooms or containers.
- outline replaces only the blocks on the outer edge of the region, leaving inner blocks untouched. This creates a wireframe of your shape.
- keep replaces only air blocks inside the region, leaving any existing blocks in place. This is ideal for filling empty spaces without destroying what is already built.
- replace lets you specify an additional block type to swap out. For example,
/fill ~ ~ ~ ~10 ~10 ~10 stone replace dirtturns all dirt into stone within that area.
Practical tips for using the fill command
Use relative coordinates (~) to avoid needing absolute positions. For example, /fill ~ ~ ~ ~10 ~ ~10 fills a flat 11x11 square at your feet. Combine the fill command with command blocks for automation, such as setting up a repeating command block that refills a structure after an explosion. Use the air block to clear large areas quickly, like /fill ~ ~ ~ ~20 ~20 ~20 air to remove everything in a 21x21x21 cube.

















