Code Conventions
Separate complex Skript expressions from skript-reflect calls
Combining Skript expressions with skript-reflect calls may make your code difficult to read. Use variables to separate these different types of calls.
Keep the target of a skript-reflect call grouped
When calling a method or accessing a field, avoid using spaces when possible.
If the expression is simple (i.e. does not contain other expressions) but requires a space, surround the expression in parentheses.
If the target of the expression is not simple (i.e. contains other expressions), extract the expression into a local variable. (rule)
Variables are the exception to this rule and may contain spaces and/or other expressions
Avoid aliasing classes for aesthetic purposes
The purpose of import aliases is to avoid conflicts with other imports and expressions. Do not alias imports in order to make them look like Skript events.
Avoid unnecessary uses of Java reflection
Especially when copying Java code and translating it for skript-reflect, you may run into instances where you need to use reflection to access a private method, field, or constructor. In skript-reflect, private members are visible and accessible by default.
Last updated