Closed ks-hl closed 2 years ago
May I know why you want to use PlayerGrappleEvent? This is not an open API though.
You are calling events through the Spigot API, that inherently makes the execution of that event an API. If you don't want people listening to it, why call an event?
I'm trying to make it so players can't use the grappling hook to hover by spam clicking. The 1 second cooldown is too long and no cooldown is too fast.
Let me consider for it. Btw, currently I don't have free time to update the plugin. It will be postpone until 20 May.
The changes has been made in the latest update.
Describe the bug Using the API to try to cancel PlayerGrappleEvent, the plugin will not listen to the cancellation state.
Expected behavior Cancelling PlayerGrappleEvent causes the action to not occur.
To fix this, change line 64 of GadgetGrapplingHook: @EventHandler(priority = EventPriority.HIGHEST) to @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
This will cause the method to never be executed if the event is already cancelled, allowing other plugins to cancel it.