The bug
Iron golems can spawn in blocks which are considered as not normal cube (normal cubes are: state.getMaterial().isOpaque() && state.isFullCube() && !state.canProvidePower()
).
This makes them spawn in slabs, glass, farmland, grass path, ...
How to reproduce
Create village with villagers
Fill all air blocks at the village center with for example glass
Wait for an iron golem to spawn
Code analysis
Based on 1.12.2 decompiled using MCP 9.40
The method net.minecraft.village.Village.isAreaClearAround(BlockPos, BlockPos)
only considers a spawn location as invalid if the blocks at this position are net.minecraft.block.state.IBlockProperties.isNormalCube()
, it should probably instead use logic similar to the one used in net.minecraft.world.WorldEntitySpawner.findChunksForSpawning(WorldServer, boolean, boolean, boolean)
.
Linked issues
is duplicated by 16
relates to 2
Attachments
Comments 23
I'd like to add a bit more info because the main post is hard to follow.
The main issue here is:
If all of the default spawn conditions are met, Iron Golems are able to spawn inside of slabs and glass.
They do require a solid ground block for them to spawn on top of, they still spawn even if half slabs or glass is in the way.
Is this still a concern in the latest Minecraft version 1.7.4? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.
Confirmed still an issue in 1.7.4.
You can check out the image proof here:
http://i.imgur.com/osB6WUb.png
Edit: Sorry for the late reply, I was waiting to see if any spawned for about 2 hours, which he eventually did. Anyway, if this might help he spawned through 2 slabs, I have a layer of stone, a slab and then another slab floating above that, it seems he spawned through both of them.
Edit 2: For further evidence, you can check out the screenshot of the floor cutaway attached to the bug post for verification.
Edit 3: Grammar.
Is this still a concern in the latest Minecraft version 14w08a? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.
This should be marked as Fixed, I can confirm that iron golems no longer spawn in slabs. Also the bug report MC-135128 that stated that golems could no longer spawn in slabs has been marked as Works as Intended, thus proving Mojang has intentionally fixed this bug!
I don't know about those blocks, but it can be easily tested by using a large multi village iron farm and placing the glass/farmlang on top of a solid, opaque spawning platform (allowing for the golems to spawn there) to see if the golems spawn within the glass/farmland blocks.
In 1.14.4 Golems are spawning in farmland and it's really annoying - it would be nice to have a command to stop any certain mob from spawning at all.
Should I open a new issue, or can this be reopened? I have had Golems spawn anywhere there's at least 3 blocks of space. And that includes stairs. And golems don't spawn on stairs, they spawn on the ground below, and thus get completely stuck.
EDIT: Minecraft 1.7.2.