[PR #2143] [MERGED] Make a sword sweep hurt the mobs next to the target #4044

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

📋 Pull Request Information

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

Base: main ← Head: fix/sweep-attack-damage


📝 Commits (2)

  • 65bebdf Make a sword sweep hurt the mobs next to the target
  • 6bdf5fe Sweep: hit mobs within 3 blocks in creative too

📊 Changes

2 files changed (+65 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+64 -0)
📝 crates/horizon-client/src/game/mace.rs (+1 -1)

📄 Description

What and why

A sword sweep only played the particle and the sound. The other mobs next to the target took no damage and no knockback.

After a sweep hit on a mob, Game::sweep_damage now hurts every other living mob in the target's box grown by (1, 0.25, 1), within the player's reach (3 blocks, 5 in creative). The player's allies are spared (pets, allays that like the player, scoreboard team mates).

  • Each mob takes (1 + sweeping_damage_ratio * baseDamage + enchantment bonus) * attack strength.
  • baseDamage is the attack damage with Strength and Weakness, scaled by the attack strength, before enchantments.
  • The ratio is the Sweeping Edge enchantment's minecraft:sweeping_damage_ratio modifier (L/(L+1)), read with the existing enchantment attribute lookup. Without the enchantment it is 0, so the damage is 1.
  • A mob that was hurt is knocked back 0.4 along the player's yaw and credited to the player for drops and experience.

The change sits next to the existing hit logic in attack_mob; sweep_attack (particles and sound) is untouched.

Left out: a sweep in a player-versus-player hit (the damage would have to be worked out for the attacker's enchantments against each mob at the time the hit lands), armor stands, and the post-attack enchantments (Fire Aspect) on the swept mobs.

Vanilla reference

  • Player.doSweepAttack (the sweep box, 1.0F + SWEEPING_DAMAGE_RATIO * baseDamage, getEnchantedDamage * attackStrengthScale, the 0.4 knockback)
  • Player.attack (baseDamage as passed to the sweep)
  • data/minecraft/enchantment/sweeping_edge.json

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/2143 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/sweep-attack-damage` --- ### 📝 Commits (2) - [`65bebdf`](https://github.com/horizon-rust/horizon/commit/65bebdfc49cd86f09ba18bd2eeb2f536c0816ad9) Make a sword sweep hurt the mobs next to the target - [`6bdf5fe`](https://github.com/horizon-rust/horizon/commit/6bdf5fe3683dc20f1c0fe2e8ceb87bae17b58526) Sweep: hit mobs within 3 blocks in creative too ### 📊 Changes **2 files changed** (+65 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+64 -0) 📝 `crates/horizon-client/src/game/mace.rs` (+1 -1) </details> ### 📄 Description ## What and why A sword sweep only played the particle and the sound. The other mobs next to the target took no damage and no knockback. After a sweep hit on a mob, `Game::sweep_damage` now hurts every other living mob in the target's box grown by (1, 0.25, 1), within the player's reach (3 blocks, 5 in creative). The player's allies are spared (pets, allays that like the player, scoreboard team mates). - Each mob takes `(1 + sweeping_damage_ratio * baseDamage + enchantment bonus) * attack strength`. - `baseDamage` is the attack damage with Strength and Weakness, scaled by the attack strength, before enchantments. - The ratio is the Sweeping Edge enchantment's `minecraft:sweeping_damage_ratio` modifier (L/(L+1)), read with the existing enchantment attribute lookup. Without the enchantment it is 0, so the damage is 1. - A mob that was hurt is knocked back 0.4 along the player's yaw and credited to the player for drops and experience. The change sits next to the existing hit logic in `attack_mob`; `sweep_attack` (particles and sound) is untouched. Left out: a sweep in a player-versus-player hit (the damage would have to be worked out for the attacker's enchantments against each mob at the time the hit lands), armor stands, and the post-attack enchantments (Fire Aspect) on the swept mobs. ## Vanilla reference - `Player.doSweepAttack` (the sweep box, `1.0F + SWEEPING_DAMAGE_RATIO * baseDamage`, `getEnchantedDamage * attackStrengthScale`, the 0.4 knockback) - `Player.attack` (`baseDamage` as passed to the sweep) - `data/minecraft/enchantment/sweeping_edge.json` ## 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:14:15 +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#4044
No description provided.