[PR #2329] [MERGED] Apply knockback resistance to Punch arrows #4211

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2329
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/punch-knockback-resistance


📝 Commits (1)

  • bf527e7 Apply knockback resistance to Punch arrows

📊 Changes

1 file changed (+17 additions, -3 deletions)

View changed files

📝 crates/horizon-client/src/game/creatures.rs (+17 -3)

📄 Description

What and why

Punch pushed every target the same distance, even ones with knockback resistance (iron golems, ravagers, players in netherite armor). In vanilla the push is scaled by 1 - knockback resistance, and a fully resistant target is not pushed at all. The arrow hit now reads the target's knockback resistance (mob attribute or the player's attribute) and scales the push.

Vanilla reference

  • AbstractArrow.doKnockback: knockback * 0.6 * max(0, 1 - KNOCKBACK_RESISTANCE) along the normalized horizontal motion, then push(x, 0.1, z) only if the vector is not zero.

Self-check

cargo check -p horizon-client passes.


🔄 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/2329 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/punch-knockback-resistance` --- ### 📝 Commits (1) - [`bf527e7`](https://github.com/horizon-rust/horizon/commit/bf527e7a13ccf3b6477dbc49004086c44a8832a7) Apply knockback resistance to Punch arrows ### 📊 Changes **1 file changed** (+17 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/creatures.rs` (+17 -3) </details> ### 📄 Description ## What and why Punch pushed every target the same distance, even ones with knockback resistance (iron golems, ravagers, players in netherite armor). In vanilla the push is scaled by `1 - knockback resistance`, and a fully resistant target is not pushed at all. The arrow hit now reads the target's knockback resistance (mob attribute or the player's attribute) and scales the push. ## Vanilla reference - `AbstractArrow.doKnockback`: `knockback * 0.6 * max(0, 1 - KNOCKBACK_RESISTANCE)` along the normalized horizontal motion, then `push(x, 0.1, z)` only if the vector is not zero. ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:15:30 +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#4211
No description provided.