The bug
Zombified Piglins stopped spawning near light sources in the nether. This bug affects gold farm by reducing the amount of valid spawning positions.
To test it, I created spawning platforms in the nether (high above the nether ceiling, see screenshot). The only possible spawning block were on the platforms. Two platforms were empty, a third platform had torch rows on every second block, a fourth platform had glowstone rows two blocks above the platform. A fifth platform was made out of Magma Blocks.
The results show, that piglins can spawn on the first two platforms and the fifth platform. On the platforms with the torches and the glowstone above, no zombified piglins spawned.
Recreating this setup in 1.13.2 shows that piglins can spawn on all platforms.
Linked issues
relates to 2
Attachments
Comments 3
Looked into the cause of this, since I was confused why 22w46a lowered the light level for Skeletons, Wither Skeletons, and Endermen in the Nether from 11 to 7 but did not do so for Zombified Piglins. I didn't see any light level check in ZombifiedPiglin.checkZombifiedPiglinSpawnRules()
, which made it more confusing. As far as that method is concerned they should spawn in any light level.
It turns out it's the call to the generic mob.checkSpawnRules()
. PathfinderMob
overrides this to check for this.getWalkTargetValue(this.blockPosition(), levelAccessor) >= 0.0f
, and Monster
overrides that method to return a value based on light level that happens to be >= 0 for light levels <=11 but goes negative for light levels 12 to 15.
P.S. This same thing seems to be the cause for Blazes, Piglins, and Hoglins also requiring light level <=11 to spawn. Magma Cubes and Ghasts escape because they aren't subclasses of PathfinderMob
, which is why they do manage to spawn in any light level.
Zombie Pigman is now called Zombified Piglin