Script callback
saturn:js
Calls a callback registered by KubeJS and passes the params argument.
A trigger matches published server signals. It can be used in trigger rules or triggered abilities; registration itself does not perform any action. See the trigger lifecycle.
JSON fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
type | Resource ID | yes | — | saturn:js |
signal | Resource ID | yes | — | ID of the signal the script trigger subscribes to. |
id | String | yes | — | Identifier of the callback, option or entry. |
params | Object | no | {} | Parameter object passed to the script or formula. |
Registered only when KubeJS is installed. The JSON only selects an existing callback; it never executes JavaScript strings from the JSON directly.
JSON example
{
"type": "saturn:js",
"signal": "saturn:tick",
"id": "example_callback",
"params": {}
}
This is a value to embed in the corresponding field, not a standalone loadable data pack file. The example: references in the examples must be replaced with defined entries.
Java entry point
com.iafenvoy.saturn.data.trigger.builtin.JsTrigger. This page is based on the Codec in the current 26.1.2 source.