Skip to content

KubeJS events

KilaBash edited this page Nov 2, 2024 · 6 revisions

Events

All events can be found here:

Registry Events

W.I.P

Machine Events

Check MBDServerEvents and MBDClientEvents for all available machien events.

Because events will be posted to the Forge Event Handler as well. We wrap it with a KubeJS Event. So the actually event instance are shown here. Please check it for detials of fields and methods.

This is an example of using it.

MBDMachineEvents.onOpenUI("mbd2:machine_id", e => {
    let event = e.event; // NOTE! you have to use it to get the actual event instance.
    let machine = event.machine;
    let machienID = machine.getDefinition().id();
    console.log("Open UI!! id: " + machienID)
})
Clone this wiki locally