mojira.dev
MC-154090

Pillagers in outposts inconsistently spawn at light level 8, unlike other mobs

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:

  1. Teleports to pillager outpost.

    /tp @p 1175 65 855
  2. Sets the world border to restrict spawning area.

    /worldborder set 63
  3. Centers the world border.

    /worldborder center 1175.5 855.5
  4. Removes terrain.

    /fill 1144 85 824 1206 64 846 air
  5. Removes more terrain.

    /fill 1206 72 847 1144 64 886 air
  6. Places platform for pillagers and mobs to spawn on.

    /fill 1206 64 824 1144 64 886 polished_blackstone
  7. Sets block light level to 7.

    /fill 1206 73 824 1144 73 886 minecraft:shroomlight
  8. Clears pillagers and mobs. 

    /kill @e[type=!minecraft:player]

    ✔  Notice that both pillagers and other mobs are spawning, as the light level is 7.

  9. Sets block light level to 8.

    /fill 1206 72 824 1144 72 886 minecraft:shroomlight
  10. Clears pillagers and mobs.

    /kill @e[type=!minecraft:player]

    ❌  Notice that even though the light level is 8, pillagers are still spawning.

  11. Sets block light level to 9.

    /fill 1206 71 824 1144 71 886 minecraft:shroomlight
  12. 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

This may relate to MC-151027 (which might have been fixed recently)

Works As Intended, pillager can spawn at any light level from pillager outpost.

Wrong; pillagers spawns are affected by block light level, abeit incorrectly so.

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?

As of 1.18, since all mobs spawn at level 0, I suggest the description (at least) is modified to acomodate the new behavior

gaspoweredpick

(Unassigned)

Confirmed

Mob spawning

Minecraft 1.14.3 Pre-Release 2, Minecraft 1.14.3, 1.14.4, 19w34a, 19w35a, ..., 21w15a, 1.17, 1.17.1 Release Candidate 1, 1.17.1, 1.18.1

Retrieved