Curios API (Forge/NeoForge)

Curios API (Forge/NeoForge)

140M Downloads

Curio Equip/Unequip events

Aizistral opened this issue ยท 0 comments

commented

The Feature

Be nice if we had some CurioEquipEvent, fired whenever player tries to equip a curio in one of their slots, and some CurioUnequipEvent, fired whenever player tries to unequip one of their curios respectively. Events should be fired before capability itself is asked whether or not equipping should be allowed, and have a classical Result taking values of ALLOW, DENY or DEFAULT. Where ALLOW will forcibly permit the curio to be equipped/unequipped, regardless of what capability says; DENY will forcibly forbid that from happening, and DEFAULT will mean that decision rests with capability instance.

The Why

While we already have CurioChangeEvent which allows to detect whenever curios are equipped and unequipped, it doesn't allow us to influence whether or not they should end up being equipped or unequipped in the first place.

My own use-case for this is following: Enigmatic Legacy is largely centered around Ring of the Seven Curses nowadays, which presents almost an entire gamemode of sorts, with some of the items in the mod only accessible to those willing to accept it's challenges. One of the users suggested to make a configurable list of items, where modpack creators could add any curios they would wish to be gated behind RotSC, similarly to how some in EL itself are. Being able to prevent curios from being equipped before they end up equipped would allow to create simple, elegant and foolproof solution for such functionality.