Minecraft commands can complete certain tasks such as spawning an item, changing the time and weather, or making chat messages appear. Commands are time savers and game changers, enabling creators to do something “in an instant.”
The /fill command, specifically, can be used to create large boxes of the same block, which is extremely useful for making rooms and hallways.
The /fill command looks something like this:
/fill ~ ~ ~ ~5 ~3 ~5 cobblestone
When is the Fill Command Useful?
Think about someone spending a ton of time building out a large room, only to realize the walls of that room need to be changed when all was already said and done.
Instead of tearing things down and rebuilding, the /fill command can fill a space with a type of block either all the way through, or hollowed on the inside. In fact, filling a space with an air block clears that space and is useful for making room in a world or removing mistakes.
The Different Parts of the Fill Command
Let's look at a sample fill command:
/fill ~ ~ ~ ~5 ~1 ~5 planks
Breaking this down:
1. /fill is the actual command, telling Minecraft to fill the chosen area.
2. ~ ~ ~ is the location to start placing blocks, with each number (or tilde) representing an X Y and Z coordinate (in that order).
More specifically, the /fill command uses coordinates (represented by numbers) to figure out the start and end coordinates to start filling in with blocks. "~" represents the player's coordinates so you don't have to find them.
3. “~5 ~1 ~5” is the ending location, and, like the starting location, has an X, Y, and Z coordinate (in that order).
So, ~5 ~1 ~5 means stop filling 5 blocks to the left of the player, 1 block higher than the player, and 5 blocks forward from the player!
4. “Planks” is the space to input the type of block to fill the space with.
Example of How to Use /Fill in Minecraft
Building off of the explanation above, let's walk through an example.
First, we will create a new flat creative world called "Fill" using these settings:
Using the /fill command, we want to create a box made of cobblestone with a length and depth of 5, and a height of 3.
It should look something like this:
The command to create this box is:
/fill ~ ~ ~ ~5 ~3 ~5 cobblestone
But wait! If we dig inside this box though, we see that it's filled all the way through! This won't work well for making a room...
So to make a room, we will need to modify the command a bit.
Let's type in the command again, but add "outline" to the end:
/fill ~ ~ ~ ~5 ~3 ~5 cobblestone outline
Now when we dig inside the block, we will see the inside is now hollow, and much more fitting for a room:
Using /fill to Erase
While the above is cool and useful, you can also use the /fill command to get rid of a number of blocks at once!
Stand in the same corner you stood in to create the box, and instead use fill with "air" as the block.
/fill ~ ~ ~ ~5 ~3 ~5 cobblestone air
Now the whole box is gone!
What is air?
In Minecraft, an air block is an invisible, collision-less block that makes up the skies. While you can't interact with it, it is still technically a block and can be used to "fill" a space with empty air, effectively erasing it.
This is very useful for removing chunks of filled rooms, making space in a mountain, or undoing a /fill.