Mojira Archive
MC-3927

Iron golems spawning in slabs, glass, farmland and grass path

Risk of confusion

This report describes only iron golems spawning inside non-opaque non-full cubes.

See MC-130270 for them spawning even inside opaque full cubes, which started during the 1.13 snapshots.

This issue reappeared in 1.14, see MC-148955 for more details.

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

  1. Create village with villagers
  2. Fill all air blocks at the village center with for example glass
  3. 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).