Register Port
Register Ports with KubeJS Startup Scripts
Startup Script
To register ports in KubeJS, you can call MMEvents.registerPorts
.
NOTE: all functions will map to the fields of the Port Json
The create
function takes a string parameter which maps directly to the ports "id"
field and returns a builder to set the rest of the fields for the port.
The name
function takes a string parameter which maps directory to ports "name"
field.
The controllerId
function takes a string parameter which gets added to the ports "controllerIds"
field. This function can be called multiple times with different parameter values to allow multiple controllers ids to be set.
The config
function takes 2 parameters. First of which is a string which maps directly to the ports "type"
field. The second parameter is an arrow function (consumer) to build the values inside of the type specific "config"
object field.
All functions for the config
function's arrow function consumer, map directly to the port's "config"
object field values.
See more on the config
object's fields HERE
Last updated