Mod Lifecycle
Mods may define lifecycle hooks in their entry script.
Supported Hooks
Section titled “Supported Hooks”function onEnable() {}function onDisable() {}function onReload() {}Hook Behavior
Section titled “Hook Behavior”- Hooks are invoked only if defined
- Execution is isolated per mod
- Errors do not affect other mods
onEnable
Section titled “onEnable”Called when the mod is loaded.
onDisable
Section titled “onDisable”Called when the mod is unloaded.
onReload
Section titled “onReload”Called when the mod is reloaded.