[PR #2444] [MERGED] Show the enchanted hit when a melee weapon's enchantments add damage #4321

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

📋 Pull Request Information

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

Base: main ← Head: fix/enchanted-hit


📝 Commits (1)

  • d78238f Show the enchanted hit when a melee weapon's enchantments add damage

📊 Changes

5 files changed (+50 additions, -26 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+18 -5)
📝 crates/horizon-client/src/game/lan.rs (+14 -11)
📝 crates/horizon-client/src/game/lan_pvp.rs (+12 -5)
📝 crates/horizon-client/src/game/levels.rs (+1 -1)
📝 crates/horizon-client/src/lan/containers.rs (+5 -4)

📄 Description

What and why

Hitting a mob or a player with a weapon whose enchantments add damage (Sharpness, Smite, Bane of Arthropods) should show the blue enchanted hit particles around the victim. Horizon showed only the critical hit particles.

A melee hit now also draws the enchanted hit when the enchantment bonus is above 0. For the window's own player it draws them at once. For a guest of a server (including the window's player when single player runs on its server thread) the server sends an animate packet with the magic critical hit action to the attacker and to the players around, and the client already draws it. The same goes for a guest hitting another player.

Vanilla reference

  • Player.attack: magicBoost = attackStrengthScale * (getEnchantedDamage(...) - baseDamage).
  • Player.attackVisualEffects: when the hit hurt the target, magicCrit(entity) if magicBoost > 0, after the critical hit and the attack sound.
  • ServerPlayer.magicCrit: ClientboundAnimatePacket(entity, MAGIC_CRITICAL_HIT) (action 2) to the players tracking the attacker and the attacker.
  • ClientPacketListener.handleAnimate: action 2 creates the ENCHANTED_HIT tracking emitter on the entity.

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/2444 **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/enchanted-hit` --- ### 📝 Commits (1) - [`d78238f`](https://github.com/horizon-rust/horizon/commit/d78238f7651843e1f056a0ecdcfdf4a09adcf8fd) Show the enchanted hit when a melee weapon's enchantments add damage ### 📊 Changes **5 files changed** (+50 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+18 -5) 📝 `crates/horizon-client/src/game/lan.rs` (+14 -11) 📝 `crates/horizon-client/src/game/lan_pvp.rs` (+12 -5) 📝 `crates/horizon-client/src/game/levels.rs` (+1 -1) 📝 `crates/horizon-client/src/lan/containers.rs` (+5 -4) </details> ### 📄 Description ## What and why Hitting a mob or a player with a weapon whose enchantments add damage (Sharpness, Smite, Bane of Arthropods) should show the blue enchanted hit particles around the victim. Horizon showed only the critical hit particles. A melee hit now also draws the enchanted hit when the enchantment bonus is above 0. For the window's own player it draws them at once. For a guest of a server (including the window's player when single player runs on its server thread) the server sends an animate packet with the magic critical hit action to the attacker and to the players around, and the client already draws it. The same goes for a guest hitting another player. ## Vanilla reference - `Player.attack`: `magicBoost = attackStrengthScale * (getEnchantedDamage(...) - baseDamage)`. - `Player.attackVisualEffects`: when the hit hurt the target, `magicCrit(entity)` if `magicBoost > 0`, after the critical hit and the attack sound. - `ServerPlayer.magicCrit`: `ClientboundAnimatePacket(entity, MAGIC_CRITICAL_HIT)` (action 2) to the players tracking the attacker and the attacker. - `ClientPacketListener.handleAnimate`: action 2 creates the `ENCHANTED_HIT` tracking emitter on the entity. ## 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:16:20 +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#4321
No description provided.