fix: prevent mobs from attacking when already dead (#1549)

This commit is contained in:
PrintedScript
2026-02-16 00:31:29 +08:00
committed by GitHub
parent 11545cfe73
commit 8433f05094

View File

@@ -132,6 +132,11 @@ impl MobEntity {
// TODO: Use entity attributes for damage once implemented
const ZOMBIE_ATTACK_DAMAGE: f32 = 3.0;
if self.living_entity.dead.load(Relaxed) {
// do not attack if dead
return;
}
target
.damage_with_context(
target,