Boosters API

Overview

The booster system enhances player progression by providing temporary multipliers for various game aspects. Boosters can affect specific currencies, global enchantments, or other game mechanics with configurable durations and multiplier values.


Booster Value Retrieval

Economy-Specific Boosters

double getBoosterValueByEconomy(UUID uuid, String economy)

  • Description: Gets the combined multiplier value for a specific currency

  • Parameters:

    • uuid - Player's unique identifier

    • economy - Currency identifier (e.g., "money", "gems")

  • Returns: Combined multiplier value (1.0 = no boost, 2.0 = double rewards)

  • Usage: Calculate boosted currency rewards

Global Enchant Boosters

double getBoosterValueGlobalEnchants(UUID uuid)

  • Description: Gets the combined multiplier for all enchantment effects

  • Parameters: uuid - Player's unique identifier

  • Returns: Enchantment boost multiplier

  • Usage: Apply boosts to enchantment chances or effects


Booster Management

Active Booster Information

List<String> getActiveBoosters(UUID uuid)

  • Description: Returns list of all active booster IDs for a player

  • Parameters: uuid - Player's unique identifier

  • Returns: List of booster identifiers currently active

  • Usage: Display active boosters, administrative oversight

void removeBooster(UUID uuid, String boosterId)

  • Description: Removes a specific booster from a player

  • Parameters:

    • uuid - Player's unique identifier

    • boosterId - Specific booster to remove

  • Usage: Administrative removal, booster cancellation


Booster Properties

Existence and Type Checking

boolean existsBooster(UUID uuid, String boosterId)

  • Description: Checks if a specific booster exists for a player

  • Parameters:

    • uuid - Player's unique identifier

    • boosterId - Booster to check

  • Returns: True if booster exists, false otherwise

  • Usage: Validation before operations, conditional logic

boolean isBoosterEnchantType(UUID uuid, String boosterId)

  • Description: Checks if a booster affects enchantments

  • Parameters:

    • uuid - Player's unique identifier

    • boosterId - Booster to check

  • Returns: True if it's an enchantment booster

  • Usage: Categorizing boosters, applying appropriate effects

Booster Information

String getBoosterCurrency(UUID uuid, String boosterId)

  • Description: Gets the currency type this booster affects

  • Parameters:

    • uuid - Player's unique identifier

    • boosterId - Booster to query

  • Returns: Currency identifier or empty for enchant boosters

  • Usage: Determine booster target, categorization

String getBoosterName(UUID uuid, String boosterId)

  • Description: Gets the display name of the booster

  • Parameters:

    • uuid - Player's unique identifier

    • boosterId - Booster to query

  • Returns: Human-readable booster name

  • Usage: Display in GUIs, player notifications

double getBoosterMultiplier(UUID uuid, String boosterId)

  • Description: Gets the multiplier value of the booster

  • Parameters:

    • uuid - Player's unique identifier

    • boosterId - Booster to query

  • Returns: Multiplier value (e.g., 1.5 for 50% boost)

  • Usage: Calculate boosted values, display boost strength

Timing Information

long getBoosterDuration(UUID uuid, String boosterId)

  • Description: Gets the total duration of the booster in milliseconds

  • Parameters:

    • uuid - Player's unique identifier

    • boosterId - Booster to query

  • Returns: Total duration in milliseconds

  • Usage: Display total booster time, administrative info

long getBoosterRemainingTime(UUID uuid, String boosterId)

  • Description: Gets the remaining time for the booster in milliseconds

  • Parameters:

    • uuid - Player's unique identifier

    • boosterId - Booster to query

  • Returns: Remaining time in milliseconds

  • Usage: Display countdown timers, expiration checks


Booster Modification

Property Updates

void setBoosterMultiplier(UUID uuid, String boosterId, double multiplier)

  • Description: Updates the multiplier value of an existing booster

  • Parameters:

    • uuid - Player's unique identifier

    • boosterId - Booster to modify

    • multiplier - New multiplier value

  • Usage: Dynamic booster adjustments, administrative modifications

void setBoosterDuration(UUID uuid, String boosterId, long duration)

  • Description: Updates the total duration of an existing booster

  • Parameters:

    • uuid - Player's unique identifier

    • boosterId - Booster to modify

    • duration - New duration in milliseconds

  • Usage: Extend or reduce booster duration

void setBoosterTimeLeft(UUID uuid, String boosterId, long timeLeft)

  • Description: Sets the remaining time for a booster

  • Parameters:

    • uuid - Player's unique identifier

    • boosterId - Booster to modify

    • timeLeft - Remaining time in milliseconds

  • Usage: Precise time control, pause/resume functionality

Type and Target Changes

void setBoosterEnchantBooster(UUID uuid, String boosterId, boolean enchantBooster)

  • Description: Changes whether a booster affects enchantments

  • Parameters:

    • uuid - Player's unique identifier

    • boosterId - Booster to modify

    • enchantBooster - True for enchant booster, false for currency

  • Usage: Convert booster types, reconfigure existing boosters

void setBoosterEconomy(UUID uuid, String boosterId, String economy)

  • Description: Changes the target currency for a booster

  • Parameters:

    • uuid - Player's unique identifier

    • boosterId - Booster to modify

    • economy - New target currency

  • Usage: Redirect booster effects, administrative corrections


Booster Creation

void addBooster(UUID uuid, String boosterId, String boosterName, String economy, double multiplier, long duration, boolean enchantBooster, boolean saveDB)

  • Description: Creates a new booster for a player

  • Parameters:

    • uuid - Player's unique identifier

    • boosterId - Unique identifier for the new booster

    • boosterName - Display name for the booster

    • economy - Target currency (empty string for enchant boosters)

    • multiplier - Boost multiplier value

    • duration - Duration in milliseconds

    • enchantBooster - True if this boosts enchantments

    • saveDB - Whether to persist to database

  • Usage: Grant boosters through events, purchases, rewards


Usage Examples

Checking Active Boosters

EdDungeonsBoostersAPI boostersAPI = EdDungeonsAPI.getInstance().getBoostersAPI();
UUID playerUUID = player.getUniqueId();

// Get money boost multiplier
double moneyBoost = boostersAPI.getBoosterValueByEconomy(playerUUID, "money");
if (moneyBoost > 1.0) {
    player.sendMessage("§6You have a " + (moneyBoost * 100) + "% money boost!");
}

// Check enchantment boosts
double enchantBoost = boostersAPI.getBoosterValueGlobalEnchants(playerUUID);
if (enchantBoost > 1.0) {
    player.sendMessage("§dYour enchantments are boosted by " + (enchantBoost * 100) + "%!");
}

Displaying Active Boosters

List<String> activeBoosters = boostersAPI.getActiveBoosters(playerUUID);

if (activeBoosters.isEmpty()) {
    player.sendMessage("§7You have no active boosters.");
    return;
}

player.sendMessage("§6=== Active Boosters ===");
for (String boosterId : activeBoosters) {
    String name = boostersAPI.getBoosterName(playerUUID, boosterId);
    double multiplier = boostersAPI.getBoosterMultiplier(playerUUID, boosterId);
    long remaining = boostersAPI.getBoosterRemainingTime(playerUUID, boosterId);
    
    long seconds = remaining / 1000;
    long minutes = seconds / 60;
    long hours = minutes / 60;
    
    String timeStr = String.format("%02d:%02d:%02d", hours, minutes % 60, seconds % 60);
    
    player.sendMessage(String.format("§e%s §7- §a%.1fx §7(§f%s§7)", 
        name, multiplier, timeStr));
}

Creating Custom Boosters

// Give a 2x money booster for 1 hour
boostersAPI.addBooster(
    playerUUID,
    "event_money_boost_" + System.currentTimeMillis(), // Unique ID
    "§6Event Money Boost",
    "money", // Target currency
    2.0, // 2x multiplier
    3600000L, // 1 hour in milliseconds
    false, // Not an enchant booster
    true // Save to database
);

// Give a global enchantment booster for 30 minutes
boostersAPI.addBooster(
    playerUUID,
    "enchant_boost_" + System.currentTimeMillis(),
    "§dEnchantment Power Boost",
    "", // Empty for enchant boosters
    1.5, // 1.5x multiplier
    1800000L, // 30 minutes
    true, // Is an enchant booster
    true // Save to database
);

Last updated

Was this helpful?