[PR #1417] [MERGED] Rules: crits, off-hand mending, phantoms, per-level health regen, /item with air, frozen potions #3505

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

📋 Pull Request Information

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

Base: main ← Head: fix/st2-rules


📝 Commits (2)

  • 06b4c7f Rules: crits, mending, phantoms, per-level health rules, /item with air, frozen potions
  • cb81f64 Merge remote-tracking branch 'origin/main' into fix/st2-rules

📊 Changes

6 files changed (+117 additions, -53 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+13 -5)
📝 crates/horizon-client/src/game/commands/items.rs (+4 -1)
📝 crates/horizon-client/src/game/enchant_effects.rs (+39 -28)
📝 crates/horizon-client/src/game/levels.rs (+3 -0)
📝 crates/horizon-client/src/game/potions.rs (+7 -3)
📝 crates/horizon-client/src/game/stats.rs (+51 -16)

📄 Description

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

Rules and combat fixes from the single player audit (bugs-st-2: interaction, items, chat).

  • Critical hits: Player.canCriticalAttack also needs the attacker out of water, not blind and not riding (#1393).
  • Mending repairs a damaged off-hand item too. Candidates go in EquipmentSlot order: main hand, off hand, then armour (#1349).
  • Phantoms spawn only in the Overworld, only with spawn_mobs, spawn_monsters and spawn_phantoms all on (#1388). They spawn near every player: the local one, and each guest in the level with that guest's own time since rest. This brings back insomnia on the server thread, where every player is a guest (#1387). The random draws follow vanilla's order.
  • natural_health_regeneration carries over into a level entered by a portal or a dimension change (#1339).
  • /item replace … with air empties the slot. The slot counts as changed, as in vanilla's SlotAccess.set (#1332).
  • Thrown potions stay put on frozen ticks (/tick freeze) and land once the game runs again. Players' own effects keep ticking (#1364).

Fixes #1393
Fixes #1349
Fixes #1388
Fixes #1387
Fixes #1339
Fixes #1332
Fixes #1364

Proof

Each check was run with horizon-ctl in both single player modes (HORIZON_SERVER_THREAD=1 and 0), on fresh worlds, and passed in both:

Issue Probe Result (both modes)
#1349 pickaxe at damage 100 in the off hand, one 7-point XP orb damage 100 → 86, XP stays 0
#1393 iron sword critical jump on a 40-health cow 40 → 31 without Blindness, 40 → 34 with it (no crit)
#1339 Nether with natural_health_regeneration false, damaged to 16 still 16 after 200 ticks
#1332 item replace … hotbar.0 with air, then give diamond the diamond goes to slot 0
#1364 Splash Potion of Swiftness thrown at your feet during /tick freeze no effect after 40 frozen ticks; Speed after unfreezing
#1388/#1387 time_since_rest set to 2,000,000,000 in the stats file, reopen, night, tick sprint 6000 spawn_mobs false: 0 phantoms in both modes. spawn_mobs true: 5 phantoms on the server thread (none spawned there before), 3 in-frame (one in-frame run got 0; spawning is random)

Self-check

  • cargo fmt --all; cargo clippy --workspace --all-targets -- -D warnings: clean
  • cargo test -p horizon-client: all pass
  • tools/parity.py --changed origin/main: 103 of 103 affected harnesses pass. This was one run over all four PRs merged together (8c9cdf9a: #1417 06b4c7fa, #1418 7e5e4697, #1419 337d7d7a, #1420 5d2f1804). The first run found that save_roundtrip saved an allay with InLove 0; #1418's second commit fixes that.

🤖 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/1417 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/23/2026 **Status:** ✅ Merged **Merged:** 10/23/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/st2-rules` --- ### 📝 Commits (2) - [`06b4c7f`](https://github.com/horizon-rust/horizon/commit/06b4c7faf52df6b3c12c40e75f7a3e5bba40103d) Rules: crits, mending, phantoms, per-level health rules, /item with air, frozen potions - [`cb81f64`](https://github.com/horizon-rust/horizon/commit/cb81f645da75bdfaefd5e76ffb8518bdd5e58191) Merge remote-tracking branch 'origin/main' into fix/st2-rules ### 📊 Changes **6 files changed** (+117 additions, -53 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+13 -5) 📝 `crates/horizon-client/src/game/commands/items.rs` (+4 -1) 📝 `crates/horizon-client/src/game/enchant_effects.rs` (+39 -28) 📝 `crates/horizon-client/src/game/levels.rs` (+3 -0) 📝 `crates/horizon-client/src/game/potions.rs` (+7 -3) 📝 `crates/horizon-client/src/game/stats.rs` (+51 -16) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Rules and combat fixes from the single player audit (bugs-st-2: interaction, items, chat). - **Critical hits**: `Player.canCriticalAttack` also needs the attacker out of water, not blind and not riding (#1393). - **Mending** repairs a damaged off-hand item too. Candidates go in `EquipmentSlot` order: main hand, off hand, then armour (#1349). - **Phantoms** spawn only in the Overworld, only with `spawn_mobs`, `spawn_monsters` and `spawn_phantoms` all on (#1388). They spawn near every player: the local one, and each guest in the level with that guest's own time since rest. This brings back insomnia on the server thread, where every player is a guest (#1387). The random draws follow vanilla's order. - **natural_health_regeneration** carries over into a level entered by a portal or a dimension change (#1339). - **`/item replace … with air`** empties the slot. The slot counts as changed, as in vanilla's `SlotAccess.set` (#1332). - **Thrown potions** stay put on frozen ticks (`/tick freeze`) and land once the game runs again. Players' own effects keep ticking (#1364). Fixes #1393 Fixes #1349 Fixes #1388 Fixes #1387 Fixes #1339 Fixes #1332 Fixes #1364 ## Proof Each check was run with `horizon-ctl` in both single player modes (`HORIZON_SERVER_THREAD=1` and `0`), on fresh worlds, and passed in both: | Issue | Probe | Result (both modes) | | --- | --- | --- | | #1349 | pickaxe at damage 100 in the off hand, one 7-point XP orb | damage 100 → 86, XP stays 0 | | #1393 | iron sword critical jump on a 40-health cow | 40 → 31 without Blindness, 40 → 34 with it (no crit) | | #1339 | Nether with `natural_health_regeneration false`, damaged to 16 | still 16 after 200 ticks | | #1332 | `item replace … hotbar.0 with air`, then `give diamond` | the diamond goes to slot 0 | | #1364 | Splash Potion of Swiftness thrown at your feet during `/tick freeze` | no effect after 40 frozen ticks; Speed after unfreezing | | #1388/#1387 | `time_since_rest` set to 2,000,000,000 in the stats file, reopen, night, `tick sprint 6000` | `spawn_mobs false`: 0 phantoms in both modes. `spawn_mobs true`: 5 phantoms on the server thread (none spawned there before), 3 in-frame (one in-frame run got 0; spawning is random) | ## Self-check - `cargo fmt --all`; `cargo clippy --workspace --all-targets -- -D warnings`: clean - `cargo test -p horizon-client`: all pass - `tools/parity.py --changed origin/main`: 103 of 103 affected harnesses pass. This was one run over all four PRs merged together (8c9cdf9a: #1417 06b4c7fa, #1418 7e5e4697, #1419 337d7d7a, #1420 5d2f1804). The first run found that `save_roundtrip` saved an allay with InLove 0; #1418's second commit fixes that. 🤖 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:01 +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#3505
No description provided.