Iron golems do not follow the doMobSpawning gamerule
The bug
In my world, doMobSpawning is false, and iron golems still spawn in the village I made. But everything else does not spawn.
Code analysis / fix
Based off of Minecraft 1.11, MCP 9.35
public void tick(int tickCounterIn) { //added "&& this.worldObj.getGameRules().getBoolean("doMobSpawning")" if (this.numIronGolems < i && this.villageDoorInfoList.size() > 20 && this.worldObj.rand.nextInt(7000) == 0 && this.worldObj.getGameRules().getBoolean("doMobSpawning")) { //...
Created Issue:
Iron Golems do not follow the doMobSpawning gamerule.
In my world, doMobSpawning is off, and iron golems still spawn in the village I made. But everything else does not spawn.
Environment
OS Version: Windows 10 version 10.0.14393 Java Version: Version 8 update 11
In my world, doMobSpawning is off, and iron golems still spawn in the village I made. But everything else does not spawn.
In my world, doMobSpawning is off, and iron golems still spawn in the village I made. But everything else does not spawn.
In my world, doMobSpawning is off, and iron golems still spawn in the village I made. But everything else does not spawn.
Fix ( Based off of Minecraft 1.11, MCP 9.35 )
net.minecraft.village.Village.javapublic void tick(int tickCounterIn) { //added && this.worldObj.getGameRules().getBoolean("doMobSpawning") if (this.numIronGolems < i && this.villageDoorInfoList.size() > 20 && this.worldObj.rand.nextInt(7000) == 0 && this.worldObj.getGameRules().getBoolean("doMobSpawning")) { //...
In my world, doMobSpawning is off, and iron golems still spawn in the village I made. But everything else does not spawn.
Fix (Based off of Minecraft 1.11, MCP 9.35)
net.minecraft.village.Village.javapublic void tick(int tickCounterIn) { //added&&this.worldObj.getGameRules().getBoolean("doMobSpawning") if (this.numIronGolems < i && this.villageDoorInfoList.size() > 20 && this.worldObj.rand.nextInt(7000) == 0 && this.worldObj.getGameRules().getBoolean("doMobSpawning")) { //...In my world, doMobSpawning is off, and iron golems still spawn in the village I made. But everything else does not spawn.
Fix: (Based off of Minecraft 1.11, MCP 9.35)
net.minecraft.village.Village.javapublic void tick(int tickCounterIn) { //added "&& this.worldObj.getGameRules().getBoolean("doMobSpawning")" if (this.numIronGolems < i && this.villageDoorInfoList.size() > 20 && this.worldObj.rand.nextInt(7000) == 0 && this.worldObj.getGameRules().getBoolean("doMobSpawning")) { //...
In my world, doMobSpawning
is off, and iron golems still spawn in the village I made. But everything else does not spawn.
Fix: (Based off of Minecraft 1.11, MCP 9.35)
net.minecraft.village.Village.javapublic void tick(int tickCounterIn) { //added "&& this.worldObj.getGameRules().getBoolean("doMobSpawning")" if (this.numIronGolems < i && this.villageDoorInfoList.size() > 20 && this.worldObj.rand.nextInt(7000) == 0 && this.worldObj.getGameRules().getBoolean("doMobSpawning")) { //...The bug
In my world, doMobSpawning is false, and iron golems still spawn in the village I made. But everything else does not spawn.
Code analysis / fix
Based off of Minecraft 1.11, MCP 9.35
net.minecraft.village.Village.javapublic void tick(int tickCounterIn) { //added "&& this.worldObj.getGameRules().getBoolean("doMobSpawning")" if (this.numIronGolems < i && this.villageDoorInfoList.size() > 20 && this.worldObj.rand.nextInt(7000) == 0 && this.worldObj.getGameRules().getBoolean("doMobSpawning")) { //...

is this problem fixed?
No: this ticket is not resolved as Fixed and the latest version is still affected.
The "Fix" part of the ticket just shows what developers should change to fix the issue.
Is this issue still being worked on?
Confirmed for 1.13.1.
Affects 21w39a
Affects 22w06a
Can confirm in 1.18.1.
can confirm in 1.20.4