Iron golems spawning in slabs, glass, farmland and grass path
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).
2012-11-28, 11:37 AM
2020-04-29, 05:24 PM
2018-08-01, 10:58 AM
21
21
Minecraft 1.4.5 - Minecraft 1.13-pre6
Minecraft 1.4.5, Minecraft 1.7.2, Minecraft 13w48a, Minecraft 13w48b, Minecraft 13w49a, Minecraft 1.7.3, Minecraft 1.7.4, Minecraft 1.8-pre3, Minecraft 1.8, Minecraft 1.8.9, Minecraft 1.9 Pre-Release 2, Minecraft 1.9 Pre-Release 4, Minecraft 1.9, Minecraft 1.9.4, Minecraft 1.10.2, Minecraft 16w33a, Minecraft 16w35a, Minecraft 16w40a, Minecraft 16w41a, Minecraft 1.12.2, Minecraft 1.13-pre1, Minecraft 1.13-pre6