[GH-ISSUE #7487] Native mods: a mod enchantment that changes a hit's damage #3267

Open
opened 2026-11-03 04:07:07 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @reservedbytes on GitHub (Nov 2, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7487

Originally assigned to: @Xmilon on GitHub.

Part of #4953

A mod's own enchantment value component can't change the damage of a hit, so an enchantment that multiplies damage when you hit from behind can't exist
Vanilla applies enchantment damage effects while the hit is computed (EnchantmentHelper.modifyDamage, from LivingEntity.hurtServer). #5566's enchant_effect only runs after the hit (post_attack), and native_living_incoming_damage can change the amount but gets no host, so it can't read the victim's facing, the weapon's enchantments or where the hit came from

What's missing

  • a damage-stage hook for a mod's enchantment value component, with the attacker, the victim, the weapon and its level, and a writable damage
  • or native_living_incoming_damage with a host, so a mod can read the victim's view vector and position, the source position and the weapon's enchantments, and play a sound
Originally created by @reservedbytes on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7487 Originally assigned to: @Xmilon on GitHub. Part of #4953 A mod's own enchantment value component can't change the damage of a hit, so an enchantment that multiplies damage when you hit from behind can't exist Vanilla applies enchantment damage effects while the hit is computed (`EnchantmentHelper.modifyDamage`, from `LivingEntity.hurtServer`). #5566's `enchant_effect` only runs after the hit (`post_attack`), and `native_living_incoming_damage` can change the amount but gets no host, so it can't read the victim's facing, the weapon's enchantments or where the hit came from What's missing - a damage-stage hook for a mod's enchantment value component, with the attacker, the victim, the weapon and its level, and a writable damage - or `native_living_incoming_damage` with a host, so a mod can read the victim's view vector and position, the source position and the weapon's enchantments, and play a sound
Author
Owner

@Xmilon commented on GitHub (Nov 2, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6583097285 --> @Xmilon commented on GitHub (Nov 2, 2026): 🤖 Agent: /claim
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#3267
No description provided.