mojira.dev
MC-244170

Iron Golems don't spawn in valid spawn space if there is a non-solid block they can't spawn on above that space

Some definitions

Spawn limits - Within range of the 16x13x16 box centered on any one of the villagers (see official Wiki)

Spawnable Space (defined for my testing) - A solid block with 3 blocks of air above it.

Obstructing blocks (explained below) - I've tested walls, dirt_path, fences and beds, but I believe this extends to ANY block type that an iron golem cannot spawn on  - despite all other spawning conditions being met (i.e. roughly speaking, this is a block without a solid top surface).

 

Description

Iron golems should spawn based on certain criteria that is met by villagers (including sleeping, panicking, etc etc). Once all the criteria is met (can be found on the wiki) then spawnable space is chosen withing the spawn limits of the villagers that are panicking... and an attempt (or 10 🙂) is made for the golem to spawn.

If I place a platform of spawnable space under the villagers beds then the iron golems do not spawn there. Even 1 block outside that platform (where the spawnable space is under an obstructing block) will not spawn a golem.

If I remove a single obstructing block which is above spawnable space, then a golem will spawn on the respective space.

I have also tested by replacing the beds under the villagers with solid blocks... then adding a solid block "roof" above the villagers... and walls/fences on that roof to prevent golems spawning above the villagers... to no avail, golems still do not spawn beneath the villagers on the spawnable space if there is an obstructing block somewhere above the spawnable space.

 

Reproduce

  • Create a new single or multiplayer or server vanilla world (optionally in creative for ease).

  • Go to a height where there are no obstructions and build farm like the attached picture (aside from the actual farm... only air in all directions within the spawn limits as defined in the wiki)

  • Make the game night, spawn 3 villagers on their beds and let them sleep

  • spawn the zombie on it's platform

  • Regarding the platform of spawnable space beneath the villagers ... it has the required 3 air directly above the solid block, it simply has an obstructing block  somewhere above that space but within the spawn limits

 

Expected Result

An Iron golem spawns on block of spawnable space as per wiki even though there are obstructing blocks above the spawnable space (valid spawning criteria of 3 air blocks above a solid block)

Actual Result

Iron golems don't spawn at all. Ran the single player world for 1 hour ... no golems.

 

Additional info

IMPORTANT: I have placed blocks anywhere else within the spawn limits and without an obstructing block above that space ... and golems do spawn, so it's not a case of "villagers can't see zombie and aren't panicking" or something to that effect 🙂

I attempted making the platform 1 block lower (4 air above solid blocks) ... same results... can't go lower than that, as it goes beyond the spawn limits.

Tried all sorts of different other obstructing blocks which can prevent golem spawning on spawnable space:

  • Obstructing blocks do not include blocks with a solid top surface - they appear to specifically be blocks that an iron golam cannot spawn on top of (despite the spawnable space being beneath that obstructing solid block)

    • i.e. if I place a column of solid blocks above the spawnable space - then the iron golem will correctly spawn in the spawnable space

  • The spawnable space can be anywhere inside the spawn limits - but an obstructing block would be somewhere in the column above that valid space

    • That obstructing block must not be too high above the spawnable space, it must be within spawn limits - i.e. < = within the16x13x16 spawn limits

  • If I place the obstructing block higher than the spawn limits then golems will spawn in the spawnable space - i.e if there is only AIR above that spawnable space, then golems will correctly spawn there.

 

Attachments

Comments 8

If I had to guess where exactly the developers can find the problem... 

According to the wiki, the algorithm for checking if and where the iron golem will be spawned starts at the top of a randomly chosen column of blocks within the spawn limits... then it moves down that column until it finds a block the golem can spawn on ... then checks that the space above said block is good for golems (like AIR)... 

I suspect (guess 😉) that the top-down algorithm stops processing under one of these two conditions

  • ✔ Stops processing IF ... it finds a valid block the golem can spawn on, but the checks above that block fail

  • ❌ Stops processing IF ... It finds a block the golem cannot spawn (doesn't keep checking lower in the column for valid blocks)

This is quite likely an "optimisation" technique in the search process, so that it doesn't search ALL the blocks in each column it chooses for spawn space, but stops processing lower in each column when it encounters invalid blocks near the top of the column.

 

Attached another example picture - where the golems don't spawn on ANY of the solid blocks within the spawn limits if somewhere above those solid blocks (but still inside the spawn limits) there is an obstructing block (see definitions in main post).

Hi there, any consideration of this issue? – it's not very serious, but it is rather inconvenient.

 

I presumed due to holiday season, this was not going to be looked in the last month.... so I'm just dropping a reminder that this issue is still open and doesn't appear to have been looked at yet.

 

Thanks!

I cannot reproduce this in 1.19 Pre-release 1.

Thanks ampolive ... I am going to test this now 👍

@ampolive ...  sadly this problem is definitely still occurring in 1.19 Pre-release 1 ... see latest attached screenshot ... anything under beds/walls with 3 air gaps above does not spawn an iron golem regardless of how long I wait.

The moment I place a solid surface block (like one of the stone blocks in the screenshot) anywhere outside the ones that are under beds/walls - on the same level - an iron golem spawns on that surface within 30 seconds (as per expectations) .... I will leave it running a bit longer, but so far 10 minutes shows no golem

After conducting several tests, I can confirm this issue. It seems that the iron golem needs five blocks of air below the obstructing blocks instead of three, which is expected.

Hi @ampolive

 

I've done some additional tests as I could not replicate your results (the 5 block limit).
I have found that if the "obstructing block" is anywhere above the "spawnable space" then no golem spawns... until I noticed the following.

 

==== Obstructing Block Prevent Golems spawning ====

See attached my latest screenshot - golems-cannot-spawn.png.

I've surrounded the testing area in iron_block to simulate the where the spawn limits are for the golems (see wiki) ...
NOTE: The iron_blocks are placed 1 block outside the very limit, so golems cannot spawn on them - (which is actually the 8th block down on y-limit, because they can spawn on the 7th block – rolls eyes because wiki says +/-6th y-block).

 

Anyway .... the area shows a platform of iron blocks ... with brick_wall above it - 11 blocks above the platform. In this configuration golems DO NOT spawn. I waited 30 minutes .... removed 1 brick wall... and withing 30 seconds the golem spawned on the block that no longer had the obstructing block above it.

 

==== Golems Spawning – despite obstructing block? ====

Now for the fun part

I can get golems to spawn with the obstructing blocks above them .... see my special-case.png .... in this scenario, exactly the same test is done ... with 1 important difference.

OUTSIDE THE SPAWN LIMITS (Or "on the limit" if you will) .... I place solid blocks ABOVE the obstructing block.
Golems now spawn on the space below... NOTE: They cannot spawn on the blocks above the brick_wall... as those are outside the y-limits.

 

.... so this has been fun .... I really hope it helps 🙂

 

Kai

(Unassigned)

Confirmed

Platform

Low

Mob spawning

iron-farm, iron_golem

1.18, 1.18.1 Pre-release 1, 1.18.1, 1.19 Pre-release 1, 1.19 Release Candidate 1, ..., 1.19.1 Pre-release 5, 23w07a, 23w18a, 1.20.1, 1.21.3

Retrieved