Skip to content

guest ​

INFO

Анықтаманың өзі ағылшын тілінде: ол WIT файлдарынан автоматты түрде жасалады.

Callbacks every mod exports. The host calls them on the main thread; a trap or a run over the time budget (5 ms soft, 25 ms hard per call) counts against the mod, and three hard traps within 60 s disable it.

Package blockheads:api@0.3.1 · Lua table bh.guest · WIT source

Uses: types.{value}, events.{subscription, event, outcome, command-sender}, commands.{command-id, command-outcome}, scheduler.{task-id}, channels.{channel-id, source}

Functions ​

on-enable function ​

txt
on-enable: func() -> result<_, string>;

Called once when the mod is enabled (on the server: when the world has loaded). Subscribe to events and register commands here. An error disables the mod and is logged.

on-disable function ​

txt
on-disable: func();

Called once when the mod is disabled (server stop, reload). Flush state here.

handle-event function ​

txt
handle-event: func(sub: subscription, ev: event) -> outcome;

Called for every event matching one of the mod's subscriptions.

run-command function ​

txt
run-command: func(id: command-id, sender: command-sender, label: string, args: list<string>) -> command-outcome;

Called when one of the mod's commands is used. label is the name or alias that was typed.

run-task function ​

txt
run-task: func(id: task-id);

Called when a scheduled task is due.

call-service function ​

txt
call-service: func(name: string, method: string, args: value) -> result<value, string>;

Called when another mod calls a service this mod provides. args and the result are canonical CBOR.

on-channel-message function ​

txt
on-channel-message: func(channel: channel-id, origin: source, data: list<u8>);

Called when a message arrives on a channel this mod opened.

Ресми емес қауымдастық жобасы. Majic Jungle Software немесе Noodlecake компанияларымен байланысы жоқ. Ойын файлдары қамтылмаған.