The bug
Both mobs and pillagers from outposts spawning is affected by block light level, but pillagers from outposts spawn at block light levels 8 or less instead of 7 or less (prior to 1.18) or 0 like other mobs.
How to reproduce
Use the seed 7703073064123265302
and run the following commands:
Teleports to pillager outpost.
/tp @p 1175 65 855
Sets the world border to restrict spawning area.
/worldborder set 63
Centers the world border.
/worldborder center 1175.5 855.5
Removes terrain.
/fill 1144 85 824 1206 64 846 air
Removes more terrain.
/fill 1206 72 847 1144 64 886 air
Places platform for pillagers and mobs to spawn on.
/fill 1206 64 824 1144 64 886 polished_blackstone
Sets block light level to 7.
/fill 1206 73 824 1144 73 886 minecraft:shroomlight
Clears pillagers and mobs.
/kill @e[type=!minecraft:player]
✔ Notice that both pillagers and other mobs are spawning, as the light level is 7.
Sets block light level to 8.
/fill 1206 72 824 1144 72 886 minecraft:shroomlight
Clears pillagers and mobs.
/kill @e[type=!minecraft:player]
❌ Notice that even though the light level is 8, pillagers are still spawning.
Sets block light level to 9.
/fill 1206 71 824 1144 71 886 minecraft:shroomlight
Clears pillagers.
/kill @e[type=!minecraft:player]
✔ Notice that nothing spawns, as the light level is 9.
Code analysis
1.16.2-rc1, Mojang names
net.minecraft.world.entity.monster.PatrollingMonster.checkPatrollingMonsterSpawnRules(EntityType<? extends PatrollingMonster>, LevelAccessor, MobSpawnType, BlockPos, Random)
allows light level <= 8.net.minecraft.world.entity.monster.Monster.isDarkEnoughToSpawn(ServerLevelAccessor, BlockPos, Random)
allows light level <= Random.nextInt(8)
which is 0-7 (both inclusive).
Comments 9
Illager patrols spawning is affect by light level, but pillagers in outpost is not affect by light level.
Also, illager patrol spawning is nothing to do with pillager spawning in outpost.
You posted is a feature request not a bug.
but pillagers in outpost is not affect by light level.
But that is not happening, pillagers are spawning at a block light level 8 and below instead of 7 and below. They are not spawning in any higher light level right so you are actually the one making a feature request (that pillagers should ignore light level). Again, pillager spawns are affected by block light level, but not correctly.
Made the report reproduceable (and added an extra step for people who think that pillagers can spawn at any light level; short answer: They Don't. The wiki doesn't even say anything about what light level pillagers spawn at in the outpost, but I proved that they are actually affected by light levels)
I hope this can be confirmed now.
Pillager outpost is living by pillagers, so they can spawn at any light level.
Like guardians and slimes in slime chunks, guardians or slimes (in slime chunks) spawning are unaffect by light level.
Pillager outpost is living by pillagers, so they can spawn at any light level.
I already proved this to not be the case; this report now has reproduction steps that prove pillagers won't spawn at "any light level". Reproduce them. Pillagers will not spawn at block light levels of 9 or more, instead of 8 or more like other mobs. Where does "any light level" apply?
This may relate to MC-151027 (which might have been fixed recently)