3

I'm looking for more information about the /fill command. I want to replace air blocks with another block, but only if they have a stone block below them. The command /fill ~ ~ ~ ~25 ~-5 ~25 air 0 replace dirt will replace every single air block with dirt, and that is obviously not the result that I want.

How can I add a layer of dirt on top of stone blocks, without filling the world with dirt?

1 Answer 1

5

There is no way to make it with one command, but you can achieve it with 5.

/clone ~ ~ ~ ~25 ~5 ~25 ~ 200 ~ filtered force minecraft:stone
/fill ~ 200 ~ ~5 225 ~5 minecraft:grass 0 replace minecraft:stone
/clone ~ ~ ~ ~25 ~5 ~25 ~ 199 ~ filtered force minecraft:stone
/clone ~ 200 ~ ~25 225 ~25 ~ ~1 ~ filtered force minecraft:grass
/fill ~ 200 ~ ~25 225 ~25 air

It will create a copy of stone in sky, check for having air to place a block, an then return blocks and clear the sky.

3
  • This looks like it should work. Good job.
    – MBraedley
    Jun 4, 2016 at 0:59
  • If I understand well, what it does (step by step) is to clone all the stone blocks in the entire structure somewhere else, then change all this fresh-cloned structure's stone into grass, and then re-clone it into the structure but this time a bit shift upward so the new-cloned part top appears. Well, this is sufficient I think!
    – Kimatuy
    Jun 5, 2016 at 22:24
  • Works very well !
    – Kimatuy
    Jun 7, 2016 at 14:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .