Curios API (Fabric)

Curios API (Fabric)

819k Downloads

[Bug]: CurioEvents

2929762171 opened this issue ยท 4 comments

commented

Minecraft Version

1.19.2

What happened?

Using kubeJS.
CurioDropsEvent when gamerule keepInventory=false, cancelling event will 'eat' all equipped curios.
CurioUnequipEvent will fire 3 times, like this:
image
I need line 39~41 to make sure to skip the first time check, and set it 'allow' so it can run into the second time check. Skipping the third fire seems no problem.

How do you trigger this bug?

...

Loader

Forge

Loader Version

forge 43.3.7

Mod Version

curios-forge-1.19.2-5.1.6.3

Relevant Log Outputs

No response

commented

plus, the 3rd CurioUnequipEvent will fire CurioEquipEvent, same itemStack.

commented

CurioDropsEvent when gamerule keepInventory=false, cancelling event will 'eat' all equipped curios.

This is intended, as it works the same as the more global LivingDropsEvent. It prevents the drop behavior, not the fact that the items are removed (which is controlled by the keepInventory gamerule itself).

CurioUnequipEvent will fire 3 times, like this:

Could you clarify the nature of the bug you're reporting? Is it just the fact that the event is firing 3 times? Does your script, as you've written it, work as you intend or is it not working correctly due to a potential bug?

commented

return before client check, fire many times:
image
image
https://github.com/user-attachments/assets/000afede-5250-4dfb-83ac-a547f430ccf3
after client check, event fire 3 times:
image
https://github.com/user-attachments/assets/1f03f12f-1df2-41e7-aec6-2555f037b38d
if I try to do something, like change player's xp, it will also change 3 times:
image
https://github.com/user-attachments/assets/3cda9f55-4a33-4e92-afe3-9af4258cd320

CurioDropsEvent when gamerule keepInventory=false, cancelling event will 'eat' all equipped curios.

This is intended, as it works the same as the more global LivingDropsEvent. It prevents the drop behavior, not the fact that the items are removed (which is controlled by the keepInventory gamerule itself).

CurioUnequipEvent will fire 3 times, like this:

Could you clarify the nature of the bug you're reporting? Is it just the fact that the event is firing 3 times? Does your script, as you've written it, work as you intend or is it not working correctly due to a potential bug?

commented

At this situation, if I want to cost some xpLevel to unequip binding curse item from slot, I need to setResult('allow') in the first and second time, the second time is necessary.