Skip to content

Message Channel Specification ​

Overview ​

In addition to the task channel (which goes through the scheduler), Yeow also provides other non-scheduler channels. They are handled directly by the plugin thread and are not limited by scheduler time slices.

All channels use the same $send(channel, t, p) entry point, where t is the operation/type (nullable) and p is the params object (nullable).

The per-channel pages below show { "t": ..., "p": ... } as the logical shape of a request. On the wire the call is $send(channel, t, p): t is the second argument, p is the third, and cb (when present) is a field of p, not a top-level field.


Channel List ​

ChannelDescriptionSpecification
taskGame tasks (enters the scheduler)task module specification
timerTimerstimer channel
fsFile systemfs channel
httpHTTP client / serverhttp channel
assetsReading the plugin's built-in assetsassets channel
lifecycleLifecycle acknowledgement + resource reclamationlifecycle channel
logLogginglog channel
envRuntime environment info (static snapshot; no timestamp)See below
debugDebugging / error reporting / Pingdebug channel
serviceService registration / request / subscribe / publishservice channel
utilgzip + UTF-8 ↔ byte conversionutil channel
workerVirtual plugin (Worker) control / messagingworker channel

Common Channels ​

env ​

  • Request: any string (synchronous)
  • Return: object — environment info JSON:
json
{
  "cpus": 16,
  "memory": 17179869184,
  "arch": "windows-x64",
  "minecraftVersion": "1.21.4",
  "yeow": { "platform": "paper", "version": "0.8.0" },
  "pluginDir": "plugins/my-plugin"
}
  • cpus: number of CPU logical cores; memory: JVM total memory (bytes)
  • arch: system architecture (<os>-<arch>, e.g. windows-x64)
  • minecraftVersion: Minecraft version; yeow: runtime info (platform/version)
  • pluginDir: plugin data directory path (e.g. plugins/<pluginName>; the former dir channel has been merged in; in a Worker it is the main plugin directory)

Common Error Format ​

When a channel fails to execute, it returns:

json
{ "err": "<error message>" }