Skip to content
/craftcmd

Replace One Block Type with Another

Change all blocks of one type in a region to a different type

⚠︎ Awaiting in-game verification for Java 26.2

Replaces only dirt blocks with stone in the specified region, leaving other blocks unchanged.

/fill ~-10 ~ ~-10 ~10 ~10 ~10 stone replace dirt
48 characters

How to use

  1. Open chat (T on Java, / on Bedrock).
  2. Paste the command with your desired block types.
  3. Press Enter — only matching blocks change.

Related commands

Place one block at a specific spot

/setblock ~ ~ ~ stone

Delete a region of blocks by filling it with air

/fill ~ ~ ~ ~10 ~10 ~10 air

Create a hollow room or box out of any block

/fill ~ ~ ~ ~10 ~6 ~10 stone hollow

Create a pool or lake by filling a region with water

/fill ~ ~ ~ ~10 ~ ~10 water

Swap every block of one type for another in a region

/fill ~ ~ ~ ~10 ~10 ~10 stone replace dirt

Instantly place a chest at a specific location

/setblock ~ ~ ~ chest