Addons & Addon API
FileMyAddon.javaFileMyListener.javaCommand/is admin featuresCommand/is admin addons reloadAddons are standalone jars dropped in plugins/IgniteSky/addons/. IgniteSky loads each one on startup, hands it a typed API, and disables it on shutdown or reload. Addons only see the API (ignitesky-api), never the internals, so an update to the plugin shouldn't break them.
Running a server and only installing addons? Skip to Installing an addon.
1. Depend on the API
Add ignitesky-api as a compileOnly dependency. It is provided at runtime by IgniteSky.
dependencies {
compileOnly 'com.ignitedev:ignitesky-api:1.1.0'
compileOnly 'io.papermc.paper:paper-api:1.21.7-R0.1-SNAPSHOT'
}2. Write the addon
APIIgniteAddonExtend IgniteAddon. The base class gives you api(), data(), logger() and the full context() (the host plugin for listeners and tasks, your private data folder, and the descriptor).
package com.example.myaddon;
import com.ignitedev.ignitesky.api.addon.IgniteAddon;
import org.bukkit.Bukkit;
public final class MyAddon extends IgniteAddon {
@Override
public void onEnable() {
logger().info("MyAddon starting");
// Persistent, namespaced to this addon, survives restarts:
int runs = Integer.parseInt(data().getOr("runs", "0")) + 1;
data().set("runs", String.valueOf(runs));
// A normal Bukkit listener. Register it through the context, never against getPlugin():
// IgniteSky unregisters it when the addon unloads, so a reload cannot leave it running.
context().registerListener(new MyListener(api()));
}
@Override
public void onDisable() {
logger().info("MyAddon stopping");
}
}APIIgniteSkyAPIA listener uses the public island events and IgniteSkyAPI directly, all typed:
import com.ignitedev.ignitesky.api.IgniteSkyAPI;
import com.ignitedev.ignitesky.api.event.IslandCreateEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
public record MyListener(IgniteSkyAPI api) implements Listener {
@EventHandler
public void onCreate(IslandCreateEvent event) {
// react to a new island via event.getIsland() / the api
}
}Events you can listen to
Config keycom.ignitedev.ignitesky.api.eventEvery event is in com.ignitedev.ignitesky.api.event, extends IslandEvent (so getIsland() is always there), and is a plain Bukkit event.
| Event | When |
|---|---|
| IslandCreateEvent | After a new island is created and registered |
| IslandDeleteEvent | Before an island is deleted. Cancellable: cancelling keeps it |
| IslandDeletedEvent | Once the island is really gone. Purge your own data here, never on the cancellable one |
| IslandResetEvent | After /is reset rebuilt the terrain; the island keeps its identity, members and bank |
| IslandOwnerChangeEvent | After the island changed hands |
| IslandMemberJoinEvent | After a player joined, by invite, trust or an admin |
| IslandMemberLeaveEvent | After a player stopped being a member: left, kicked or removed by staff |
| IslandRoleChangeEvent | After a member's role changed |
| IslandLevelChangeEvent | After the level crossed a whole level on a worth change. Fired async |
| IslandUpgradeEvent | After an upgrade tier changed: bought, granted or reset |
| IslandPrestigeEvent | After the island prestiged |
| IslandMissionCompleteEvent | After a mission completed (the reward is claimed separately) |
| IslandBankChangeEvent | After money moved in or out of the bank. Fired async |
IslandBankChangeEvent and IslandLevelChangeEvent are fired async. The rest are fired on the global region: IslandDeleteEvent before the delete (so a cancel can still stop it), every other one after the change has landed. On Folia, hop to an entity or location scheduler before touching the world.
For drawing minions with your own models, see Extension Points.
The API object
Outside an addon, grab it from Bukkit with Bukkit.getServicesManager().load(IgniteSkyAPI.class). Lookups return a CompletableFuture. They're usually already complete, so the continuation runs on your current thread; don't treat them as a way off a region thread.
| Method | What it does |
|---|---|
| getIslandOf(uuid) | The island a player owns or belongs to |
| getIslandAt(location) | The island at a position |
| getIsland(islandId) | Look up by island id |
| createIsland(owner, mode) | Create one, by IslandModeType or by id ("caveblock"). Fails if the player is at their island cap, already has a create running, or no world could be set up |
| deleteIsland(island) | Delete one. Fails if a listener cancels it, the island lives on another server, or a reset is still running |
| getLoadedIslands() | Every known island. Don't modify the collection |
| registerMode(mode) / getMode(type) / getModes() | Register a mode implementation under its id, replacing the one its file set up; look one up; list them all. Register during enable, before islands load |
| isFeatureEnabled(id) | Whether a feature or core system is switched on, by the id `/is admin features` lists. Unknown ids read as off |
A server can switch any system off, so an addon built on top should ask before it leans on one, e.g. api.isFeatureEnabled("bank"). With a system off nothing throws: the stored values (level, worth, bank balance) still read back, they just stop changing, and that system's events stop firing because nothing causes them.
Island is read-only: id, owner, mode, name, description, center, home, members, level, worth, bank balance, locked and createdAt. Each IslandMember carries an IslandRole (id, display name, weight, permissions) and answers hasPermission(IslandPermission).
Modes
A mode is a modes/<id>.yml file (see Custom Modes), so most new modes need no code. IslandModeType used to be a closed enum; it is now a small class keyed by that id. SKYBLOCK, ONEBLOCK and CHUNKBLOCK are still there, instances are interned so == keeps working, and valueOf, name() and values() stay, so an addon built against the enum compiles as it is. A switch over the mode or an EnumMap keyed by it no longer compiles: use mode.id() or a HashMap.
IslandModeType cave = IslandModeType.of("caveblock");
api.createIsland(player.getUniqueId(), "caveblock");
for (IslandMode mode : api.getModes()) {
getLogger().info(mode.getType().id() + " runs on " + mode.getBase().id());
}getBase() is the engine a mode behaves like: skyblock, oneblock or chunkblock. Chunk locking and OneBlock phases follow it, so check the base, not getMode() == CHUNKBLOCK, or a custom mode on that engine slips past your check. registerMode can take a new id, but the file is still what gives a mode its worlds and its menu tile, and worlds are made at startup: ship modes/<id>.yml with your addon and restart once.
3. Ship addon.yml
Fileaddon.ymlPut addon.yml in the jar root:
name: MyAddon
main: com.example.myaddon.MyAddon
version: 1.0.0
description: Does something useful with islands.name and main are required; a jar without them is skipped. The name becomes a folder and a file name, so it may only use letters, digits, _, . and -. version defaults to 1.0.
Installing an addon
Drop the jar in
Put the addon jar in
plugins/IgniteSky/addons/.Load it
Command/is admin addons reloadStart the server, or run
/is admin addons reloadto load it without a restart. That tears every addon down and loads them again from disk.Confirm it loaded
Command/is admin addonsRun
/is admin addonsto list everything currently loaded, with name, version and description.
| Command | What it does |
|---|---|
| /is admin addons | List loaded addons |
| /is admin addons reload | Disable and reload every addon from disk |
Permissionignitesky.adminCommand/is admin reloadBoth need ignitesky.admin. A plain /is admin reload reloads configs and language, not addons.
What each addon gets
| Resource | Detail |
|---|---|
| Its own classloader | Isolated from other addons |
| A private data folder | addons/<name>/ |
| A persistent key-value store | addons/data/<name>.json |
For the worth and world SPIs (feeding island value from a shop, or hosting worlds in Slime format), see Extension Points.