[PR #2659] [MERGED] Let a sweep attack hurt and push back the other players next to the target #4514

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

📋 Pull Request Information

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

Base: main ← Head: fix/sweep-hits-players


📝 Commits (3)

  • 7b84a7a Let a sweep attack hurt and push back the other players next to the target
  • 683ff6f Merge main into fix/sweep-hits-players
  • 9f2e448 Merge main into fix/sweep-hits-players

📊 Changes

4 files changed (+163 additions, -14 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+22 -13)
📝 crates/horizon-client/src/game/creatures.rs (+3 -0)
📝 crates/horizon-client/src/game/lan.rs (+2 -0)
📝 crates/horizon-client/src/game/lan_pvp.rs (+136 -1)

📄 Description

What and why

A sword's sweep attack hurt and pushed back only mobs. Other players standing next to the target (the host or guests, in a LAN or dedicated world) were never touched.

Now the sweep also reaches the other players in the target's box grown by (1, 0.25, 1) and closer than 3 blocks. Allies on the attacker's team are skipped. Everyone else is hurt only when the pvp game rule allows it, and is pushed 0.4 along the attacker's yaw. This works when the target is a mob and when the target is a player, and for a host or a guest attacker. A guest's sweep waits until the end of their turn (like the wind burst does), because the host holds the other players while the guest acts.

The sweep damage formula moved into sweep_base_damage so the mob loop and the player loop share it.

Not in this change: a sweep that starts from a player target still does not hurt mobs next to it.

Vanilla reference

  • Player.doSweepAttack: all LivingEntity in the box, except the attacker, the target and allies (isAlliedTo); distanceToSqr < 9; hurtServer then knockback(0.4, sin yaw, -cos yaw).
  • ServerPlayer.canHarmPlayer for the pvp rule.

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/2659 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/sweep-hits-players` --- ### 📝 Commits (3) - [`7b84a7a`](https://github.com/horizon-rust/horizon/commit/7b84a7ae91fe62175c76024ef497eb7a1d83932a) Let a sweep attack hurt and push back the other players next to the target - [`683ff6f`](https://github.com/horizon-rust/horizon/commit/683ff6f73a56c6934524789da12e1d2b98f34f6c) Merge main into fix/sweep-hits-players - [`9f2e448`](https://github.com/horizon-rust/horizon/commit/9f2e4485ade7dd243634d7cda86ccef1d2fa044b) Merge main into fix/sweep-hits-players ### 📊 Changes **4 files changed** (+163 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+22 -13) 📝 `crates/horizon-client/src/game/creatures.rs` (+3 -0) 📝 `crates/horizon-client/src/game/lan.rs` (+2 -0) 📝 `crates/horizon-client/src/game/lan_pvp.rs` (+136 -1) </details> ### 📄 Description ## What and why A sword's sweep attack hurt and pushed back only mobs. Other players standing next to the target (the host or guests, in a LAN or dedicated world) were never touched. Now the sweep also reaches the other players in the target's box grown by (1, 0.25, 1) and closer than 3 blocks. Allies on the attacker's team are skipped. Everyone else is hurt only when the `pvp` game rule allows it, and is pushed 0.4 along the attacker's yaw. This works when the target is a mob and when the target is a player, and for a host or a guest attacker. A guest's sweep waits until the end of their turn (like the wind burst does), because the host holds the other players while the guest acts. The sweep damage formula moved into `sweep_base_damage` so the mob loop and the player loop share it. Not in this change: a sweep that starts from a player target still does not hurt mobs next to it. ## Vanilla reference - `Player.doSweepAttack`: all `LivingEntity` in the box, except the attacker, the target and allies (`isAlliedTo`); `distanceToSqr < 9`; `hurtServer` then `knockback(0.4, sin yaw, -cos yaw)`. - `ServerPlayer.canHarmPlayer` for the `pvp` rule. ## 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:17:42 +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#4514
No description provided.