So I came to realize that with the new village mechanics in 1.14, you could now make underground villages since villagers look for beds and not doors anymore (housing with doors before 1.14 required exposed skylight so that a villager could tell what was "inside" and "outside"). With that in mind, I wondered if, when you got a bad omen, would pillagers also spawn underground to attack an underground village? I decided to test this out. I found a small cave, threw down a bed and a lectern (not really necessary but I like librarians) and spawn egged a villager in.
I then gave myself the bad omen effect, and the raid indeed came. However. They didn't spawn in the cave itself, and instead were above ground and were gathering around the X and Z position of the villager's location.
However, I then though "well maybe they didn't attack because there wasn't a lot of room underground for them". So I then made another "village" in a larger underground space (just /filled an area with air). Slapped a bed, lectern, and villager down, and lit up the area to prevent zombies from spawning. I then started another raid, but pillagers still didn't spawn underground despite the ample room and were still above ground.
Based on what I've found out, if villagers are in an enclosed underground area, they are basically immune to all raids. HOWEVER. This does not mean that the pillagers will go away. They will remain there and continue to "attempt" to reach the villager, but will never reach it unless there's an easily accessible entrance. So you'd have to dispatch of them still. There would be little-to-no risk for your villagers however as far as I'm concerned.
Neat, but I wouldn't get too comfortable with this exploit. This feels like something Mojang didn't intend. The easy fix would be to have pillagers spawn on the same y-level as the village, but I'd hope they'd be a little more creative and figure out a way to allow villagers and pillagers to modify the world beyond farming and breaking doors.
But, I also, expect MS/Mj to put this on the BadWrongFun™ must be bricked list…
Pillagers exist to control the player, reversing this can not be permitted.
[Those nasty clever players just can't get it through their heads that there is OneTrueWayToPlay™ and anything else is just wrong (not to mention illegal, immoral, unconstitutional and probably fattening) and must be stopped.]
Rollback Post to RevisionRollBack
WARNING: I have an extemely "grindy" playstyle; YMMV — if this doesn't seem fun to you, mine what you can from it & bin the rest.
Personally, I love the aesthetic, novelty, and relative safety of sky villages. I wonder, would they be just as safe as underground villages? Or are raids able to spawn above ground level (but not below)? Needs testing. I'll get back to you on that.