Trigger Custom Actions When Effects Expire
Effect Expiration Events
EventsLib Mod provides cleanup events that fire the moment a potion effect wears off. Dependent mods use these events to trigger special actions—removing temporary buffs, applying debuffs, or resetting custom attributes.
How Expiration Triggers Work
When a potion effect's duration reaches zero, EventsLib automatically notifies all listening mods. This allows them to:
- Remove temporary stat bonuses or penalties
- Play sound effects or particle effects
- Update mob behavior or AI
- Reset custom powers or abilities
- Apply follow-up effects or cooldowns
Using This Feature
You don't configure expiration events directly—dependent mods handle this automatically. Simply apply potion effects as normal, and any mod using EventsLib will detect when they expire. For example, if a mod adds a custom power that lasts as long as Resistance, EventsLib ensures that power cleanly ends when Resistance does, without leaving orphaned effects or performance issues.
This system keeps mod interactions smooth and prevents conflicts between multiple effect-dependent mods.