Jim
object Jim
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 { Jim, Event, ChatLib, Player } from 'ratph6.jim.api';
Jim.register(Event.CHAT, (message) => {
ChatLib.chat("pong!");
// Jim.cancelEvent(); // hide the original message
}).setContains().setCriteria("ping");
Jim.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.