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):tis the second argument,pis the third, andcb(when present) is a field ofp, not a top-level field.
Channel List
| Channel | Description | Specification |
|---|---|---|
task | Game tasks (enters the scheduler) | task module specification |
timer | Timers | timer channel |
fs | File system | fs channel |
http | HTTP client / server | http channel |
assets | Reading the plugin's built-in assets | assets channel |
lifecycle | Lifecycle acknowledgement + resource reclamation | lifecycle channel |
log | Logging | log channel |
env | Runtime environment info (static snapshot; no timestamp) | See below |
debug | Debugging / error reporting / Ping | debug channel |
service | Service registration / request / subscribe / publish | service channel |
util | gzip + UTF-8 ↔ byte conversion | util channel |
worker | Virtual plugin (Worker) control / messaging | worker 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 formerdirchannel 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>" }