mojira.dev
MC-313160

Mobs can't spawn wearing both armor and Halloween pumpkin/jack o'lantern after MC-182478

Since snapshot 24w33a (1.21.2), undead mobs (Zombies, Skeletons, etc.) can no longer naturally spawn wearing both armor pieces and a Carved Pumpkin or Jack o'Lantern on Halloween (October 31st).

Steps to Reproduce:

  1. Set the system date to October 31st.

  2. Create a world on Hard difficulty in 1.21.2 or newer.

  3. Spawn Zombies or Skeletons naturally at night or via spawn eggs.

  4. Observe that no mob ever spawns wearing both armor and a Halloween pumpkin/jack o'lantern.

Observed Results:
Armor and Halloween pumpkins are now mutually exclusive: mobs with a pumpkin never have any armor, and mobs with armor always have a helmet and never a pumpkin.

Expected Results:
Mobs should be able to spawn wearing a Halloween pumpkin along with chestplate, leggings, and/or boots, as was possible prior to 24w33a.

Code Analysis (Mojang Mappings):
In Zombie.finalizeSpawn() and AbstractSkeleton.finalizeSpawn(), equipment is generated in this order:

  1. this.populateDefaultEquipmentSlots(randomSource, difficultyInstance) is called first.

  2. The Halloween check runs right after, but only if this.getItemBySlot(EquipmentSlot.HEAD).isEmpty() is true.

Prior to 24w33a, Mob.populateDefaultEquipmentSlots() iterated from FEET to HEAD, often stopping early and leaving the HEAD slot empty for the pumpkin.
With the fix for MC-182478 in 24w33a, the loop now starts at EquipmentSlot.HEAD. Because the first slot in the loop never breaks early (firstSlot = true), 100% of mobs that pass the armor roll are guaranteed to receive a helmet first. Consequently, the HEAD slot is never empty when the Halloween check is reached.

Suggested Fix:
Move the Halloween pumpkin check before this.populateDefaultEquipmentSlots() in finalizeSpawn(). Since populateDefaultEquipmentSlots() sets firstSlot = false before checking if the current slot is empty, having a pumpkin already in the HEAD slot will simply skip the helmet generation without breaking the loop, allowing chestplate, leggings, and boots to generate normally.

Linked issues

Comments 1

This issue is already being tracked in MC-313018. Please be sure to search for existing reports before creating a new one.

marco masento

(Unassigned)

Unconfirmed

26.4 Snapshot 7

Retrieved