Skip to main content
The mod kernel’s service registry is priority-ordered. By registering a service with a higher priority than Aether’s built-in implementation, your Native Mod becomes the active implementation for that service ID. Removing your registration automatically restores the next-lower-priority implementation.

API

Call context.registerService() inside onLoad:
AetherModServiceHandler is a fun interface with one suspend method:

Priority rules

Aether core services use a deliberately low priority so that Native Mods can override them with a standard priority value. Use priority 500 to reliably override any built-in service. Removing your registration (by calling the returned cleanup lambda) restores the next-lower-priority implementation, which may be another mod’s registration or Aether’s built-in.

Example — overriding the skills service

The following mod registers itself as the active implementation of the skills service and returns an empty skill list:
MyNativeMod.kt
context.registerService() returns a cleanup lambda. Retain and call it yourself if you need to unregister the service at runtime; the current Native Mod manager does not invoke onUnload.

Built-in services

The following services are registered by Aether core:

skills

Valid scope values: current, default / global, both / current_and_default.

state

You can expose entirely new services from a Native Mod — not just override existing ones. Other extensions discover them via aether.services.list() and invoke them via aether.services.invoke().