[PR #4132] [MERGED] Apply held-item attribute modifiers to the main hand #5434

Closed
opened 2026-11-03 05:12:34 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4132
Author: @DUzzL
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @rdbtCVS

Base: main ← Head: fix/issue-4118-attribute-main-hand


📝 Commits (1)

  • 29363ee Apply the held item's main-hand modifiers to the player's attributes

📊 Changes

2 files changed (+24 additions, -6 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+23 -6)
📝 crates/horizon-client/src/game/hand.rs (+1 -0)

📄 Description

🤖 Opened by DUzzL's AI agent, not by DUzzL personally.

Fixes #4118

Cause: apply_equipment in game.rs pushed the main-hand stack but skipped it with slot == "mainhand", so held-item attribute modifiers never reached the player's attribute map. Armour was unaffected.

Change: the main-hand skip is removed and the slot-group match moved into equipment_modifier_applies. tick_hand in hand.rs re-applies equipment when the held item type changes, so hotbar swaps refresh it. apply_equipment clears previously applied modifiers first, so nothing stale is left. Attack damage and speed still read the item info directly, so nothing is counted twice. Armour and offhand paths are unchanged.

Tested: cargo fmt --check and cargo clippy -p horizon-client --all-targets -- -D warnings pass. cargo test -p horizon-client --bins passes (196 and 18; 3 ignored), including equipment_modifiers_follow_their_slot_group.

Not tested: no in-game run and no live server, so the /attribute @s minecraft:attack_damage get repro is not confirmed. LAN guest hotbar swaps (lan_actions) not checked. No vanilla parity run (no .local vanilla data here). tools/pr_ready.py not run.


🔄 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/4132 **Author:** [@DUzzL](https://github.com/DUzzL) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/issue-4118-attribute-main-hand` --- ### 📝 Commits (1) - [`29363ee`](https://github.com/horizon-rust/horizon/commit/29363ee3e9fdae134d9a3fcd29ddb5d25d4e1484) Apply the held item's main-hand modifiers to the player's attributes ### 📊 Changes **2 files changed** (+24 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+23 -6) 📝 `crates/horizon-client/src/game/hand.rs` (+1 -0) </details> ### 📄 Description > 🤖 Opened by DUzzL's AI agent, not by DUzzL personally. Fixes #4118 **Cause:** `apply_equipment` in `game.rs` pushed the main-hand stack but skipped it with `slot == "mainhand"`, so held-item attribute modifiers never reached the player's attribute map. Armour was unaffected. **Change:** the main-hand skip is removed and the slot-group match moved into `equipment_modifier_applies`. `tick_hand` in `hand.rs` re-applies equipment when the held item type changes, so hotbar swaps refresh it. `apply_equipment` clears previously applied modifiers first, so nothing stale is left. Attack damage and speed still read the item info directly, so nothing is counted twice. Armour and offhand paths are unchanged. **Tested:** `cargo fmt --check` and `cargo clippy -p horizon-client --all-targets -- -D warnings` pass. `cargo test -p horizon-client --bins` passes (196 and 18; 3 ignored), including `equipment_modifiers_follow_their_slot_group`. **Not tested:** no in-game run and no live server, so the `/attribute @s minecraft:attack_damage get` repro is not confirmed. LAN guest hotbar swaps (`lan_actions`) not checked. No vanilla parity run (no `.local` vanilla data here). `tools/pr_ready.py` not run. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:12:34 +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#5434
No description provided.