Updated:
First: how the coordinates work
These examples use ~, relative to where you stand: ~5 is five blocks along and ~-1 one block down. ^ is relative to where you look (see ~ vs ^). For exact placement, check coordinates on the F3 screen and type numbers.
1. Clear land
/fill ~-10 ~ ~-10 ~10 ~10 ~10 minecraft:air
Turns a 21×11×21 area around you into air, removing hills and trees. Blocks below your feet stay. One command can change up to 32,768 blocks (see the fill guide).
2. Lay a floor
/fill ~-5 ~-1 ~-5 ~5 ~-1 ~5 minecraft:smooth_stone
Makes an 11×11 floor one block below you. Using the same height twice gives a layer one block thick.
3. Build a hollow box
/fill ~2 ~ ~2 ~12 ~6 ~12 minecraft:glass hollow
hollow fills only the outside and empties the inside. Use outline to keep what is already inside.
4. Replace one block type
/fill ~-10 ~-5 ~-10 ~10 ~5 ~10 minecraft:stone_bricks replace minecraft:cobblestone
Swaps only the cobblestone in the area for stone bricks. Handy for trying out materials.
5. Copy a building
/clone 0 64 0 10 74 10 20 64 0 masked
Copies the box from 0 64 0 to 10 74 10, with its corner at 20 64 0. masked skips air, so the ground at the destination stays. /clone cannot rotate or mirror; use a structure block for that (see the clone guide).
6. Place a block facing a direction
/setblock ~ ~ ~2 minecraft:oak_stairs[facing=north]
Block states go in [ ]. Bedrock uses different state names, so follow the suggestions as you type (see the setblock guide).
7. Invisible light
/give @s minecraft:light
Lights an area without changing how it looks, which also stops mobs spawning inside builds. Bedrock uses a different ID, so pick it from the suggestions (see hidden items).
8. Invisible walls (barrier)
/give @s minecraft:barrier
A clear block nobody can pass. Use it to keep players inside an area or to fence off displays.
9. Change block shapes (debug stick)
/give @s minecraft:debug_stick
On Java, change how placed blocks face or connect, such as stair corners and fence links. Bedrock does not have it.
10. Freeze time and weather while you build
/time set noon
/gamerule advance_time false
/weather clear
Shadows and light stay the same, so you can judge how the build looks. On 1.21.10 and older use doDaylightCycle (see the gamerule list).
11. Change the biome around your build
/fillbiome ~-16 ~-16 ~-16 ~15 ~15 ~15 minecraft:cherry_grove
On Java, match grass and leaf colors to your build (see the fillbiome guide).
12. Place a saved build
/place template minecraft:mybuild ~ ~ ~
/structure load mybuild ~ ~ ~
The first line is Java and the second Bedrock. Place a build saved with a structure block as many times as you like (see the place guide).
Avoid mistakes
- Back up first: /fill and /clone cannot be undone. Copy the world before big changes.
- Check the area: try it small with
minecraft:glassbefore using the real block. - Too many blocks: over 32,768, split the area.
Common questions
- Do blocks removed by /fill drop? Normally they just vanish. Add
destroyto drop them as if mined. - Bedrock? /fill, /clone and /setblock exist there. /fillbiome, /place and the debug stick are Java only.
- Can I rotate a copy? Not with /clone. Use a structure block or /place template on Java, or /structure load on Bedrock.
Check your command
The Command Error Doctor checks common syntax mistakes in your browser.