Tessera
object Tessera
The primary scripting entry point. Register triggers with an Event and an arrow-function callback that takes a single argument (the event's primary value):
import { Tessera, Event, ChatLib, Player } from 'ratph6.tessera.api';
Tessera.register(Event.CHAT, (message) => {
ChatLib.chat("pong!");
// Tessera.cancelEvent(); // hide the original message
}).setContains().setCriteria("ping");
Tessera.register(Event.COMMAND, (args) => {
ChatLib.chat("XYZ: " + Player.getX());
}).setName("coords");Content copied to clipboard
Callbacks receive the event's primary value (e.g. the chat message, the tick count, the command's argument array). To cancel a cancellable event, call cancelEvent from inside the callback.
Functions
Link copied to clipboard
Cancel the cancellable event currently being dispatched (call from inside a callback).
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Run callback every ticks client ticks. Returns an id for clearTimer.
Link copied to clipboard
Run callback once after ticks client ticks (20 ticks ≈ 1s). Returns an id for clearTimer.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard