[PR #2144] [MERGED] Make thorns hurt the entity that hit the player #4045

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

📋 Pull Request Information

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

Base: main ← Head: fix/thorns-hits-attacker


📝 Commits (2)

  • 5b0ae25 Make thorns hurt the entity that hit the player
  • 864ba24 Merge main into fix/thorns-hits-attacker

📊 Changes

3 files changed (+45 additions, -33 deletions)

View changed files

📝 crates/horizon-client/src/game/creatures.rs (+4 -1)
📝 crates/horizon-client/src/game/enchant_effects.rs (+22 -26)
📝 crates/horizon-client/src/game/lan_pvp.rs (+19 -6)

📄 Description

What and why

Thorns hurt the wrong creature. When something hit a player in thorns armor, thorns picked the nearest living mob in the whole world, whatever hit the player.

The hit now says who caused it:

  • A mob's hit (mob_hits_player) hurts that mob with the thorns, or the owner of the projectile for an arrow, a spit and the like. A hit with no causing entity does nothing.
  • A player hitting another player in a LAN world hurts the attacking player (the host, or the guest who struck), with minecraft:thorns damage.

The thorns roll (which worn pieces fire, the 1 to 5 damage, the 2 wear) is now thorns_damage, shared by both cases. The sound and the damage of the mob case are unchanged.

Not changed: a player's arrow that hits another player does not hurt the shooter, and thorns still fire for every mob hit that has a causing entity, including the few kinds vanilla never runs post-attack effects for (wither skull, wind charge, large fireball).

Vanilla reference

  • Enchantment.doPostAttack (affected: ATTACKER is DamageSource.getEntity(), the causing entity, and no entity means no effect)
  • EnchantmentHelper.doPostAttackEffects
  • data/minecraft/enchantment/thorns.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/2144 **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/thorns-hits-attacker` --- ### 📝 Commits (2) - [`5b0ae25`](https://github.com/horizon-rust/horizon/commit/5b0ae25ff8ac27d0454ab59c3b80c0f42a08d33e) Make thorns hurt the entity that hit the player - [`864ba24`](https://github.com/horizon-rust/horizon/commit/864ba24c3d517e1920fe3379d7564971595130ba) Merge main into fix/thorns-hits-attacker ### 📊 Changes **3 files changed** (+45 additions, -33 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/creatures.rs` (+4 -1) 📝 `crates/horizon-client/src/game/enchant_effects.rs` (+22 -26) 📝 `crates/horizon-client/src/game/lan_pvp.rs` (+19 -6) </details> ### 📄 Description ## What and why Thorns hurt the wrong creature. When something hit a player in thorns armor, `thorns` picked the nearest living mob in the whole world, whatever hit the player. The hit now says who caused it: - A mob's hit (`mob_hits_player`) hurts that mob with the thorns, or the owner of the projectile for an arrow, a spit and the like. A hit with no causing entity does nothing. - A player hitting another player in a LAN world hurts the attacking player (the host, or the guest who struck), with `minecraft:thorns` damage. The thorns roll (which worn pieces fire, the 1 to 5 damage, the 2 wear) is now `thorns_damage`, shared by both cases. The sound and the damage of the mob case are unchanged. Not changed: a player's arrow that hits another player does not hurt the shooter, and thorns still fire for every mob hit that has a causing entity, including the few kinds vanilla never runs post-attack effects for (wither skull, wind charge, large fireball). ## Vanilla reference - `Enchantment.doPostAttack` (`affected: ATTACKER` is `DamageSource.getEntity()`, the causing entity, and no entity means no effect) - `EnchantmentHelper.doPostAttackEffects` - `data/minecraft/enchantment/thorns.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:16 +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#4045
No description provided.