[PR #2646] [MERGED] Husk hunger and similar hit effects only apply when the hit lands #4500

Closed
opened 2026-11-03 04:17:37 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2646
Author: @kacpherek
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/2630-husk-hunger-shield


📝 Commits (3)

  • 59bdb00 Husk, cave spider, wither skeleton, bee and pufferfish effects only come when the hit lands
  • 0c58226 Merge main into fix/2630-husk-hunger-shield
  • 3094896 mob_ai probe: count hits that bring an effect as player hurts

📊 Changes

7 files changed (+62 additions, -10 deletions)

View changed files

📝 crates/horizon-client/examples/probe/mob_ai_probe.rs (+6 -2)
📝 crates/horizon-client/src/game/creatures.rs (+12 -0)
📝 crates/horizon-client/src/game/lan_mobs.rs (+1 -0)
📝 crates/horizon-client/src/mobs.rs (+10 -0)
📝 crates/horizon-client/src/mobs/ai.rs (+23 -1)
📝 crates/horizon-client/src/mobs/aquatic.rs (+3 -4)
📝 crates/horizon-client/src/mobs/bee.rs (+7 -3)

📄 Description

What and why

A husk's hit gave the player Hunger even when a raised shield blocked it. Cave spider poison, wither skeleton wither, bee poison and pufferfish poison had the same problem. The mob queued the effect together with the attack, so the effect did not depend on whether the player took damage.

Now the effect rides with the attack in one event. It is given only when the player was actually hurt, so a blocked hit gives nothing. This also works for a LAN guest (the event goes to them like the other attacks).

Arrow effects (stray slowness, bogged poison) already check that the hit landed, so they are unchanged.

Fixes #2630.

Vanilla reference

Husk.doHurtTarget, CaveSpider.doHurtTarget, WitherSkeleton.doHurtTarget, Bee.doHurtTarget and Pufferfish.touch add their effect only when super.doHurtTarget / hurtServer returned true. AbstractArrow.onHitEntity does the same for arrows.

Self-check

cargo check -p horizon-client passes.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/2646 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/2630-husk-hunger-shield` --- ### 📝 Commits (3) - [`59bdb00`](https://github.com/horizon-rust/horizon/commit/59bdb0059992dd7438a3cf0ee38f4fdcae495a7d) Husk, cave spider, wither skeleton, bee and pufferfish effects only come when the hit lands - [`0c58226`](https://github.com/horizon-rust/horizon/commit/0c58226e9c4ad85228bb21af90304add1a420722) Merge main into fix/2630-husk-hunger-shield - [`3094896`](https://github.com/horizon-rust/horizon/commit/3094896ad1c0bd7ac221bb257af55e1127a1702a) mob_ai probe: count hits that bring an effect as player hurts ### 📊 Changes **7 files changed** (+62 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/probe/mob_ai_probe.rs` (+6 -2) 📝 `crates/horizon-client/src/game/creatures.rs` (+12 -0) 📝 `crates/horizon-client/src/game/lan_mobs.rs` (+1 -0) 📝 `crates/horizon-client/src/mobs.rs` (+10 -0) 📝 `crates/horizon-client/src/mobs/ai.rs` (+23 -1) 📝 `crates/horizon-client/src/mobs/aquatic.rs` (+3 -4) 📝 `crates/horizon-client/src/mobs/bee.rs` (+7 -3) </details> ### 📄 Description ## What and why A husk's hit gave the player Hunger even when a raised shield blocked it. Cave spider poison, wither skeleton wither, bee poison and pufferfish poison had the same problem. The mob queued the effect together with the attack, so the effect did not depend on whether the player took damage. Now the effect rides with the attack in one event. It is given only when the player was actually hurt, so a blocked hit gives nothing. This also works for a LAN guest (the event goes to them like the other attacks). Arrow effects (stray slowness, bogged poison) already check that the hit landed, so they are unchanged. Fixes #2630. ## Vanilla reference `Husk.doHurtTarget`, `CaveSpider.doHurtTarget`, `WitherSkeleton.doHurtTarget`, `Bee.doHurtTarget` and `Pufferfish.touch` add their effect only when `super.doHurtTarget` / `hurtServer` returned true. `AbstractArrow.onHitEntity` does the same for arrows. ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:17:37 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4500
No description provided.