Class Cooldowns

java.lang.Object
studio.magemonkey.fabled.enchants.api.Cooldowns

public class Cooldowns extends Object
FabledEnchants © 2026 VoidEdge api.studio.magemonkey.fabled.enchants.Cooldowns

Helper class for managing cooldowns for enchantments

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    configure(Settings settings, double base, double scale)
    Configures the cooldown for an enchantment
    static boolean
    onCooldown(CustomEnchantment enchant, org.bukkit.entity.LivingEntity user, Settings settings, int level)
    Checks whether or not the enchantment is on cooldown
    static void
    reduce(CustomEnchantment enchant, org.bukkit.entity.LivingEntity user, long millis)
    Reduces the remaining time of an enchantment's cooldown.
    static int
    secondsLeft(CustomEnchantment enchant, org.bukkit.entity.LivingEntity user, Settings settings, int level)
    Computes the number of seconds left on the enchantment's cooldown, rounded up to the nearest second.
    static void
    start(CustomEnchantment enchant, org.bukkit.entity.LivingEntity user)
    Starts the cooldown of an enchantment

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Cooldowns

      public Cooldowns()
  • Method Details

    • configure

      public static void configure(Settings settings, double base, double scale)
      Configures the cooldown for an enchantment
      Parameters:
      settings - settings of the enchantment
      base - base value to configure
      scale - scaling value to configure
    • secondsLeft

      public static int secondsLeft(CustomEnchantment enchant, org.bukkit.entity.LivingEntity user, Settings settings, int level)
      Computes the number of seconds left on the enchantment's cooldown, rounded up to the nearest second.
      Parameters:
      enchant - enchantment
      user - player using the enchantment
      settings - settings of the enchantment
      level - enchantment level
      Returns:
      seconds left
    • onCooldown

      public static boolean onCooldown(CustomEnchantment enchant, org.bukkit.entity.LivingEntity user, Settings settings, int level)
      Checks whether or not the enchantment is on cooldown
      Parameters:
      enchant - enchantment to check
      user - player using the enchantment
      settings - settings of the enchantment
      level - enchantment level
      Returns:
      true if on cooldown, false otherwise
    • start

      public static void start(CustomEnchantment enchant, org.bukkit.entity.LivingEntity user)
      Starts the cooldown of an enchantment
      Parameters:
      enchant - enchantment to start for
      user - player using the enchantment
    • reduce

      public static void reduce(CustomEnchantment enchant, org.bukkit.entity.LivingEntity user, long millis)
      Reduces the remaining time of an enchantment's cooldown.
      Parameters:
      enchant - enchantment to reduce the time for
      user - player using the enchantment
      millis - time to reduce by in milliseconds