Script

Since v1.2.0

Script is an advanced feature and not recommend for most users

Allow making operations to server with JavaScript

Configurations

advanced/config.yml

scripts: false

advanced/scripts.yml

# Fill with filenames in "script" folder
# DO NOT LOAD FILES IN "std" FOLDER AS SCRIPTS
enables:
  - example.js

# Script permissions
permissions:
  # Allow scripts using HTTP, may leak your IP address or more information
  allow-http: false

  # Allow scripts using java reflection to access all classes loaded in current server, may break permission rules
  allow-reflect: false
  # Allow scripts reference Bukkit classes with reflection, not works if allow-reflect enabled
  allow-bukkit-reflect: true
  # Allow scripts reference NMS classes with reflection, not works if allow-reflect enabled
  allow-nms-reflect: false

  # Allow scripts use eval to load libraries or execute other scripts, it is recommended to place the libraries in the lib directory
  allow-eval: false

Installation

Put scripts into advanced/scripts folder

Put libraries into advanced/scripts/lib folder, JS files in this folder will be loaded automatically in each script context

API

When script feature enabled, an example script file will be saved in advanced/scripts/example.js

See ScriptAPI

Last updated