Skip to content

API Reference

The Season Pass provides a public Java API (SeasonPassAPI) that allows other Hytale server mods to interact with the Season Pass system. The API follows a singleton pattern and is initialized automatically when the plugin starts.

import com.hytale.seasonpass.api.SeasonPassAPI;
SeasonPassAPI api = SeasonPassAPI.getInstance();

The instance is available after the Season Pass plugin has completed its setup() phase. It returns null if the Season Pass mod is not loaded.

:::warning Soft Dependency If your mod uses the Season Pass API as an optional integration, declare it as an optional dependency in your manifest.json and null-check the API instance before use:

{
"OptionalDependencies": {
"kyuubisoft:seasonpass": "*"
}
}

:::


Grants Season XP to a player. Accounts for premium boost, prestige boost, active boosters, daily caps, and all other XP modifiers.

void grantXp(Player player, int amount, String source)
ParameterTypeDescription
playerPlayerThe online player to grant XP to
amountintBase XP amount before modifiers
sourceStringSource identifier for logging (e.g., "quest_completed", "minigame_win")

Example:

// Grant 100 XP when a quest is completed
SeasonPassAPI.getInstance().grantXp(player, 100, "quest_completed");

Returns whether a season is currently active and not paused.

boolean isSeasonActive()

Example:

if (SeasonPassAPI.getInstance().isSeasonActive()) {
// Season-specific logic
}

Returns the current tier of a player.

int getPlayerTier(UUID playerId)
ParameterTypeDescription
playerIdUUIDPlayer’s UUID

Returns: Current tier number, or 0 if the player has no data.


Returns whether a player has the premium pass.

boolean hasPremium(UUID playerId)
ParameterTypeDescription
playerIdUUIDPlayer’s UUID

Returns: true if the player has the premium pass, false otherwise.


Returns the total XP earned by a player in the current season.

int getPlayerTotalXp(UUID playerId)
ParameterTypeDescription
playerIdUUIDPlayer’s UUID

Returns: Total season XP, or 0 if the player has no data.


Returns the season token balance of a player.

int getPlayerTokens(UUID playerId)
ParameterTypeDescription
playerIdUUIDPlayer’s UUID

Returns: Token balance, or 0 if the player has no data.


Increments challenge progress for a player. If a matching active challenge reaches its completion count, the challenge is automatically completed and rewards are granted.

void incrementChallengeProgress(Player player, String challengeType, String target, int amount)
ParameterTypeDescription
playerPlayerThe online player
challengeTypeStringChallenge type (e.g., "break_block", "mob_kill", "travel")
targetStringSpecific target (e.g., "Stone") or "any"
amountintProgress increment

Example:

// Increment mob kill progress by 1
SeasonPassAPI.getInstance().incrementChallengeProgress(player, "mob_kill", "Skeleton", 1);

Activates a personal XP booster for a player.

void grantBooster(UUID playerId, double multiplier, int durationMinutes)
ParameterTypeDescription
playerIdUUIDPlayer’s UUID
multiplierdoubleXP multiplier (e.g., 2.0 for double XP)
durationMinutesintBooster duration in minutes

Example:

// Grant a 2x XP booster for 30 minutes
SeasonPassAPI.getInstance().grantBooster(playerId, 2.0, 30);

:::note Booster Replacement If the player already has an active booster, it is replaced with the new one. Boosters do not stack with each other, but they do stack with the premium XP boost and global Double XP events. :::


Checks whether a global Double XP event is currently active.

boolean isDoubleXpEventActive()

Returns: true if a server-wide XP event is active.


Returns the current global XP multiplier. Returns 1.0 when no event is active.

double getGlobalXpMultiplier()

Returns the prestige level of a player.

int getPrestigeLevel(UUID playerId)
ParameterTypeDescription
playerIdUUIDPlayer’s UUID

Returns: Prestige level, or 0 if the player has no data or hasn’t prestiged.


Performs a prestige reset for a player. The player must have reached the maximum tier and prestige must be enabled in the active season.

boolean performPrestige(Player player)
ParameterTypeDescription
playerPlayerThe online player

Returns: true if prestige was successful, false if conditions were not met.


import com.hytale.seasonpass.api.SeasonPassAPI;
public void onQuestComplete(Player player, String questId) {
SeasonPassAPI api = SeasonPassAPI.getInstance();
if (api != null && api.isSeasonActive()) {
api.grantXp(player, 100, "quest_" + questId);
}
}
public void onMinigameWin(Player player) {
SeasonPassAPI api = SeasonPassAPI.getInstance();
if (api != null) {
api.grantXp(player, 250, "minigame_win");
api.grantBooster(player.getPlayerRef().getUuid(), 1.5, 15);
}
}
public boolean canAccessArea(UUID playerId) {
SeasonPassAPI api = SeasonPassAPI.getInstance();
if (api == null) return true; // Allow if Season Pass not loaded
return api.getPlayerTier(playerId) >= 10;
}
public boolean hasExclusiveAccess(UUID playerId) {
SeasonPassAPI api = SeasonPassAPI.getInstance();
return api != null && api.hasPremium(playerId);
}

To compile against the Season Pass API, add it as a compileOnly dependency in your build.gradle.kts:

dependencies {
compileOnly(project(":mods:seasonpass"))
}

And declare the dependency in your manifest.json:

{
"Dependencies": {
"kyuubisoft:core": "*"
},
"OptionalDependencies": {
"kyuubisoft:seasonpass": "*"
}
}

:::tip Runtime Safety Always null-check SeasonPassAPI.getInstance() before use. The Season Pass mod may not be installed on all servers that run your mod. :::