The bug
Dying entities can still make splashing/falling sounds, as if they were still alive. This could be intended.
To reproduce
Create a new creative world and fly a few blocks above water/land.
Execute the following command:
/summon turtle ~ ~ ~ {Health:0}
Observed result
The mob makes sounds after dying.
Expected result
The mob would not make sounds after dying.
Code analysis
Using Mojang mappings (22w11a).
LivingEntity#causeFallDamage(...)
does not check if the entity is alive in order to play the fall sounds:
...
@Override
public boolean causeFallDamage(float $$0, float $$1, DamageSource $$2) {
boolean $$3 = super.causeFallDamage($$0, $$1, $$2);
int $$4 = this.calculateFallDamage($$0, $$1);
if ($$4 > 0) {
this.playSound(this.getFallDamageSound($$4), 1.0f, 1.0f);
this.playBlockFallSound();
this.hurt($$2, (float)$$4);
return true;
}
return $$3;
}
...
A potential fix would be to replace if ($$4 > 0)
with if ($$4 > 0 && this.isAlive())
.
Linked issues
relates to 2
Attachments
Comments 3

Can confirm in 1.19.
Can confirm in 23w03a.
Very likely related to MC-1246.