Skip to content

API Reference

KS Dungeons provides a small public API for other mods.

if (DungeonsAPI.isAvailable()) {
DungeonsAPI api = DungeonsAPI.getInstance();
// KS Dungeons is loaded and ready
}

Mods that should also run without KS Dungeons can check for the class first:

try {
Class.forName("com.kyuubisoft.dungeons.api.DungeonsAPI");
// KS Dungeons is installed
} catch (ClassNotFoundException e) {
// KS Dungeons not installed
}
MethodReturnsDescription
isInDungeon(UUID playerUuid)booleanWhether the player is in a dungeon run
getPlayerDungeon(UUID playerUuid)DungeonInstanceThe run the player is in, or null
getActiveInstances()Collection<DungeonInstance>All running dungeon runs
getTokens(UUID playerUuid)intThe player’s dungeon token balance
addTokens(UUID playerUuid, int amount)voidAdd tokens to a player
isOnCooldown(UUID playerUuid, String biomeId)booleanWhether the biome is on cooldown for the player

KS Dungeons does not fire public events. With KyuubiSoft Achievements installed it sends these achievement triggers when a run is completed:

TriggerWhen
dungeon_complete_anyAny completed run
dungeon_complete_<biome>Completed run in that biome, e.g. dungeon_complete_stone_caves
dungeon_rarity_<rarity>Completed run from a map of that rarity (common … legendary); runs without a map send dungeon_rarity_command
dungeon_no_deathCompleted run without a team death