Skip to content
Lorenzo Rossi edited this page Feb 28, 2018 · 1 revision

Basic script support is also provided (altough rarely used). The Script API supports both compilable and non-compilable script engines.

Engines

The default engines are the one present in the JVM Classpath, if you want to add one you can put it's JAR in the engines directory in the uppercore data directory (create the folder if it doesn't exist).
If you want to change the association between file extensions and engines you can do it by changing the script_engine file, by defaul it picks the default engine configured in the JVM.

Run scripts

Object result = script.run();

You can pass it a ScriptContext or a Bindings (creable with script.createBindings()) to provide more context.

Script - Java integration

This really depends on what engine you are using and you should refer to the engine's documentation. If your engine supports java integration then the scripts should have a Bukkit instance pointing to the bukkit server instance.