Use Custom Game Events in Your Scripts
Accessing KubeLoader Events
KubeLoader adds extra game events beyond standard KubeJS, giving your scripts deeper control over game mechanics. These events trigger at specific moments during gameplay, allowing you to hook into actions that normal KubeJS events don't cover.
Implementing Events in Your Scripts
In your KubeJS script files, listen for KubeLoader-specific events using the standard event listener syntax. These events let you respond to pack loading, game initialization, and other mod-specific actions. Check the event name and parameters carefully to ensure your script responds correctly.
Combining Events for Complex Behavior
Stack multiple KubeLoader events together with standard KubeJS events to create sophisticated custom mechanics. For example, use a pack-load event to initialize data, then respond to player actions with standard game events. This layered approach lets you build complex systems while keeping your code organized across multiple packs.