[PR #1512] [MERGED] Strikes and mob effects reach a server's players: lightning, evoker fangs, poison, axolotls #3559

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1512
Author: @ludovic111
Created: 10/23/2026
Status: ✅ Merged
Merged: 10/24/2026
Merged by: @ludovic111

Base: main ← Head: fix/st-hits


📝 Commits (10+)

  • c86996c Fishing on a server's players: a hook per player, ticked on the server and drawn by its clients
  • 287d7a7 Maps on a server's players: each holder's map ticks on the server and its data reaches them
  • fa4ea80 A server's player's client sets its body as in frame: look pitch, use slowdown, boots on powder snow
  • f96101c Strikes and mob effects reach a server's players: lightning, evoker fangs, poison, axolotls
  • 8c81cc6 Merge remote-tracking branch 'origin/fix/st-wind-charge' into fix/st-fishing
  • 26a91e3 Merge remote-tracking branch 'origin/fix/st-fishing' into fix/st-maps
  • e307f03 Merge remote-tracking branch 'origin/fix/st-maps' into fix/st-player-body
  • d65be41 Merge remote-tracking branch 'origin/fix/st-player-body' into fix/st-hits
  • 65031a7 Merge remote-tracking branch 'origin/main' into fix/st-fishing
  • 122e3bf Merge remote-tracking branch 'origin/fix/st-fishing' into fix/st-maps

📊 Changes

12 files changed (+951 additions, -160 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+53 -37)
📝 crates/horizon-client/src/game/control.rs (+1 -0)
📝 crates/horizon-client/src/game/fangs.rs (+12 -6)
📝 crates/horizon-client/src/game/fishing.rs (+241 -41)
📝 crates/horizon-client/src/game/lan.rs (+2 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+11 -0)
📝 crates/horizon-client/src/game/lan_mobs.rs (+21 -0)
📝 crates/horizon-client/src/game/lightning.rs (+22 -16)
📝 crates/horizon-client/src/game/maps.rs (+321 -50)
📝 crates/horizon-client/src/game/remote.rs (+1 -10)
📝 crates/horizon-client/src/game/remote_projectiles.rs (+7 -0)
📝 tools/lan_e2e.py (+259 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Fixes #1480, #1481, #1484 and #1485.

What

On a server (LAN guests, and single player on its server thread):

  • lightning and evoker fangs now hurt the players they strike;
  • the effects mobs give a player now reach that player:
    • poison from cave spiders and bees;
    • hunger from husks;
    • wither from wither skeletons;
    • the nautilus's Breath of the Nautilus for its rider;
  • an axolotl's help after a kill (Regeneration, no Mining Fatigue) reaches the player too.

Why

Checked against vanilla 26.3 first:

  • Lightning: LightningBolt.tick calls Entity.thunderHit for every entity in its box: 5 damage and fire. Players are included.
  • Evoker fangs: EvokerFangs.dealDamageTo hits every living entity in the fangs' box that isn't an ally of the evoker. Players are included.
  • Mob effects and axolotls: CaveSpider.doHurtTarget and the others add the effect to their target. Axolotl.applySupportingEffects buffs the player who made the kill.

In Horizon:

  • thunder_hit and fangs_bite looked only at self.player. On the server thread that is no one, and in-frame it is the host. So the server's other players were never struck.
  • Mobs' events: a mob's tick runs with the player it sees swapped in. acts_on_player sent its blows, pushes, fire and launches to the guest it targets. It did not send MobEvent::EffectPlayer or MobEvent::AxolotlSupportPlayer, so those stayed with the server's own player.

How

  • Game::each_guest_hit runs a closure as each guest in play here, through guest_hit_by, which also sends the guest its new motion.
  • thunder_hit and fangs_bite run their player part for the window's own player, then for each guest.
  • acts_on_player now also routes EffectPlayer and AxolotlSupportPlayer to the guest the mob sees.

Evidence

lan_e2e --check strikes, for each player, at night on Normal:

  • stand in 1-deep water and summon a bolt on themselves;
  • then let a cave spider loose beside them, and wait up to 200 ticks for Poison.
in-frame host in-frame guest --server-thread host --server-thread guest
before (the body PR's head) bolt 20 → 15.8, poisoned bolt 20 → 20, never poisoned 20 → 20, never poisoned 20 → 20, never poisoned
after 20 → 10.8, poisoned 20 → 15.8, poisoned 20 → 10.8, poisoned 20 → 15.8, poisoned

A bolt's damage varies, as in vanilla: it flashes again 1 to 3 times, and a flash more than 10 ticks after the hit hurts again. #1480's native control shows the same.

The evoker fangs, the axolotl and the nautilus share these code paths. The harness has no check for them: fangs can't be summoned without an evoker.

How tested

On the top of the stack (feat/st-default a4a101ca9, which contains this branch), on the Mac mini:

  • cargo fmt --all -- --check: clean.
  • cargo clippy --workspace --all-targets -- -D warnings: clean.
  • cargo test -p horizon-client --lib --bins: 1064 + 98 + 18 passed.
  • tools/parity.py --changed origin/main: 106/106 passed on the maps head, then 30/30 for the harnesses whose inputs changed after that.
  • tools/lan_e2e.py in the frame and with --server-thread: wind, fishing, maps, body, strikes and cursor pass in both. boats and minecarts pass with --server-thread.
  • A scripted single player session (walk, mine, place, inventory, combat, eating, boats, minecarts, chests, furnaces, beds, chat, signs, books, totems, keep_inventory, fishing, maps, then save and reopen): 48/48 on the server thread and 48/48 with --in-frame.

Stack

On top of the body PR (#1511). Merge order: … → #1510 → #1511 → this.

Needs Ludovic

A review and a merge, in stack order.

🤖 Generated with Claude Code


🔄 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/1512 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/23/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/st-hits` --- ### 📝 Commits (10+) - [`c86996c`](https://github.com/horizon-rust/horizon/commit/c86996c234457b08dafcae375a36ebdbe8fcadd9) Fishing on a server's players: a hook per player, ticked on the server and drawn by its clients - [`287d7a7`](https://github.com/horizon-rust/horizon/commit/287d7a7eb5e55a7936e89c9ac948f2a66aab74d1) Maps on a server's players: each holder's map ticks on the server and its data reaches them - [`fa4ea80`](https://github.com/horizon-rust/horizon/commit/fa4ea80d3253ea3a65b0663454f4a03c4e52c4b2) A server's player's client sets its body as in frame: look pitch, use slowdown, boots on powder snow - [`f96101c`](https://github.com/horizon-rust/horizon/commit/f96101cd47f35e998ac1f032f92ce7a4de82f89e) Strikes and mob effects reach a server's players: lightning, evoker fangs, poison, axolotls - [`8c81cc6`](https://github.com/horizon-rust/horizon/commit/8c81cc63f71f8f4c4c75a30f14406ed8cf3eaf88) Merge remote-tracking branch 'origin/fix/st-wind-charge' into fix/st-fishing - [`26a91e3`](https://github.com/horizon-rust/horizon/commit/26a91e3a08059af6f43af950593665774b58d1fe) Merge remote-tracking branch 'origin/fix/st-fishing' into fix/st-maps - [`e307f03`](https://github.com/horizon-rust/horizon/commit/e307f036842c53942079b1179c3feea9dcd0930e) Merge remote-tracking branch 'origin/fix/st-maps' into fix/st-player-body - [`d65be41`](https://github.com/horizon-rust/horizon/commit/d65be4183fecfd3256c204e996442bef7bc087c1) Merge remote-tracking branch 'origin/fix/st-player-body' into fix/st-hits - [`65031a7`](https://github.com/horizon-rust/horizon/commit/65031a77397c2cc9cee24b2eb5e27d2db0ed36e6) Merge remote-tracking branch 'origin/main' into fix/st-fishing - [`122e3bf`](https://github.com/horizon-rust/horizon/commit/122e3bf2876bd05376ef6e699af07d95aa179165) Merge remote-tracking branch 'origin/fix/st-fishing' into fix/st-maps ### 📊 Changes **12 files changed** (+951 additions, -160 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+53 -37) 📝 `crates/horizon-client/src/game/control.rs` (+1 -0) 📝 `crates/horizon-client/src/game/fangs.rs` (+12 -6) 📝 `crates/horizon-client/src/game/fishing.rs` (+241 -41) 📝 `crates/horizon-client/src/game/lan.rs` (+2 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+11 -0) 📝 `crates/horizon-client/src/game/lan_mobs.rs` (+21 -0) 📝 `crates/horizon-client/src/game/lightning.rs` (+22 -16) 📝 `crates/horizon-client/src/game/maps.rs` (+321 -50) 📝 `crates/horizon-client/src/game/remote.rs` (+1 -10) 📝 `crates/horizon-client/src/game/remote_projectiles.rs` (+7 -0) 📝 `tools/lan_e2e.py` (+259 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Fixes #1480, #1481, #1484 and #1485. ## What On a server (LAN guests, and single player on its server thread): - lightning and evoker fangs now hurt the players they strike; - the effects mobs give a player now reach that player: - poison from cave spiders and bees; - hunger from husks; - wither from wither skeletons; - the nautilus's Breath of the Nautilus for its rider; - an axolotl's help after a kill (Regeneration, no Mining Fatigue) reaches the player too. ## Why Checked against vanilla 26.3 first: - **Lightning:** `LightningBolt.tick` calls `Entity.thunderHit` for every entity in its box: 5 damage and fire. Players are included. - **Evoker fangs:** `EvokerFangs.dealDamageTo` hits every living entity in the fangs' box that isn't an ally of the evoker. Players are included. - **Mob effects and axolotls:** `CaveSpider.doHurtTarget` and the others add the effect to their target. `Axolotl.applySupportingEffects` buffs the player who made the kill. In Horizon: - **`thunder_hit` and `fangs_bite`** looked only at `self.player`. On the server thread that is no one, and in-frame it is the host. So the server's other players were never struck. - **Mobs' events:** a mob's tick runs with the player it sees swapped in. `acts_on_player` sent its blows, pushes, fire and launches to the guest it targets. It did not send `MobEvent::EffectPlayer` or `MobEvent::AxolotlSupportPlayer`, so those stayed with the server's own player. ## How - **`Game::each_guest_hit`** runs a closure as each guest in play here, through `guest_hit_by`, which also sends the guest its new motion. - **`thunder_hit` and `fangs_bite`** run their player part for the window's own player, then for each guest. - **`acts_on_player`** now also routes `EffectPlayer` and `AxolotlSupportPlayer` to the guest the mob sees. ## Evidence `lan_e2e --check strikes`, for each player, at night on Normal: - stand in 1-deep water and summon a bolt on themselves; - then let a cave spider loose beside them, and wait up to 200 ticks for Poison. | | in-frame host | in-frame guest | `--server-thread` host | `--server-thread` guest | |---|---|---|---|---| | **before** (the body PR's head) | bolt 20 → 15.8, poisoned | **bolt 20 → 20, never poisoned** | **20 → 20, never poisoned** | **20 → 20, never poisoned** | | **after** | 20 → 10.8, poisoned | 20 → 15.8, poisoned | 20 → 10.8, poisoned | 20 → 15.8, poisoned | A bolt's damage varies, as in vanilla: it flashes again 1 to 3 times, and a flash more than 10 ticks after the hit hurts again. #1480's native control shows the same. The evoker fangs, the axolotl and the nautilus share these code paths. The harness has no check for them: fangs can't be summoned without an evoker. ## How tested On the top of the stack (`feat/st-default` a4a101ca9, which contains this branch), on the Mac mini: - `cargo fmt --all -- --check`: clean. - `cargo clippy --workspace --all-targets -- -D warnings`: clean. - `cargo test -p horizon-client --lib --bins`: 1064 + 98 + 18 passed. - `tools/parity.py --changed origin/main`: 106/106 passed on the maps head, then 30/30 for the harnesses whose inputs changed after that. - `tools/lan_e2e.py` in the frame and with `--server-thread`: `wind`, `fishing`, `maps`, `body`, `strikes` and `cursor` pass in both. `boats` and `minecarts` pass with `--server-thread`. - A scripted single player session (walk, mine, place, inventory, combat, eating, boats, minecarts, chests, furnaces, beds, chat, signs, books, totems, keep_inventory, fishing, maps, then save and reopen): 48/48 on the server thread and 48/48 with `--in-frame`. ## Stack On top of the body PR (#1511). Merge order: … → #1510 → #1511 → **this**. ## Needs Ludovic A review and a merge, in stack order. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:10:24 +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#3559
No description provided.