Zig: Events¶
Functions¶
subscribe¶
| Zig | |
|---|---|
Calls handler for every event with this id, on the server thread. Server thread only.
- Parameters:
- id :
[]const u8 - priority :
Priority - handler :
comptime fn (*const Event) void
- id :
- Return type:
Error!Listener - Slots:
subscribe_event
Event¶
| Zig | |
|---|---|
One event as a listener receives it; id and snbt are valid during the callback only.
Event.writeBack¶
| Zig | |
|---|---|
Writes keys back into the event, as SNBT of only the keys that change; the host merges them, so two listeners writing different keys keep both.
- Parameters:
- edit :
[]const u8
- edit :
- Return type:
void
Event.cancel¶
| Zig | |
|---|---|
Asks the host to cancel the event. An event that cannot be cancelled ignores it.
- Return type:
void
Listener¶
One subscription, kept to end it.
Listener.unsubscribe¶
| Zig | |
|---|---|
Ends the subscription; calling it twice is harmless. Server thread only.
- Return type:
Error!void - Slots:
unsubscribe_event
Priority¶
Listener order, mirroring ll::event::EventPriority.