GC-spigot / AdvancedEnchantments

Superior Custom Enchantments Creator for Minecraft And Spigot platform
153 stars 63 forks source link

SHIELD_BLOCK, DEFENSE, DEFENSE_MOB_PROJECTILE, RIGHT_CLICK sometimes not working at all. Sometimes working fine #4478

Open zylstra1313 opened 1 month ago

zylstra1313 commented 1 month ago

Describe the bug

If an attack that would apply an enchant is canceled by "CANCEL_EVENT" the enchants still apply.

How to reproduce

To reproduce apply this enchant to a shield, testing: display: "&fTest with a shield" description: "Test enchant for shields." applies-to: "Shields" type: "SHIELD_BLOCK" group: "Test" applies:

then give a zombie a sword with

testing2: display: "&fTest with a sword" description: "Test enchant for swords." applies-to: "Swords" type: "ATTACK" group: "Test" applies:

Let the zombie hit you while blocking

Screenshots / Videos

https://www.youtube.com/watch?v=gXXqv8lJAOU

"/ae plinfo" link

https://paste.md-5.net/zowelonepu

Server Log

No response

ThomasWega commented 1 month ago

Does this only not work for SHIELD_BLOCK or also other triggers?

zylstra1313 commented 1 month ago

For some reason if you change this enchantment to:

display: "&fTest with a shield" description: "Test enchant for shields." applies-to: "Shields" type: "DEFENSE_MOB" group: "ELITE" applies:

"CANCEL_EVENT" stops working entirely it also doesn't work with "DEFENSE" or "DEFENSE_MOB_PROJECTILE".

However, if you switch it to DEFENSE_PROJECTILE then "CANCEL_EVENT" not only works but it cancels on hit enchantments like you would expect.

ThomasWega commented 1 month ago

I see, shield block is broken sometimes, will handle more of that here. https://github.com/GC-spigot/AdvancedEnchantments/issues/4366.

However I am able to confirm that the DEFENSE_MOB_PROJECTILE seems to not work sometimes. Doing more testing and will let you know

ThomasWega commented 1 month ago

I see what is happening now. DEFENSE_MOB_PROJECTILE, DEFENSE and SHIELD_BLOCK sometimes just don't work. I will all handle that it here then. Closing the previously linked issue