EntityKnockbackByEntityEvent called with wrong entities
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 12.7k
- Forks
- 3.5k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 11
Description
Expected behavior
The EntityKnockbackByEntityEvent#hitBy() entity should be called with the entity that did the knockback
Observed/Actual behavior
Instead, if the entity that did the knockback is a projectile or a TNT, the #hitBy entity is a player (shooter of the projectile or the one that lit the TNT) instead of the entity that actually did the knockback
Steps/models to reproduce
Example 1:
- Throw a snowball
- EntityKnockbackByEntityEvent will be called with #hitBy set to the shooter of the snowball instead of the actual snowball entity
Example 2:
- Get a TNT and flint and steel
- Prime the TNT
- EntityKnockbackByEntityEvent will be called with #hitBy set to the player that primed the TNT instead of the TNT entity
Example 3:
- /summon tnt
- EntityKnockbackByEntityEvent will not be called because there was no entity that primed the TNT
Plugin and Datapack List
Only a plugin that was printing the #hitBy entity into the console. No datapacks.
Paper version
This server is running Paper version git-Paper-85 (MC: 1.18.1) (Implementing API version 1.18.1-R0.1-SNAPSHOT) (Git: df8d28a)
You are running the latest version
Other
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing where EntityKnockbackByEntityEvent is created and where hitBy() is assigned for projectile and TNT knockback. Reproduce the snowball and primed-TNT cases, including summoned TNT, then verify that hitBy() is the projectile or TNT entity and that the event is emitted consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100