Old EntityKnockbackByEntityEvent lacks KnockbackCause #10598
Replies: 11 comments
-
This is not the new event but the old one, the cause stuff needs transporting over, basically |
Beta Was this translation helpful? Give feedback.
-
Is the new one added right now? |
Beta Was this translation helpful? Give feedback.
-
The new one spigot added is the deprecated one, forcing people off events we've had for 6 years is generally not a goal here |
Beta Was this translation helpful? Give feedback.
-
I see. However, the new one has causes but is deprecated(forRemoval=true) so that the building of plugin cant work correctly. I tried @SuppressWarnings("deprecation") to use the new one but the building still failed. And the old one doesn't have any cause. Maybe you can remove the "(forRemoval = true)" from the new one or just add some causes to the old one instead. |
Beta Was this translation helpful? Give feedback.
-
Yes, the goal would be to backport the causes to the older event, hence why this is marked as a feature request |
Beta Was this translation helpful? Give feedback.
-
Do you mind if I send a Pull Request to join causes to solve the problem as soon as possible? I really need this feature |
Beta Was this translation helpful? Give feedback.
-
You are more than welcome to submit a PR |
Beta Was this translation helpful? Give feedback.
-
By the way, shield item has two bugs caused by Vanilla and Spigot's code. Both of these bugs I think can be fixed together. But I'm not sure if this kind of change is in accordance with your regulations. |
Beta Was this translation helpful? Give feedback.
-
such a thing should generally be within a seperate PR |
Beta Was this translation helpful? Give feedback.
-
Do I need to remove the previous "cause"? Also I m not sure which way is the best:
|
Beta Was this translation helpful? Give feedback.
-
Completed in #10831 |
Beta Was this translation helpful? Give feedback.
-
Expected behavior
EntityKnockbackByEntityEvent should contain a knock back cause just like what is it be like in Spigot.
Be like:
@ApiStatus.Internal public EntityKnockbackByEntityEvent(@NotNull LivingEntity entity, @NotNull Entity hitBy, float knockbackStrength, @NotNull Vector acceleration, KnockbackCause knockbackCause) { super(entity, hitBy, acceleration); this.knockbackStrength = knockbackStrength; this.knockbackCause = knockbackCause; }
Observed/Actual behavior
@ApiStatus.Internal public EntityKnockbackByEntityEvent(@NotNull LivingEntity entity, @NotNull Entity hitBy, float knockbackStrength, @NotNull Vector acceleration) { super(entity, hitBy, acceleration); this.knockbackStrength = knockbackStrength; }
There isn't any cause here so that I can't get the cause of this event
Steps/models to reproduce
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST) public void onEntityKnockbackByEntity(EntityKnockbackByEntityEvent event) { // if (event.getCause()... ok there isn't any cause :( }
Plugin and Datapack List
This issue isn't based on any plugin or datapack
Paper version
Other
No response
Beta Was this translation helpful? Give feedback.
All reactions