Overview
Skript allows addons to register custom syntax elements including conditions, effects, expressions, sections, and events. Each type has specific patterns and methods for registration.Registration Timing
All syntax registration must occur during plugin initialization:/src/main/java/ch/njol/skript/Skript.java:1416-1419
Effect Registration
Effects are executed unconditionally and typically perform actions.Effect Base Class
/src/main/java/ch/njol/skript/lang/Effect.java:21-44
Modern Registration (Recommended)
Legacy Registration (Deprecated)
/src/main/java/ch/njol/skript/Skript.java:1582-1589
Real Example: Broadcast Effect
/src/main/java/ch/njol/skript/effects/EffBroadcast.java:40-110
Condition Registration
Conditions check whether certain criteria are met and return true or false.Condition Base Class
/src/main/java/ch/njol/skript/lang/Condition.java:23-112
Condition Types (Priority)
/src/main/java/ch/njol/skript/lang/Condition.java:30-65
Modern Registration
Legacy Registration
/src/main/java/ch/njol/skript/Skript.java:1562-1570
Real Example: Is Operator Condition
/src/main/java/ch/njol/skript/conditions/CondIsOp.java:14-30
Expression Registration
Expressions return values that can be used in other syntax elements.Modern Registration
Legacy Registration
/src/main/java/ch/njol/skript/Skript.java:1675-1685
Real Example: AI Expression
/src/main/java/ch/njol/skript/expressions/ExprAI.java:19-57
Event Registration
Events define when a trigger should be executed.Modern Registration
Legacy Registration
/src/main/java/ch/njol/skript/Skript.java:1753-1762
Section Registration
Sections are syntax elements that can contain other code blocks./src/main/java/ch/njol/skript/Skript.java:1602-1609
Example Section:
Structure Registration
Structures are top-level syntax elements that define script structure (like functions, commands, options).Registration Methods
/src/main/java/ch/njol/skript/Skript.java:1770-1825
Example Structure:
Priority.LATE- Parsed after other structures- Default priority - Standard parsing order
Priority.EARLY- Parsed before other structures
Pattern Syntax
Best Practices
Use descriptive patterns
Make patterns readable and intuitive for users
Support variations
Use (option1|option2) for common synonyms
Document your syntax
Use @Name, @Description, @Example annotations
Test thoroughly
Write comprehensive tests for all patterns
