PolyglotScript

class PolyglotScript(val language: String, val file: File, val debugOptions: ScriptDebugOptions = ScriptDebugOptions()) : AutoCloseable

Constructors

Link copied to clipboard
constructor(language: String, file: File, debugOptions: ScriptDebugOptions = ScriptDebugOptions())

Properties

Link copied to clipboard
Link copied to clipboard
val file: File
Link copied to clipboard
Link copied to clipboard
lateinit var scriptAuthors: Array<String>
Link copied to clipboard
lateinit var scriptName: String
Link copied to clipboard
lateinit var scriptVersion: String

Functions

Link copied to clipboard
open override fun close()

Called when the client unloads the script.

Link copied to clipboard
fun disable()

Called when the client disables the script. Handles unregistering all modules and commands created with this script.

Link copied to clipboard
fun enable()

Called when the client enables the script.

Link copied to clipboard

Initialization of scripts

Link copied to clipboard
fun on(eventName: String, handler: Runnable)

Called from inside the script to register a new event handler.

Link copied to clipboard
fun registerChoice(modeValueGroup: ModeValueGroup<Mode>, modeObject: Map<String, Any>, callback: Consumer<Mode>)

Registers a new script choice to an existing choice configurable which can be obtained from existing modules.

Link copied to clipboard
fun registerCommand(commandObject: Value)

Registers a new script command

Link copied to clipboard
fun registerMode(modeValueGroup: ModeValueGroup<Mode>, modeObject: Map<String, Any>, callback: Consumer<Mode>)

Registers a new script mode to an existing mode value group which can be obtained from existing modules.

Link copied to clipboard
fun registerModule(moduleObject: Map<String, Any>, callback: Consumer<ClientModule>)

Registers a new script module