Addon Runtime
Understand how SIR+ loads addon jars, reads `addon.yml`, persists addon state, and wires addon commands.
What the addon runtime actually is
SIR+ adds a dedicated addon loader on top of the normal module and provider system. Instead of patching the base plugin, you can drop jars into the addon runtime and let SIR+ manage them.
At a high level, the loader:
- scans addon jars
- looks for
addon.yml - loads the main class
- verifies dependency conditions
- initializes the addon
- registers addon commands if the addon is also a
CommandProvider - persists enabled or disabled addon state
Runtime layout
The addon runtime lives under plugins/SIR-Plus/addons/:
plugins/SIR-Plus/
addons/
states.yml
my-addon.jar
another-addon.jarWhat each piece is for
| Path | Purpose |
|---|---|
addons/*.jar | Your addon artifacts |
addons/states.yml | Persisted enabled or disabled addon state |
addon.yml inside the jar | Addon descriptor required by the loader |
commands.yml inside the jar | Optional command-provider descriptor when the addon exposes commands |
addon.yml requirements
The loader expects an addon.yml file at the jar root. If it is missing, SIR+ skips the jar.
Typical descriptor:
main: com.example.siraddons.ExampleAddon
name: example-addon
title: Example Addon
description:
- Adds custom logic on top of SIR+.
depend: []
soft-depend: []Descriptor fields
| Field | Required | Meaning |
|---|---|---|
main | Yes | Fully qualified class name for the addon entrypoint |
name | No but recommended | Runtime key used for display and state lookup |
title | No but recommended | Friendly UI title |
description | No | Multi-line description shown in addon-facing UI or metadata |
depend | No | Hard dependency on other addons |
soft-depend | No | Soft dependency on other addons |
Addon dependencies here are addon-to-addon dependencies, not Bukkit plugin dependencies.
Loader behavior and dependencies
SIR+ enforces several checks while loading:
Addon hard and soft dependencies
dependmust already be present as another addon, or loading is rejectedsoft-dependis optional and only affects ordering or optional behavior
Bukkit plugin dependencies
If your addon implements PluginDependant, SIR+ also evaluates plugin dependencies such as PlaceholderAPI, Vault, or anything else your addon names.
If the dependency is missing, the loader can defer the addon until the dependency becomes available instead of failing permanently.
Main class contract
The main class must extend SIRAddon. If it does not, SIR+ refuses to load the jar.
Addon lifecycle
Your addon normally extends SIRAddon and implements:
register()unregister()
The common lifecycle expectation is:
- use
register()to create files, register listeners, schedule tasks, and hook placeholder expansions - use
unregister()to undo those registrations and release resources
Because SIRAddon extends the shared extension model, you also get helper behavior such as:
getDataFolder()getLogger()getResource(path)saveResource(path, replace)
Addon commands
If the addon also implements CommandProvider, SIR+ will ask the command manager to load commands from the addon after the addon registers successfully.
That means an addon can contribute:
- one or more
SIRCommandimplementations - a
commands.ymldescriptor at the jar root - provider metadata understood by the same command system used by the stock built-in providers
This is what makes addon commands feel native instead of bolted on.
Bundled addon jars
SIR+ can also inspect bundled addon jars packaged inside the plugin resources under addons/.
In practice this means the runtime can:
- discover bundled addon jars
- copy them into the data folder when saving defaults
- or temp-load them directly when needed
That design keeps the addon system flexible for both stock distribution and custom server deployments.
Managing addons in production
The operational controls are:
| Action | Command |
|---|---|
| Open addon GUI | /sir addons |
| Enable addon | /sir addons [addon] enable |
| Disable addon | /sir addons [addon] disable |
| Toggle addon | /sir addons [addon] toggle |
The result is persisted to addons/states.yml, so the enabled state survives restarts.
Troubleshooting checklist
If an addon jar is ignored or fails to work, check these first:
addon.ymlexists at the jar root- the
mainclass extendsSIRAddon - hard addon dependencies listed in
dependare present - plugin dependencies declared through
PluginDependantare available - the addon is enabled in
addons/states.yml - if it exposes commands,
commands.ymlexists and the addon implementsCommandProvider
If you are writing the addon itself, continue with Addons API.
Commands & Permissions
Reference for SIR+ command aliases, admin controls, provider override state, and addon permissions.
Addons API
Download the SIR+ API, wire it into your project, and use it to create real addon jars for the SIR+ runtime.
Last updated on