[GH-ISSUE #4777] An item's attribute modifiers never apply from the off hand: the equipment-change port walks five slots, not six #1444

Closed
opened 2026-11-02 15:47:00 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @sirrayi on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4777

Originally assigned to: @DmytroChup on GitHub.

🤖 Filed by sirrayi's AI agent (DeepSeek Harness, deepseek-v4.1-flash), not by sirrayi themselves.

What happens

LivingEntity.collectEquipmentChanges is ported with five slots — head, chest, legs, feet, main hand — and never the off hand, so an item's attribute modifiers never reach the attribute map while it sits in the off hand. Vanilla iterates every EquipmentSlot, off hand included, and the EquipmentSlotGroup.HAND group that attack_damage, attack_speed and attack_knockback modifiers use covers both hands.

  • crates/horizon-client/src/game.rs:10646 — apply_equipment, whose slot list is head, chest, legs, feet, mainhand.
  • crates/horizon-client/src/game.rs:1657 — equipment_modifier_applies, which tests hand against the main hand only.

Consequence: a mace, trident or any future off-hand-usable weapon contributes no attribute modifier, so a "mace swap" into the off hand (mace's smash damage, #3182's report) does nothing, and /attribute ... get reports the same value whether the item is in the main hand or the off hand.

Suggested fix

Add ("offhand", &self.offhand) to apply_equipment's list and make equipment_modifier_applies treat EquipmentSlotGroup.HAND as both hands. There is already a unit test in the same file (equipment_modifiers_follow_their_slot_group, game.rs:17431) to extend with the off-hand case; nothing else about slot groups changes.

Blast radius

apply_equipment is the only writer of item modifiers into the player's attribute map, and that map is what /attribute get and the client's own attribute sync read, so the change makes the reported values correct where they were previously missing the off hand. It does not touch the attack path, which reads the item directly (see the separate ATTACK_DAMAGE report).

Originally created by @sirrayi on GitHub (Oct 30, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4777 Originally assigned to: @DmytroChup on GitHub. > 🤖 Filed by sirrayi's AI agent (DeepSeek Harness, deepseek-v4.1-flash), not by sirrayi themselves. **What happens** `LivingEntity.collectEquipmentChanges` is ported with five slots — head, chest, legs, feet, main hand — and never the off hand, so an item's attribute modifiers never reach the attribute map while it sits in the off hand. Vanilla iterates every `EquipmentSlot`, off hand included, and the `EquipmentSlotGroup.HAND` group that `attack_damage`, `attack_speed` and `attack_knockback` modifiers use covers both hands. - `crates/horizon-client/src/game.rs:10646` — `apply_equipment`, whose slot list is `head, chest, legs, feet, mainhand`. - `crates/horizon-client/src/game.rs:1657` — `equipment_modifier_applies`, which tests `hand` against the main hand only. Consequence: a mace, trident or any future off-hand-usable weapon contributes no attribute modifier, so a "mace swap" into the off hand (mace's smash damage, #3182's report) does nothing, and `/attribute ... get` reports the same value whether the item is in the main hand or the off hand. **Suggested fix** Add `("offhand", &self.offhand)` to `apply_equipment`'s list and make `equipment_modifier_applies` treat `EquipmentSlotGroup.HAND` as both hands. There is already a unit test in the same file (`equipment_modifiers_follow_their_slot_group`, `game.rs:17431`) to extend with the off-hand case; nothing else about slot groups changes. **Blast radius** `apply_equipment` is the only writer of item modifiers into the player's attribute map, and that map is what `/attribute get` and the client's own attribute sync read, so the change makes the reported values *correct* where they were previously missing the off hand. It does not touch the attack path, which reads the item directly (see the separate `ATTACK_DAMAGE` report).
Author
Owner

@DmytroChup commented on GitHub (Oct 31, 2026):

/claim

<!-- gh-comment-id:6536392670 --> @DmytroChup commented on GitHub (Oct 31, 2026): /claim
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#1444
No description provided.