Skript
The Skript interface provides the core functionality for registering addons.
Accessing the Skript instance
Section titled “Accessing the Skript instance”Currently, the active Skript instance is accessible through a static getter on the Skript JavaPlugin class:
import org.skriptlang.skript.Skript;public class MyAddon { @Override public static void main(String[] args) { Skript skript = ch.njol.skript.Skript.instance(); }}Creating a new Skript instance
Section titled “Creating a new Skript instance”A static method (of) is available on the Skript interface for creating a new Skript instance using the default API implementation.
The method takes two things:
- The main class (source) of the program creating the Skript.
- A name for the Skript
import org.skriptlang.skript.Skript;public class MyApp { @Override public static void main(String[] args) { Skript skript = Skript.of(MyApp.class, "MyApp Skript"); }}