One of the most commonly used construction commands in Minecraft is /fill. You can use this command to place lots of blocks in a certain area instantly. To use this command, follow these steps:
Go to a corner of the area you want to fill.
The Fill command affects blocks in a box-shaped region, up to 32,768 blocks in volume. Pick any of the 8 corners of the box you want to fill.
Press F3.
This step displays a bunch of information about the current game.
Record your coordinates.
Part of the information displayed in F3 mode is a line that says Block: followed by three numbers. These numbers tell you where exactly your character is. The X and Z coordinates of your character tell you where you are on the plane parallel to the ground, whereas your Y coordinate tells you your height. Make a note of these numbers because you’ll need to write them into the command.
Move to the opposite corner of the area you want to fill.
Record the coordinates there.
Alternatively, use relative coordinates: A tilde (~) in a command indicates that a coordinate is relative to your own position. So ~ ~ ~ indicates your current position, and ~ ~-1 ~ indicates the block below you.
Press the “T” key to open the Chat menu, and type /fill [your first coordinates] [your second coordinates].
For example, you might enter /fill 1123 20 16 1122 30 -16.
Enter a space, and then type minecraft: (or press Tab as a shortcut).
Every block in this game has a technical name, such as minecraft:stone, minecraft
lanks, or minecraft:redstone_torch. The first part is necessary only for autocompletion purposes, as described in Step 8.
If you already know the technical name of the block, don’t type only minecraft:; go ahead and type minecraft:stone or minecraft
lanks or whatever the name is, and then skip to Step 10. If you don’t know the technical name of the block, stick with Step 7 as written and then go on to Step 8.
Press Tab to see a list of block names.
From here, you can find the block that you want to fill the area. If you know that its name starts with a certain couple of letters, type those letters, and then press Tab for a narrower search. After you see which block you want to use, type it after the minecraft:.
Press the spacebar again, and enter the data value of the block.
This is 0 by default — if you select another number, it chooses a variant of the block. For example, wooden planks have a different color based on the data value you give them.
Steps 9 and 10 are optional — however, if you complete Step 10, you must complete this one as well.
Press the spacebar again, and enter a keyword indicating how to handle blocks that are already inside the fill area.
You can pick one of five different keywords:
replace: With this keyword, when you fill the target area, any block already in that area is replaced. Alternatively, you can type replace followed by a space and then the name of another block (see Steps 7 and 8). This makes it so that the /fill command replaces every block of that type only in the target area rather than filling up the whole area.
Note that replace is the default keyword. At this point the command should look like /fill 1123 20 16 1122 30 -16 minecraft:wool 1 replace.
destroy: All existing blocks in the target area are destroyed, just as though a player mined them.
keep: This command does not affect blocks already in the target area (except for air, of course).
hollow: With this command, only the outer layer of the target area is filled with blocks — all blocks on the inside are replaced with air.
outline: Only the outer layer of the target area is filled with blocks, but blocks on the inside remain as they were.
Go to a corner of the area you want to fill.
The Fill command affects blocks in a box-shaped region, up to 32,768 blocks in volume. Pick any of the 8 corners of the box you want to fill.
Press F3.
This step displays a bunch of information about the current game.
Record your coordinates.
Part of the information displayed in F3 mode is a line that says Block: followed by three numbers. These numbers tell you where exactly your character is. The X and Z coordinates of your character tell you where you are on the plane parallel to the ground, whereas your Y coordinate tells you your height. Make a note of these numbers because you’ll need to write them into the command.
Move to the opposite corner of the area you want to fill.
Record the coordinates there.
Alternatively, use relative coordinates: A tilde (~) in a command indicates that a coordinate is relative to your own position. So ~ ~ ~ indicates your current position, and ~ ~-1 ~ indicates the block below you.
Press the “T” key to open the Chat menu, and type /fill [your first coordinates] [your second coordinates].
For example, you might enter /fill 1123 20 16 1122 30 -16.
Enter a space, and then type minecraft: (or press Tab as a shortcut).
Every block in this game has a technical name, such as minecraft:stone, minecraft

If you already know the technical name of the block, don’t type only minecraft:; go ahead and type minecraft:stone or minecraft

Press Tab to see a list of block names.
From here, you can find the block that you want to fill the area. If you know that its name starts with a certain couple of letters, type those letters, and then press Tab for a narrower search. After you see which block you want to use, type it after the minecraft:.
Press the spacebar again, and enter the data value of the block.
This is 0 by default — if you select another number, it chooses a variant of the block. For example, wooden planks have a different color based on the data value you give them.
Steps 9 and 10 are optional — however, if you complete Step 10, you must complete this one as well.
Press the spacebar again, and enter a keyword indicating how to handle blocks that are already inside the fill area.
You can pick one of five different keywords:
replace: With this keyword, when you fill the target area, any block already in that area is replaced. Alternatively, you can type replace followed by a space and then the name of another block (see Steps 7 and 8). This makes it so that the /fill command replaces every block of that type only in the target area rather than filling up the whole area.
Note that replace is the default keyword. At this point the command should look like /fill 1123 20 16 1122 30 -16 minecraft:wool 1 replace.
destroy: All existing blocks in the target area are destroyed, just as though a player mined them.
keep: This command does not affect blocks already in the target area (except for air, of course).
hollow: With this command, only the outer layer of the target area is filled with blocks — all blocks on the inside are replaced with air.
outline: Only the outer layer of the target area is filled with blocks, but blocks on the inside remain as they were.