Overview
Skript provides a comprehensive addon API that allows developers to extend Skript’s functionality by creating custom syntax elements, registering new types, and integrating with external plugins.Registering an Addon
To create a Skript addon, you first need to register your plugin with Skript. This provides access to the addon API and syntax registration methods.Modern API (Recommended)
Legacy API (Deprecated)
The legacy API is still supported but marked for removal:/src/main/java/ch/njol/skript/SkriptAddon.java:36-38
Loading Classes
TheSkriptAddon class provides utilities to load syntax element classes from your addon’s jar file.
/src/main/java/ch/njol/skript/SkriptAddon.java:75-78
Example Usage
Language Files
Addons can provide their own language files for localization:/src/main/java/ch/njol/skript/SkriptAddon.java:87-90
Example
your-addon.jar/lang/(bundled with the plugin)plugins/YourAddon/lang/(user-customizable)
Addon Registry System
The modern addon API provides a registry system for storing and retrieving addon-specific data:/src/main/java/ch/njol/skript/SkriptAddon.java:133-150
Accessing the Syntax Registry
Every addon has access to aSyntaxRegistry for registering syntax elements:
/src/main/java/ch/njol/skript/SkriptAddon.java:158-160
Version Information
The addon API automatically parses version information from your plugin.yml:/src/main/java/ch/njol/skript/SkriptAddon.java:36-55
Best Practices
Depend on Skript in plugin.yml
Depend on Skript in plugin.yml
Add Skript as a dependency to ensure proper load order:Or use soft-depend if your plugin can work without Skript:
Register during plugin initialization
Register during plugin initialization
Always register your addon in
onEnable() or onLoad(). Registration after Skript has finished loading will throw a SkriptAPIException.Use the modern API
Use the modern API
The modern API (
org.skriptlang.skript.*) is preferred over the deprecated legacy API (ch.njol.skript.*).Complete Example
Next Steps
Syntax Registration
Learn how to register custom conditions, effects, and expressions
Custom Events
Create custom Skript events for your addon
