Iron golems spawn in a 2 block high gap in my underground trading hall/ iron farm.
Link to video of the bug: https://drive.google.com/file/d/1GJZ8EAdllSNjaENxXsrm6fNsHoAAziha/view?usp=drivesdk
Linked issues
is duplicated by 4
Comments 4
This is therefore the same issue as MCPE-170983, which has only been fixed for environmental spawning.
I added carpets to all the 2-block-high areas where I did not want Iron Golems spawning, and that seems to prevent them spawning there. I do not know if it is because it reduces the height or if Iron Golems are being prevented from spawning on carpet, but it seems to be a workaround until the bug is fixed.
Same problem in spaces 2,5 blocks high.
Similarly I have an underground trading hall/iron farm and had added top half slabs to prevent golem spawns along a ledge with 3 blocks clearance. This worked until release of 1.20. Illustrated in report MCPE-175771
Also good trick SunlessFrog16, I will try that too.
Below are the results of code-digging and comparing 1.19.72 BDS to 1.20.12 BDS.
In 1.19.72, the environmental spawning algorithm [ Spawner::spawnMob() ] and the iron golem spawning algorithm [SpawnUtils::trySpawnMob()] used UpdateBoundingBoxSystem:updateBoundingBoxFromDefinition() to update a mobs bounding box before collision checks.
In 1.20.12, the environmental spawning algorithm does something else while the iron golem spawning algorithm still uses UpdateBoundingBoxSystem:updateBoundingBoxFromDefinition().
I suspect that UpdateBoundingBoxSystem:updateBoundingBoxFromDefinition() broke in 1.20.10.x previews and the environmental spawning system was later patched to use something else. However, the iron golem spawning algorithm hasn't been patched yet.