|Getting The Script Engine|
on(EventIdentifier)This is used to get events from the UI Engine. These events can be originally sent from client scripts using `send_ui_event`, or created by the game and passed along by the UI Engine. The data sent from scripts to this function must be a string.
|EventIdentifier||String||Specifies the event that function will react to|
Getting The Script EngineIn order to create a link between the UI Engine and the Script Engine you need to capture the instance of the Script Engine.The engine.on() function needs to listen for the event "scriptEngine:created" and you need to store the return value.
triggerEvent(Data)This triggers the minecraft:ui_event on client scripts with the provided data.
|Data||String||This string will be sent to "minecraft:ui_event" event in client scripts|