takenDamage for achievement criteria is calculated wrongly when the player has equipped a helmet
When a player takes damage from a DamageSource of ANVIL, FALLING_BLOCK, or FALLING_STALACTITE, if the player is wearing head gear, there will be a difference between the actual damage taken by the player and the damage seen in Advancement criteria.
Code analysis
net.minecraft.world.entity.LivingEntity
public abstract class LivingEntity extends Entity { ... public boolean hurt(DamageSource damageSource, float f) { ... if ((float)this.invulnerableTime > 10.0f) { ... this.actuallyHurt(damageSource, f - this.lastHurt); ... } else { ... this.actuallyHurt(damageSource, f); ... } if (damageSource.isDamageHelmet() && !this.getItemBySlot(EquipmentSlot.HEAD).isEmpty()) { ... f *= 0.75f; } ... if (this instanceof ServerPlayer) { CriteriaTriggers.ENTITY_HURT_PLAYER.trigger((ServerPlayer)this, damageSource, f2, f, bl2); ... } } }
The difference occurs because the variable f is multiplied by 0.75f after LivingEntity#actuallyHurt.