Replies: 1 comment 1 reply
-
can't change the return type without breaking ABI |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem?
I need to react differently if entity with
Damageable#damage
was damaged successfully or not. Currently, there's no way to figure it out, as damaging can be cancelled withEntityDamageEvent#setCancelled(true)
with no feedback.Describe the solution you'd like.
Make
Damageable#damage
methods return boolean, withfalse
on a cancelled event.Describe alternatives you've considered.
Calling
EntityDamageEvent
myself (which is unsupported, as events constructors are considered internal) and checking if it was cancelled.I was thinking about checking entity's health before and after, but the final damage might result in 0, which if different from cancellation.
Other
Damageable#heal
might need a similar feature, sinceEntityRegainHealthEvent
is cancellable too.Beta Was this translation helpful? Give feedback.
All reactions