# ICooldownManager > Interface for managing per-player cooldowns identified by string keys. `gg.lode.bookshelfapi.api.manager.ICooldownManager` --- ## Signature ```java public interface ICooldownManager ``` --- ## Methods | Method | Return Type | Description | |--------|-------------|-------------| | `setCooldown(UUID playerId, String key, long millis)` | `void` | Sets a cooldown for the given player and key. | | `isOnCooldown(UUID playerId, String key)` | `boolean` | Checks if the player is currently on cooldown. | | `getCooldownTimeLeft(UUID playerId, String key)` | `long` | Returns the remaining cooldown time in milliseconds. | | `removeCooldown(UUID playerId, String key)` | `void` | Removes a specific cooldown from the player. | | `clearAllCooldowns(UUID playerId)` | `void` | Removes all cooldowns from the player. | ### Parameters | Parameter | Type | Description | |-----------|------|-------------| | `playerId` | `UUID` | The UUID of the player. | | `key` | `String` | A string identifier for the cooldown. | | `millis` | `long` | Duration of the cooldown in milliseconds. | --- ## Usage ```java ICooldownManager cooldowns = BookshelfAPI.getApi().getCooldownManager(); UUID playerId = player.getUniqueId(); cooldowns.setCooldown(playerId, "ability_fireball", 5000); if (cooldowns.isOnCooldown(playerId, "ability_fireball")) { long remaining = cooldowns.getCooldownTimeLeft(playerId, "ability_fireball"); player.sendMessage("On cooldown for " + remaining + "ms"); } ``` --- ## Related Pages - [[IBookshelfAPI]]