API
Callcontext.registerService() inside onLoad:
AetherModServiceHandler is a fun interface with one suspend method:
| Parameter | Description |
|---|---|
id | The service identifier (e.g. "skills", "state", or a custom string). |
description | Optional human-readable description of the service (defaults to ""). |
priority | Higher value wins. Aether core services use a deliberately low priority. Defaults to 100. |
methods | The list of AetherModServiceMethod instances describing the methods this implementation handles. |
handler | AetherModServiceHandler invoked with the method name and a JSONObject of arguments; returns a JSONObject result. |
Priority rules
Aether core services use a deliberately low priority so that Native Mods can override them with a standard priority value. Use priority500 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 theskills service and returns an empty skill list:
MyNativeMod.kt
context.registerService() returns a cleanup lambda. Call it to unregister the service before the mod is unloaded, or let onUnload handle it automatically.
Built-in services
The following services are registered by Aether core:skills
| Method | Arguments |
|---|---|
list | — |
getSelection | — |
setSelection | ids, scope, session_id? |
setSelected | skill_id, selected, scope, session_id? |
scope values: current, default / global, both / current_and_default.
state
| Method | Arguments |
|---|---|
get | path |
transaction | operations |