Ad · Sztuka HarmoniiAdConsultations and ADHD assessment in English · −50% off your first visit · Sztuka HarmoniiPsychologist in English · −50% · Sztuka HarmoniiBook
Discord
Ad · Sztuka HarmoniiConsultations and ADHD assessment in EnglishPsychologist in EnglishIn Gdańsk, Gdynia or online.−50%off your first visitBook an appointmentBook

/fill command

The /fill command fills a rectangular area (a cuboid) with the block of your choice. It has five modes: replace, destroy, hollow, outline and keep. It's the go-to tool for fast building and terrain editing.

Building OP 2 since 1.8

Syntax

Java and Bedrock Edition

/fill <x1 y1 z1> <x2 y2 z2> <block> [mode]

Parameters in <angle brackets> are required. Parameters in [square brackets] are optional.

Parameters

Parameter Type Required Description
x1 y1 z1 coordinates Yes The first corner of the cuboid. Absolute or relative (~) coordinates.
x2 y2 z2 coordinates Yes The opposite corner of the cuboid. The order of the corners doesn't matter.
block block ID Yes The block to place. It can include block states, for example oak_stairs[facing=east,half=top].
mode replace|destroy|hollow|outline|keep No The fill mode. Defaults to "replace". The hollow mode builds a box, outline fills only the outer layer, keep doesn't overwrite existing blocks, and destroy breaks blocks so they drop as items.

Usage examples

Example 1
/fill ~-5 ~-1 ~-5 ~5 ~-1 ~5 stone

Makes an 11x11 stone platform under your feet. A quick floor to build on.

Example 2
/fill ~-10 ~ ~-10 ~10 ~10 ~10 air

Erases a 21x11x21 block area around you. Handy for clearing terrain.

Example 3
/fill 0 64 0 20 74 20 oak_planks hollow

Builds a 21x11x21 box out of oak planks. The walls are solid and the inside is empty (air).

Example 4
/fill ~-3 ~-1 ~-3 ~3 ~-1 ~3 grass_block replace dirt

Turns dirt into grass blocks in a 7x1x7 area under you. With a filter, replace mode only changes the block you name.

Example 5
/fill ~-20 -64 ~-20 ~20 -60 ~20 deepslate_diamond_ore

Fills a large area deep underground with deepslate diamond ore. Useful for testing mining farms.

Tips and tricks

*

The /fill limit is 32,768 blocks at once (a 32x32x32 cube). For bigger areas, use several /fill commands or a data pack with a loop.

*

The destroy mode breaks blocks as if they were mined with a tool, with drops and particle effects. Over large areas, it can cause lag from hundreds of thousands of dropped items.

*

Use /fill ... air to clear terrain quickly, but remember: there's no undo. Back up your world before big operations.

*

Combine /fill with /execute to fill areas relative to each entity. It's a powerful tool for adventure maps and server events.

Related commands

Frequently asked questions

How do you use the /fill command in Minecraft?

Open the chat with the T or / key and type the command using this syntax: /fill <x1 y1 z1> <x2 y2 z2> <block> [mode]. The /fill command fills a rectangular area (a cuboid) with the block of your choice. It has five modes: replace, destroy, hollow, outline and keep. It's the go-to tool for fast building and terrain editing.

What permissions does /fill require?

The /fill command requires permission level 2: Operator (OP 2). In singleplayer with cheats turned on, you automatically have full permissions. On a multiplayer server, you need operator status, which is granted with the /op command.

Does /fill work in Bedrock Edition?

Yes, the /fill command works in both Java Edition and Bedrock Edition, with similar syntax.