Class Cooldowns
java.lang.Object
studio.magemonkey.fabled.enchants.api.Cooldowns
FabledEnchants © 2026 VoidEdge
api.studio.magemonkey.fabled.enchants.Cooldowns
Helper class for managing cooldowns for enchantments
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidConfigures the cooldown for an enchantmentstatic booleanonCooldown(CustomEnchantment enchant, org.bukkit.entity.LivingEntity user, Settings settings, int level) Checks whether or not the enchantment is on cooldownstatic voidreduce(CustomEnchantment enchant, org.bukkit.entity.LivingEntity user, long millis) Reduces the remaining time of an enchantment's cooldown.static intsecondsLeft(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 voidstart(CustomEnchantment enchant, org.bukkit.entity.LivingEntity user) Starts the cooldown of an enchantment
-
Constructor Details
-
Cooldowns
public Cooldowns()
-
-
Method Details
-
configure
Configures the cooldown for an enchantment- Parameters:
settings- settings of the enchantmentbase- base value to configurescale- 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- enchantmentuser- player using the enchantmentsettings- settings of the enchantmentlevel- 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 checkuser- player using the enchantmentsettings- settings of the enchantmentlevel- enchantment level- Returns:
- true if on cooldown, false otherwise
-
start
Starts the cooldown of an enchantment- Parameters:
enchant- enchantment to start foruser- 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 foruser- player using the enchantmentmillis- time to reduce by in milliseconds
-