Core API Overview
The core API gives each registered mod an owner-scoped IModContext. It provides:
- IModLogger for structured logging;
- IModEvents for game-data lifecycle events;
- IItemService for read-only native item lookup and value registrations;
- ICustomItemService for custom definitions and activation;
- ICustomAbilityService for custom abilities;
- ILocalizationService for owner-scoped English text.
Runtime evidence covers initialization, versions, main-thread identity, diagnostics, registration, dependency metadata, ownership isolation, GameDataReady delivery, generation changes, and cleanup.
Core rules
- Register one stable mod owner.
- Use that owner's namespace for every custom ID.
- Subscribe during
Awake; events are not replayed. - Call runtime services on Unity's main thread.
- Keep activation and subscription handles for deterministic cleanup.
- Remove dependent items before the abilities they reference.
See Registration & Ownership, Lifecycle & Events, and Logging & Diagnostics.