Skip to content

Skript

The Skript interface provides the core functionality for registering addons.

Currently, the active Skript instance is accessible through a static getter on the Skript JavaPlugin class:

MyAddon.java
import org.skriptlang.skript.Skript;
public class MyAddon {
@Override
public static void main(String[] args) {
Skript skript = ch.njol.skript.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
MyApp.java
import org.skriptlang.skript.Skript;
public class MyApp {
@Override
public static void main(String[] args) {
Skript skript = Skript.of(MyApp.class, "MyApp Skript");
}
}