The bug
I noticed that ever since the Feature of the Helmet Durability decreasing on certain Mobs that would normally burn in Sunlight, the Helmets of Zombified Piglins and Wither Skeletons also decrease in Durability which should not be the Case as those two Mobs don't burn in the Sunlight.
Even tho the Zombified Piglins and Wither Skeletons don't spawn with Armor themselves, you can still encounter this Bug in Vanilla Minecraft when Piglins are wearing certain Armor and get to the Overworld or when Wither Skeletons pick up Armor that is laying around somewhere.
This does not apply to Husks and other Undead Mobs like the Wither and Zoglin.
How to replicate
Stand in sunlight
Spawn a Husk wearing a helmet:
/summon husk ~ ~ ~ {ArmorItems:[{},{},{},{id:"minecraft:iron_helmet",Count:1b,tag:{Damage:163}}]}
→ ✔ The helmet does not break, since Husks are immune to sunlight
Spawn a Zombified Piglin wearing a helmet:
/summon zombified_piglin ~ ~ ~ {ArmorItems:[{},{},{},{id:"minecraft:iron_helmet",Count:1b,tag:{Damage:163}}]}
→ ❌ The helmet breaks, despite Zombified Piglins being immune to sunlight
Spawn a Wither Skeleton wearing a helmet:
/summon wither_skeleton ~ ~ ~ {ArmorItems:[{},{},{},{id:"minecraft:iron_helmet",Count:1b,tag:{Damage:163}}]}
→ ❌ The helmet breaks, despite Wither Skeletons being immune to sunlight
Linked issues
Comments 3
It is not a Problem for Undead Mobs in general, its more likely that this happens because the Wither Skeleton and Zombified Piglins are Variants of Zombies and Skeletons that never had their Functionality of Burning in the Daylight removed as for them, the Functionality didn't do anything in the first place as the two are Immune to Fire and they also don't even show Visual Fire when in the Sunlight. Thats atleast until they added Helmets breaking in the Sunlight.
The Husk isn't completely immune to Fire so it has a unique Script that makes it only immune to Sunlight which also prevents this Bug to work on them.
They did flicker fire until much later than the helmet thing got added: MC-26690.
Confirmed, seems to be because they are undead, but the check fails to verify if the mob can actually catch fire. It doesn't affect husks though.