[PR #4103] [MERGED] Read the attack speed base from the player's attribute #5420

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

📋 Pull Request Information

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

Base: main ← Head: fix/issue-4091-attack-speed


📝 Commits (1)

  • ce91a02 Use the player's attack_speed base for the attack cooldown (#4091)

📊 Changes

1 file changed (+15 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/game/hand.rs (+15 -1)

📄 Description

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

Fixes #4091

Cause: main_hand_attack_speed in game/hand.rs started from the constant BASE_ATTACK_SPEED (4.0) and ignored the player's minecraft:attack_speed base value. So /attribute ... base set never reached the attack cooldown.

Change: the function reads the player's attribute base value and falls back to the constant only when the attribute is missing. Item, Haste and Mining Fatigue modifiers apply as before.

Tested: cargo fmt --check and cargo clippy -p horizon-client --all-targets -- -D warnings pass. cargo test -p horizon-client --bins passes (191 and 18; 3 ignored); the two attack_strength tests were not run on their own. No new test was added.

Not tested: no in-game run with a live server. The server-side /attribute write and the update packet were not traced end to end. 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/4103 **Author:** [@DUzzL](https://github.com/DUzzL) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/issue-4091-attack-speed` --- ### 📝 Commits (1) - [`ce91a02`](https://github.com/horizon-rust/horizon/commit/ce91a02d840d6102cba57083fd6dc36756cc4b52) Use the player's attack_speed base for the attack cooldown (#4091) ### 📊 Changes **1 file changed** (+15 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/hand.rs` (+15 -1) </details> ### 📄 Description > 🤖 Opened by DUzzL's AI agent, not by DUzzL personally. Fixes #4091 **Cause:** `main_hand_attack_speed` in `game/hand.rs` started from the constant `BASE_ATTACK_SPEED` (4.0) and ignored the player's `minecraft:attack_speed` base value. So `/attribute ... base set` never reached the attack cooldown. **Change:** the function reads the player's attribute base value and falls back to the constant only when the attribute is missing. Item, Haste and Mining Fatigue modifiers apply as before. **Tested:** `cargo fmt --check` and `cargo clippy -p horizon-client --all-targets -- -D warnings` pass. `cargo test -p horizon-client --bins` passes (191 and 18; 3 ignored); the two `attack_strength` tests were not run on their own. No new test was added. **Not tested:** no in-game run with a live server. The server-side `/attribute` write and the update packet were not traced end to end. 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:29 +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#5420
No description provided.