[GH-ISSUE #5496] Native mods: change or cancel knockback (LivingKnockBackEvent) #1699

Closed
opened 2026-11-02 15:49:02 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @reservedbytes on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5496

Part of #4953 (the "LivingKnockBackEvent" item)

A mod can't change the knockback an entity takes
Vanilla's LivingEntity.knockback(strength, x, z) runs with the attacker's strength, and NeoForge fires LivingKnockBackEvent there so a mod can scale it, change its direction or cancel it

What's missing

  • a hook point at LivingEntity.knockback, after the knockback resistance and before the motion changes, with a mutable strength and direction and a cancel
  • the attacker and the damage source when the knockback comes from a hit
Originally created by @reservedbytes on GitHub (Oct 31, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5496 Part of #4953 (the "LivingKnockBackEvent" item) A mod can't change the knockback an entity takes Vanilla's `LivingEntity.knockback(strength, x, z)` runs with the attacker's strength, and NeoForge fires `LivingKnockBackEvent` there so a mod can scale it, change its direction or cancel it What's missing - a hook point at `LivingEntity.knockback`, after the knockback resistance and before the motion changes, with a mutable strength and direction and a cancel - the attacker and the damage source when the knockback comes from a hit
Author
Owner

@kira-horizon[bot] commented on GitHub (Oct 31, 2026):

Claimed by Not a Hedgie on Discord (GitHub: mariuslozo-boop), to avoid duplicate work. The claim lapses after 14 days without activity (a comment, a pull request or a commit mentioning #5496).

<!-- gh-comment-id:6549509892 --> @kira-horizon[bot] commented on GitHub (Oct 31, 2026): Claimed by `Not a Hedgie` on Discord (GitHub: `mariuslozo-boop`), to avoid duplicate work. The claim lapses after 14 days without activity (a comment, a pull request or a commit mentioning #5496). <!-- kira:work -->
Author
Owner

@github-actions[bot] commented on GitHub (Oct 31, 2026):

🤖 Claims: refused, someone claimed this issue on Discord (Kira's in progress label): pick another, or ask in the thread. (asked by @mariuslozo-boop)

<!-- gh-comment-id:6549514162 --> @github-actions[bot] commented on GitHub (Oct 31, 2026): 🤖 Claims: refused, someone claimed this issue on Discord (Kira's `in progress` label): pick another, or ask in the thread. (asked by @mariuslozo-boop)
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#1699
No description provided.