How do I replace the non-air blocks in a 5x5x5 area?

How do I replace the non-air blocks in a 5x5x5 area? - Air conditioning in yard of building

Is it possible for me to replace all non-air with stone blocks in a 5x5x5 box around where I am having the command executed? What is the command to do this?

Note: I believe that I can do it by replacing the air in the area with barriers, cloning it to another area, setting the area to stone, and then cloning only the barriers back from the area that they were cloned to, and setting all barriers in both zones to air. However, that is a very lengthy process, ad I need this command to run faster.



Best Answer

have a 5*5 stone cube at spawn to clone to (assuming here you use 0 0 0 as the cube's coordinates)

/fill 0 0 0 4 4 4 stone                    // Fill temp area with stone
/clone x y z x2 y2 z2 0 0 0 filtered air   // clone all air blocks to temp area
/clone 0 0 0 4 4 4 x y z                   // clone temp area to destination



Pictures about "How do I replace the non-air blocks in a 5x5x5 area?"

How do I replace the non-air blocks in a 5x5x5 area? - Modernist Block in Mist
How do I replace the non-air blocks in a 5x5x5 area? - Aerial Shot of Houses in a Residential Area
How do I replace the non-air blocks in a 5x5x5 area? - Garbage on Body of Water



How do you replace blocks in an area?

Once cheats are enabled, Minecraft: Bedrock Edition players can open their chat console in-game and type out their command. The syntax of the command to replace blocks (in Bedrock Edition specifically) is currently: /fill <from> <to> <tilename> [tiledata] replace <replacetilename> <replacedatavalue>

How do you fill to replace certain blocks?

Type the command in the chat window and press the Enter key to run the command. This /fill command would replace all blocks in the fill region, including air. The replaced blocks will be dropped and can then be collected as if they were mined with a pickaxe or shovel.



5x5x5 49 : Mekorama story Level-49




More answers regarding how do I replace the non-air blocks in a 5x5x5 area?

Answer 2

This can be done, but it will require a lot of command blocks. Basically there is no way to replace everything but air, unless you make a command block for every block except air. This is similar to something Sethbling made, which you can check out here.

Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: ready made, Aleksandar Pasaric, Deane Bayas, Yogendra Singh