Skript Style Guide¶
To maintain consistency across the Kaizen Network codebase, please adhere to the following Skript coding standards. These patterns are derived from the existing codebase.
Naming Conventions¶
Variables¶
- Persistent Player Data:
{playerdata::%uuid%::key}- Example:
{playerdata::%player's uuid%::honor}
- Example:
- System Configuration:
{system::module::key}- Example:
{system::planet::tier1::hoe::*}
- Example:
- Temporary/Cache:
{-temp::module::key}or{temp::module::key}- Example:
{-temp::planetloop::%player%}
- Example:
- Global Economy:
{economy::%type%::...}
Functions¶
Use camelCase for function names.
Options¶
Use options at the top of the file for configuration (Prefixes, Colors, Constants).
Item Identification¶
Do not rely on display names or lore for item identification. Use NBT tags.
Standard Pattern¶
- Tag:
custom;idor specialized tags likecustom;hcp(Energy Producer). - Checking:
Performance Tips¶
- Async Sections: Use
create new section stored in {_async}for heavy calculations (database, large loops) where possible (requires Skript-Reflect/Addon support). - Looping: Avoid looping
all players. Use specific lists if possible. - Cooldowns: Use metadata tags or temporary variables for short cooldowns.
File Structure¶
- Options: Configuration.
- Variables/Load:
on script loadhandlers. - Commands: User-facing commands.
- Functions: Helper logic.
- Events: Game listeners.