I'd like to be able to select a region (either with a graphical utility or command line) and be able to switch one block type with another, e.g. change all cobblestone in the region to stone. Does a program/mod exist that can do this?
As of 1.8, this can be done in vanilla with the /fill command. It can be done using command blocks or typing it straight into the chat.
For example, to change cobblestone to stone:
/fill <x1> <y1> <z1> <x2> <y2> <z2> stone 0 replace cobblestone
<x1> <y1> <z1> to the coordinates of one corner of the rectangular area, and
<x2> <y2> <z2> with the coordinates of the opposite corner.
WorldEdit has such a command after selecting the area type
//replace [old block] [new block]
This will turn all of the first block from the area into the second block.
MCEdit has this capability. As an example, I made a selection that included grass blocks, and replaced the grass in that selection with cobblestone:
The tool that's selected in the first image is the find tool. Once open, there's an option to change it to find and replace. Then it's just as easy as selecting your two block types and hitting replace.
In 1.13. The
/fill command has been updated, this is the new syntax:
/fill <from> <to> <block> [replace|destroy|hollow|outline|keep]
to define two opposite corners of the volume that you want to fill
block is the block that you want to fill into that volume
The next keyword decides what exactly should happen in the specified volume, it is optional and not using it defaults to
replace sets every block in the specified volume to the specified
destroy works like
replace, but every block in the specified volume will drop whatever item they would usually drop (diamond ore drops diamonds and experience for example) and there will be a breaking particle effect.
hollow works like
replace, but the volume will then be hollow, there will be a one block thick wall and everything inside will be set to air.
outline works like
hollow, but only the one block thick wall will be placed, everything inside will stay the way it is instead of being set to air.
keep works like
replace, but only air blocks get filled with the specified block.
You can also use this syntax instead:
/fill <from> <to> <block> replace <filter>
In this case only blocks specified by the
<filter> will be set to the block specified in
So to replace all cobblestone in a volume between the coordinates
60 60 60 and
70 70 70 with stone you can use this command:
/fill 60 60 60 70 70 70 stone replace cobblestone
protected by fredley Jun 16 '13 at 10:07
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?