The bug
The "netherite effects" mentioned from 20w06a are not applied to netherite helmets when worn by undead mobs that are exposed in daylight, causing the netherite helmets to eventually break or "burn".
To Reproduce
/summon minecraft:zombie ~ ~ ~ {ArmorItems:[{},{},{},{id:"minecraft:netherite_helmet",components:{"minecraft:damage":406},count:1b}]}
Code analysis
Code analysis by @unknown can be found in this comment.
Linked issues
is duplicated by 3
relates to 2
testing discovered 1
Attachments
Comments 15
To reproduce, run
/summon zombie ~ ~ ~ {ArmorItems:[{},{},{},{id:"minecraft:netherite_helmet",Count:1b,tag:{Damage:406}}]}
Here's a code analysis of this issue.
Code Analysis:
The following is based on a decompiled version of Minecraft 1.18.1 using MCP-Reborn.
net.minecraft.world.entity.monster.Zombie.java
public class Zombie extends Monster {
...
public void aiStep() {
if (this.isAlive()) {
boolean flag = this.isSunSensitive() && this.isSunBurnTick();
if (flag) {
ItemStack itemstack = this.getItemBySlot(EquipmentSlot.HEAD);
if (!itemstack.isEmpty()) {
if (itemstack.isDamageableItem()) {
itemstack.setDamageValue(itemstack.getDamageValue() + this.random.nextInt(2));
if (itemstack.getDamageValue() >= itemstack.getMaxDamage()) {
this.broadcastBreakEvent(EquipmentSlot.HEAD);
this.setItemSlot(EquipmentSlot.HEAD, ItemStack.EMPTY);
}
}
flag = false;
}
if (flag) {
this.setSecondsOnFire(8);
}
}
}
super.aiStep();
}
...
If we look at the above class, we can see that no checks are carried out to see what type of armor a non-player entity is wearing on their head, before receiving damage from exposure to the sun. The only check that is in place is to see whether or not the item on their head can consume durability. This is evident through the following line of code:
if (itemstack.isDamageableItem())
Because of this, netherite helmets worn by non-player entities can be damaged from exposure to the sun.
Duplicate of MC-3453, which has the resolution Working As Intended; meaning this is intended game behavior - please use the search function in the future.