Minecraft – Filling every air block above a specific block in a specific area

minecraft-commandsminecraft-java-editionminecraft-worldedit

I want to spawn-proof the main island in the End by filling every block above (only above) each End Stone block (only if that block is air) with White Stained Glass in a specific area. I have OP and WorldEdit access, and am the server owner so I am able to add Bukkit plugins if need be.
The world version I am running is a CraftBukkit 1.14.4 world.

Are there any commands available to do this, either vanilla commands or WorldEdit commands? Are there any other Bukkit plugins that will allow me to do this? Or will I have to place everything by hand?

Best Answer

There is no simple command to do this, at least in Vanilla. But you could use a ridiculously complicated system of commands to reach the same effect. And who doesn't like that?

First, spawn an armour stand at the lowest X and Z coordinate of your area, high in the air:

/summon armor_stand <x> 255 <z> {NoAI:1,NoGravity:1,Tags:["xMover"]}

Then run these two commands for at least as many times as the area is long in the X direction (more doesn't matter much, except for performance, so I recommend just leaving a repeating command chain on for a few seconds):

execute at @e[tag=xMover] run summon armor_stand ~ ~ ~ {NoAI:1,NoGravity:1,Tags:["zMover"]}
execute as @e[tag=xMover] at @s run tp @s ~1 ~ ~

This should give you a long line of hovering armour stands.

Now you let this line spawn lots of non-hovering armour stands. Those will fall down and land on the top block of the column they're in.

Warning: Water, lava, signs and other blocks that armour stands can fall through might mess with this. Also end crystals like placing fire below themselves in many situations, potentially overwriting your slabs.
And, of course, this creates a TON of lag. You should better stay in a position where you can turn the lever off again at any point and just look at the coordinates in chat (command output) to determine when to deactivate it, because even entering commands lags a lot if you full your entire End island this way.

execute at @e[tag=zMover] run summon armor_stand ~ ~ ~ {NoAI:1,Tags:["placeHere"]}
execute as @e[tag=zMover] at @s run tp @s ~ ~ ~1

Then you wait a bit until all armour stands have fallen and run these two commands (if you don't trust that all chunks are loaded, you can also run these together in a chain multiple times):

execute at @e[tag=placeHere] run setblock ~ ~ ~ stone_slab
kill @e[tag=placeHere]

And finally you can also kill the other armour stands:

/kill @e[tag=xMover]
/kill @e[tag=zMover]

Another warning: This only works for the top layer of each column. In spots where there is e.g. End stone above three blocks of air above more End stone, then it still leaves those spots uncovered. A ridiculous solution would be to run this entire system on every single Y layer.


Alternatively you could use spawning to your advantage. Simply use these three commands in a repeating and a chain command block:

execute at @e[type=enderman] run setblock ~ ~ ~ stone_slab
kill @e[type=enderman]
kill @e[type=item,nbt={Item:{id:"minecraft:ender_pearl"}}]

Then wait for an hour or so and most of the End should be slabbed, at least from 32 to 128 blocks around you. Move around occasionally if you also want the rest to get slabbed, but usually the End has a radius of 128 and no caves very close to the center, so if you just stand in the middle, it should leave out very few spots.