Pufferfish sting: drop the end-of-tick arm apply_brain_events now replaces

Every PufferfishSting comes from a mob's tick (sting_touching_mobs), and
apply_brain_events consumes it right after that tick, so handle_mob_events'
mob_hits_mob arm could no longer run. It joins StartFollowing and SchoolSize.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Horizon agentandClaude Opus 5.5 committed 2026-11-05 07:58:28 +01:00
1 parent d49eb54168
commit 82648da3f3
1 file changed
+3 -29
+3 -29
View File
@@ -2396,34 +2396,6 @@ impl Game<'_> {
}
}
}
MobEvent::PufferfishSting {
mob,
target,
amount,
source,
poison_ticks,
} => {
// Pufferfish.touch: the poison and
// `playSound(PUFFER_FISH_STING, 1, 1)` sit inside the
// `hurtServer` branch, so only a hit that landed poisons
// and stings, at the fish's own position as
// `Entity.playSound` puts it, and not when it is silent.
let landed = self.mob_hits_mob(target, amount, source);
if landed && let Some(t) = self.mobs.iter_mut().find(|m| m.id == target) {
t.add_effect("minecraft:poison", poison_ticks, 0);
}
if landed && let Some(m) = self.mobs.iter_mut().find(|m| m.id == mob) {
let at = [m.position.x, m.position.y, m.position.z];
if !m.silent {
self.handle_mob_events(vec![MobEvent::Sound(
"entity.puffer_fish.sting",
at,
1.0,
1.0,
)])?;
}
}
}
MobEvent::SonicBoom {
target,
attacker,
@@ -3001,7 +2973,9 @@ impl Game<'_> {
}
}
// Applied after the fish's tick (`apply_brain_events`).
MobEvent::StartFollowing { .. } | MobEvent::SchoolSize { .. } => {}
MobEvent::StartFollowing { .. }
| MobEvent::SchoolSize { .. }
| MobEvent::PufferfishSting { .. } => {}
MobEvent::LeashBreak { mob, drop, sound } => self.break_leash(mob, drop, sound),
MobEvent::NotifyLeashHolder { holder } => {
if let Some(m) = self.mobs.iter_mut().find(|m| m.id == holder) {