Recently I was digging for some iron and gold on a little single player survival map. However the amount of lava to deal with made it kind of an unpleasant experience.
Since gaming time is quite limited these days, the decision was taken to “optimize” (cheat) a little.
The console offers some nice commands to deal with such situations, however one needs to switch the gamemode first:
- Press ESC
- Click “Open to LAN”
- Click “Allow cheats”
- Click “Start LAN World”
Replacing blocks by type
The command in question is /fill. It is applied to an area of blocks and has several modifiers, such as destruction, filling or replacment.
My goal was to replace the lava, eg by stone. The syntax to use in this case is:
/fill ~x1 ~y1 ~z1 ~x2 ~y2 ~z2 minecraft:stone replace minecraft:lava
x1,y1,z1 and x2,y2,z2 define the area to which the replacement is applied. Using the ~-notation, the position of x,y and z a relative to actual position of your character.
One thing to check when using the ~-notation, is the direction you are actually facing. Otherwise you have no idea whether you need to modify the x- or the z-axis and if you need to add or subtract from your position.
Press F3 and move around a little, to get to know which axis to use.
Examples:
– Press t to open the console
Replacing the block in front, aligned with the z-axis:
Turning 90 degrees to the left and again removing the block in front:
Notice the shift of the -1s and 0s after turning.
Limitations
- No more than somewhat 32000 blocks may be affected by the command. If you define an area that would affect more blocks, a warning pops up and the command is not issued.
- If using the ~-notation, the area must not defined below level 1. Meaning if you are standing on level 5, you cannot set ~y1 or ~y2 to -6 or even fewer.
Conclusion
Of course, I could have replaced stone with iron, use the “give”-command to simply equip all the stuff I need or play creative. But that’s not how I mine.