Minecraft – WorldEdit – replace block if condition is true

minecraft-java-editionminecraft-worldedit

I have a significant amount of chunks of farmland on some hills that I want to plant crops on all at once. I'm considering using WorldEdit to do this but I don't want to just select the whole general area of the farmland and replace all air with seeds (this actually works, from prior experience on a more powerful server) because it'll probably crash my server.

Is there a way to use conditional statements to the effect of "if air block is directly above farmland replace with seeds" to plant these seeds?

Best Answer

The best and easiest way to do this is just to do //overlay seeds.

This places seeds above all of the blocks exposed to the sky in the selection.