Developer API
AstralDungeons exposes a small surface for other plugins: one Bukkit event, one AstralSync snapshot type, one AstralCore item supplier, and the registered actions and requirements. There is no static DungeonsAPI facade — the services are reached through the plugin instance.
DungeonCompletedEvent
com.astralrealms.dungeons.event.DungeonCompletedEvent — a PlayerEvent, fired on the bridge, on the main thread, once per claimed run. It is the intended hook for changing what a dungeon run pays out.
It fires inside PlayerDataService#claimRewards, after the dungeon key has been consumed and before the reward-actions run, so a listener sees the run's real numbers and can rewrite them before anything acts on them.
Member | Type | Mutable | Description |
|---|---|---|---|
|
| — | The returning player. |
|
| no | The bridge blueprint for the run. |
| int | no | Mobs this player personally killed. |
| long | no | Run length in milliseconds. |
| boolean | no | Whether the boss was defeated while this player was alive. |
| double | yes | The experience payout. The setter is fluent (Lombok |
|
| yes (the list is mutable) | The queued console commands. Add, remove or rewrite entries in place. |
It is not cancellable, and it carries no isCancelled flag — a listener that wants to withhold a payout must zero the experience and clear the command list.
%player_name% in a command is substituted at dispatch time; nothing else is.
After the event, event.toPlayerData() rebuilds a DungeonPlayerData from the (possibly edited) values, and that object is what the reward-actions placeholders, the analytics event and the leaderboard updates all read. Note that toPlayerData() stamps a fresh createdAt, which is unused past this point.
DungeonInventory snapshot
DungeonInventorySnapshotAdapter registers a SnapshotAdapter<DungeonInventory> with AstralSync under the key dungeons:inventory, from both modules. Any plugin on either tier can read a player's gear:
Mutating the returned object is how the bundled actions work, and is how AstralSync picks changes up — there is no explicit save call. getItem/setItem throw IndexOutOfBoundsException outside 0..23; the array returned by content()/equippedContent() is live, not a copy.
See Dungeon Inventory & Presets for the slot layout and the ownership rules that make equippedContent() the array to read.
dungeons.keys item supplier
The bridge registers DungeonKeysStackSupplier under the ItemStackSupplier namespace dungeons.keys, so any AstralCore config that accepts an item can produce a working, PDC-stamped dungeon key (dungeons.keys-<blueprint id>), and any lookup can identify one. See Keys.
Registered actions
All bridge-side. Full descriptions in Dungeon Inventory & Presets.
Id | Arguments |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Registered requirements
Id | Arguments | Passes when |
|---|---|---|
|
| The worn grid holds no other item of the same AstralItems blueprint. |
|
| The named preset's grid holds no other item of the same blueprint. |
See Equip conflicts.
Messaging channels
Both are RPC exchanges on the shared MessagingService, with packets registered by DungeonPacketRegistry (registered by both modules, so the packet types decode on either side).
Constant | Channel | Request → Response |
|---|---|---|
|
|
|
|
|
|
The bridge is the requester on both; the dungeon servers answer dungeons.servers and other bridge/lobby servers answer dungeons.requirements for players they hold. A responder that cannot handle a request (server full, blueprint unknown, player not here) returns null and simply drops out rather than replying with a failure. See Cross-server creation handshake and Checking requirements across servers.
Cache keys
Constant | Redis key | Holds |
|---|---|---|
|
|
|
|
|
|
Unused types
DungeonQueue (common, model/queue) and QueueRepository exist in the source but are not referenced by either module — no queueing is wired up. Entry is immediate or refused; there is no waiting list. Don't build against them.