A plugin that adds customizable cool down timers to items. Using this plugin, you can ensure that your server is balanced and that players use items strategically instead of spamming them.
- Java 8 required, Java 17 recommended.
- Spigot, Paper, or Folia 1.8.8 - 1.20.1.
- BlueSlimeCore 2.9.3 or higher.
CooldownsX adds placeholders to plugins that support PlaceholderAPI. Review the table below for placeholder information:
| Placeholder | Description | Example Output |
|---|---|---|
%cooldownsx_time_left_<id>% | The amount of seconds left for a specific cooldown. (integer) | 5 |
%cooldownsx_time_left_decimal_<id>% | The amount of seconds left for a specific cooldown. (decimal) | 5.2 |
<id>: The configuration identifier.
CooldownsX has a useful API that is hosted on my own repository.
To use the api, add the following values to your pom.xml file:
Maven Repository
<repositories>
<!-- SirBlobman Public Repository -->
<repository>
<id>sirblobman-public</id>
<url>https://nexus.sirblobman.xyz/public/</url>
</repository>
</repositories>Maven Dependency
<dependencies>
<!-- CooldownsX -->
<dependency>
<groupId>com.github.sirblobman.plugin.cooldowns</groupId>
<artifactId>cooldowns-api</artifactId>
<version>5.1.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>To use the API you should make sure that CooldownsX is enabled on the server first.
The main things you need to know are how to get the plugin instance and how to get data for a player:
Example Code
importorg.bukkit.Bukkit;
importorg.bukkit.entity.Player;
importorg.bukkit.plugin.Plugin;
importorg.bukkit.plugin.PluginManager;
importcom.github.sirblobman.plugin.cooldown.CooldownsX;
importcom.github.sirblobman.plugin.cooldown.Cooldown;
importcom.github.sirblobman.plugin.cooldown.PlayerCooldown;
importcom.github.sirblobman.plugin.cooldown.PlayerCooldownManager;
importorg.jetbrains.annotations.Nullable;
importorg.jetbrains.annotations.NotNull;
publicfinalclassCooldownHelper {
public@NotNullCooldownsXgetCooldownsX() {
PluginManagerpluginManager = Bukkit.getPluginManager();
Pluginplugin = pluginManager.getPlugin("CooldownsX");
return (CooldownsX) plugin;
}
public@NotNullPlayerCooldowngetData(@NotNullPlayerplayer) {
CooldownsXplugin = getCooldownsX();
PlayerCooldownManagermanager = plugin.getCooldownManager();
returnmanager.getData(player);
}
public@NullableCooldowngetCooldownSettings(@NotNullStringid) {
CooldownsXplugin = getCooldownsX();
PlayerCooldownManagermanager = plugin.getCooldownManager();
returnmanager.getCooldownSettings(id);
}
/* * You can check the expiration time of a specific cooldown for a player: */publiclonggetCooldownExpireMillis(@NotNullPlayerplayer, @NotNullStringid) {
Cooldowncooldown = getCooldownSettings(id);
if (cooldown == null) {
return0L;
}
PlayerCooldowndata = getData(player);
returndata.getCooldownExpireTime(cooldown);
}
}