The fastest way to replace blocks is the /fill command, which changes every block in a rectangular area at once

If you want to swap out a section of your world — say, turning a dirt platform into stone, or replacing all the oak wood in a structure with spruce — the /fill command does it in one line. You stand in the world, open the chat window (press T on keyboard, or the right bumper on console), type the command, and every matching block in the space you name changes to whatever you specify.

The command follows this pattern: /fill X1 Y1 Z1 X2 Y2 Z2 block_name. The first set of coordinates marks one corner of your replacement area; the second set marks the opposite corner. Minecraft then fills that entire rectangular box with the block you named. You can find your current coordinates by pressing F3 on Java Edition, or by looking at the coordinates display on console versions.

If you only want to replace blocks of one type — not fill the entire area — add replace old_block_name to the end. This tells Minecraft to swap only the old block for the new one, leaving everything else untouched. For example, /fill 100 64 200 150 70 250 stone replace dirt changes only the dirt blocks in that box to stone, leaving any grass, gravel, or other blocks alone.

Key Takeaways

  • The /fill command replaces blocks in a rectangular area using coordinates; add "replace" at the end to swap only one block type instead of filling the whole space.
  • You can find your current coordinates by pressing F3 on Java Edition or checking the coordinates display on console and mobile versions.
  • Block names must match exactly as they appear in the game — use the creative inventory or a wiki to verify the correct name if a command fails.
  • If you are not in Creative mode or do not have command permissions, you cannot use /fill; switch to Creative or ask a server admin to enable commands.
  • For smaller jobs, the hand-placement method or a mod like WorldEdit lets you select a region and replace blocks without typing coordinates.

Finding the exact block name your game recognizes

Block names in Minecraft changed between versions. In older Java editions, wood was called "log" or "log2"; in newer versions, it is "oak_log" or "spruce_log" depending on the type. If you type a name the game does not recognize, the command fails silently and nothing changes.

The safest way to get the right name is to open Creative mode in a test world, search for the block you want in the creative inventory, hover over it, and read the name that appears in the tooltip. That is the exact string to use in your command. Alternatively, the official Minecraft wiki lists every block name for your version under the "Data values" section of each block's page.

If you are playing on a server or a world where commands are disabled, you cannot use /fill at all. You will need either Creative mode access or permission from the server admin to turn on command blocks.

Using WorldEdit or other mods for larger replacements

If you are replacing blocks across a huge area or doing this repeatedly, a mod like WorldEdit is faster than typing coordinates by hand. WorldEdit lets you select a region by clicking two points with a tool, then run a single command to replace all blocks in that selection.

To use WorldEdit, you first install it (usually through a mod launcher like Forge or Fabric, depending on your version). Once loaded, you equip the selection wand (usually a wooden axe by default), left-click one corner of your area, right-click the opposite corner, then type //replace old_block new_block. The double slash tells the mod you are using a WorldEdit command, not a standard Minecraft command.

WorldEdit also includes undo and redo, so if you replace the wrong blocks, you can undo the last action without manually fixing it. This is especially useful if you are experimenting with how a structure looks in different materials.

Replacing blocks by hand when commands are not available

If you are in Survival mode without command access, you can still replace blocks — it just takes longer. Hold the block you want to place, aim at each old block, and place the new one on top of it. This works for small areas or detailed work where you want control over exactly which blocks change.

For larger areas in Survival, consider using a mod that does not require commands, such as a schematic mod that lets you paste pre-built structures. Some mods also add a "block replacer" tool that swaps one block type for another in a radius around you as you walk, which is faster than placing one at a time but still respects Survival mode rules.

Why your /fill command might not work

The most common reason a /fill command fails is a typo in the block name or coordinates. Double-check that the block name matches exactly — "oak_log" is not the same as "oak_logs" or "log". Coordinates must also be whole numbers; decimals will cause an error.

Another reason is that you do not have permission to use commands. On a multiplayer server, only players with operator status can run /fill. On a single-player world, you must have cheats enabled. To turn on cheats in a single-player world, pause the game, click "Open to LAN", toggle "Allow Cheats" on, and close the menu. You will then be able to use commands in that world.

If the command runs but nothing changes, the most likely cause is that there are no blocks of the type you specified in the area you named. For example, if you try to replace dirt but the area contains only grass and stone, the command will complete without error — it just will not find anything to replace.

Replacing blocks in specific patterns or with randomness

The basic /fill command replaces every block in an area with the same block. If you want variety — for example, a mix of stone and stone bricks to look more natural — you can use the replace modifier with multiple commands, or use a mod that supports weighted random replacement.

WorldEdit has a //replace pattern syntax that lets you specify percentages, so you can say "replace 70% of this dirt with grass and 30% with coarse dirt". This creates a more organic look than a solid color. The exact syntax depends on your WorldEdit version, so check the mod's documentation for your specific setup.

For vanilla Minecraft without mods, you can achieve a similar effect by running multiple /fill commands with the replace modifier, each targeting a smaller area. This is tedious but works if you want a specific pattern and do not want to install a mod.

Frequently Asked Questions

Can I replace blocks in a world I did not create?

Only if you have Creative mode access or operator permissions. On a server, ask the admin. In a friend's single-player world, they must enable cheats or give you a copy you can edit yourself. You cannot use /fill in Survival mode on someone else's world without permission.

What happens if I replace blocks under a structure — will it fall?

Yes. If you replace the blocks supporting a building, the structure above will fall. Minecraft does not hold blocks up; gravity applies when ready. Replace support blocks carefully, or rebuild supports before removing the old ones.

Can I replace blocks in the Nether or the End?

Yes, /fill works in any dimension. The command syntax is the same; just make sure you are in the right dimension and have the correct coordinates. Use F3 to check your location before running the command.

How do I undo a /fill command if I made a mistake?

In single-player, press Ctrl+Z (or Cmd+Z on Mac) when ready after the command runs — Minecraft has a limited undo buffer. On servers or if undo does not work, you will need to manually replace the blocks or restore from a backup. This is why testing in a copy of your world first is a good idea for large replacements.

Do I need mods to replace blocks, or does vanilla Minecraft have this built in?

Vanilla Minecraft has /fill built in on Java Edition and Bedrock Edition. You do not need a mod. Mods like WorldEdit are optional and make the process faster for large areas, but the basic command works without them.