Paper icon indicating copy to clipboard operation
Paper copied to clipboard

Add PlayerShieldDisableEvent

Open Cryptite opened this issue 2 years ago • 1 comments

Called whenever a player's shield is being disabled. The cooldown (default 100 ticks) is also provided to optionally be changed

Cryptite avatar May 01 '23 21:05 Cryptite

As I was looking over the impl for this event, I realized its REALLY close to another event, the PlayerItemCooldownEvent.

Would it be better to make this event a sub-event of that event, adding the extra context for the damager? The cooldown event is called right inside addCooldown, so its not really that big of a refactor I don't think.

Less code best code!

Cryptite avatar May 06 '23 23:05 Cryptite

Rebased this once more. I have dropped the extends for the item cooldown event.

In general, issue with that even being a child of item cooldown event is that plugins listening for the cooldown event itself might cancel a shield disable, leading to the extra "effect" of a disabled shield damage event, (no stopUse item call and no game event) which might not be intended.

lynxplay avatar Dec 28 '23 23:12 lynxplay