Minecraft version: [1.21.4]
Mappings version: [2025.03.16, 2025.03.23]
The second arg in net.minectaft.world.entity.LivingEntity::doHurtTarget is called source, but in reality, it is the entity being attacked rather than the source of the attack.
Just need to check net.minectaft.world.entity.Mob, it override doHurtTarget. The use of itemStack.HurtEnemy() proves that the second arg in doHurtTarget is the hurted entity.
In branch 1.20. x, it is correct and it is called target .
Minecraft version: [1.21.4]
Mappings version: [2025.03.16, 2025.03.23]
The second arg in
net.minectaft.world.entity.LivingEntity::doHurtTargetis calledsource, but in reality, it is the entity being attacked rather than the source of the attack.Just need to check
net.minectaft.world.entity.Mob, it overridedoHurtTarget. The use ofitemStack.HurtEnemy()proves that the second arg indoHurtTargetis the hurted entity.In branch 1.20. x, it is correct and it is called
target.