Event

object Event

The catalogue of events you can register a trigger for, in the spirit of ChatTriggers' TriggerType. Pass one to Jim.register:

import { Jim, Event, ChatLib } from 'ratph6.jim.api';
Jim.register(Event.CHAT, (message, event) => ChatLib.chat("pong!"));

Implemented as string constants (not a JVM enum) — Event.CHAT is the string "chat". This is deliberate: the swc4j bytecode compiler miscompiles passing an enum constant alongside a lambda argument, whereas string constants compile cleanly. The script-facing syntax is identical.

What your callback receives

Jim.register(Event.X, (...args) => { }) — the arguments per event:

EventCallback argumentsNotes
CHAT(message: string)the chat line; supports setCriteria/setContains
COMMAND(args: string[])words after the command; name via .setName("x")
MESSAGE_SENT(message: string)outgoing chat — cancel to block it
ACTION_BAR(text: string)overlay message — cancel to hide
TICK / GAME_TICK(tick: number)client tick count
STEP(dt: number)seconds since last step; rate via .setFps()/.setDelay()
GAME_LOAD()client finished starting
WORLD_LOAD / WORLD_UNLOAD()joined / left a world
SERVER_CONNECT(ip: string, port: number)
SERVER_DISCONNECT(reason: string)
RENDER_OVERLAY()draw the HUD via the Renderer API
RENDER_ENTITY / POST_RENDER_ENTITY(entity: EntityWrapper)getName()/getX()/isPlayer()/…
ENTITY_DEATH(entity: EntityWrapper)
BLOCK_BREAK(block: BlockWrapper)getX()/getType()/isAir() — cancel to veto
SOUND_PLAY(name: string)sound id, e.g. minecraft:block.note_block.harp
SPAWN_PARTICLE(name: string, x: number, y: number, z: number)
GUI_OPENED / GUI_CLOSED / GUI_DRAW_BACKGROUND(screenClassName: string)
INVENTORY_OPEN / INVENTORY_CLOSE(screenClassName: string)
GUI_KEY(keyEvent)net.minecraft KeyEvent
GUI_MOUSE_CLICK(mouseEvent)net.minecraft MouseButtonEvent
PACKET_RECEIVED / PACKET_SENT(packet, name: string)raw net.minecraft Packet + class name; observe-only

Custom bus: Jim.on("myEvent", (payload) => {}) receives whatever Jim.emit("myEvent", payload) sent.

Events not listed above have no source hook in this build — registering them is accepted but logs a warning and the callback never fires (global key/mouse and per-element HUD renders aren't hookable on this Minecraft version; the rest are added incrementally).

Properties

Link copied to clipboard
const val ACTION_BAR: String
Link copied to clipboard
const val BLOCK_BREAK: String
Link copied to clipboard
Link copied to clipboard
const val CHAT: String
Link copied to clipboard
const val CLICKED: String
Link copied to clipboard
const val COMMAND: String
Link copied to clipboard
const val DRAGGED: String
Link copied to clipboard
const val DROP_ITEM: String
Link copied to clipboard
Link copied to clipboard
const val ENTITY_DEATH: String
Link copied to clipboard
const val GAME_LOAD: String
Link copied to clipboard
const val GAME_UNLOAD: String
Link copied to clipboard
const val GUI_CLOSED: String
Link copied to clipboard
Link copied to clipboard
const val GUI_KEY: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
const val GUI_OPENED: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
const val KEY_DOWN: String
Link copied to clipboard
const val KEY_UP: String
Link copied to clipboard
const val MESSAGE_SENT: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
const val PACKET_SENT: String
Link copied to clipboard
const val PICKUP_ITEM: String
Link copied to clipboard
const val PLAYER_JOIN: String
Link copied to clipboard
const val PLAYER_LEAVE: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
const val RENDER_AIR: String
Link copied to clipboard
const val RENDER_ARMOR: String
Link copied to clipboard
Link copied to clipboard
const val RENDER_CHAT: String
Link copied to clipboard
Link copied to clipboard
const val RENDER_DEBUG: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
const val RENDER_FOOD: String
Link copied to clipboard
const val RENDER_HAND: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
const val RENDER_TITLE: String
Link copied to clipboard
const val RENDER_WORLD: String
Link copied to clipboard
const val SCROLLED: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
const val SLOT_CLICK: String
Link copied to clipboard
const val SOUND_PLAY: String
Link copied to clipboard
Link copied to clipboard
const val STEP: String
Link copied to clipboard
const val TICK: String
Link copied to clipboard
const val WORLD_LOAD: String
Link copied to clipboard
const val WORLD_UNLOAD: String