An open API service indexing awesome lists of open source software.

https://github.com/igabytm/mastercooldowns

The easiest and most advanced way to add cooldowns to commands
https://github.com/igabytm/mastercooldowns

java minecraft-plugin spigot-plugin

Last synced: 10 months ago
JSON representation

The easiest and most advanced way to add cooldowns to commands

Awesome Lists containing this project

README

          

## Master Cooldowns

## Download
- [Mc-Market](https://www.mc-market.org/resources/12592/)
- [SpigotMC](https://www.spigotmc.org/resources/72145/)

## Commands
| Name | Usage | Description |
|------------------------------------------------------|-------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `mcd add [player┃*┃**] [id] [duration] ` | `mcd add GabyTM daily_reward 86400` | Add a new cooldown, if the id is already in use the cooldown will be overridden. The duration is in seconds. By passing `true` as value for 'accumulate', if the player has an active cooldown with the same id, the 'duration' will be added to the existing cooldown (remaining time + duration) |
| `mcd remove [player┃*┃**] [id┃all]` | `mcd remove GabyTM daily_reward` | Use `*` as player argument to remove cooldowns from all online players, `**` for offline players and `all` as id to remove all cooldowns |
| `mcd check [player] [id]` | `mcd check GabyTM daily_reward` | Check the time left of a cooldown |
| `mcd list [player]` | `mcd list GabyTM` | A list of the available cooldowns |
| `mcd reload` | `mcd reload` | Reload the config |
| `mcd help` | `mcd help` | Display the commands list |

> ```
> Note: To use the commands you need the 'mastercooldowns.access' permission.
> Aliases: cd, mcd, mcooldowns, mcooldown.
> ```

## Placeholders
The plugin add the following placeholders to [PlaceholderAPI](https://www.spigotmc.org/resources/6245/).

| Placeholder | Usage | Output | Description |
|-----------------------------------------|----------------------------------------------|--------|---------------------------------------------------------------------|
| `%mcd_left_%` | `%mcd_left_daily_reward%` | 86400 | Return the time left of a cooldown as an integer |
| `%mcd_left_formatted_%` | `%mcd_left_formatted_daily_reward%` | 24h | Same as above but formatted using PlaceholderAPI simple date format |
| `%mcd_active_%` | `%mcd_active_daily_reward monthly_reward%` | 2 | Return how many of the provided cooldowns are active |
| `%mcd_inactive_%` | `%mcd_inactive_daily_reward monthly_reward%` | 2 | Return how many of the provided cooldowns are inactive |
| `%mcd_isactive_%` | `%mcd_isactive_daily_reward%` | Yes | Whether a cooldown is active |
| `%mcd_isinactive_%` | `%mcd_isinactive_daily_reward%` | No | Whether a cooldown is inactive |

## Config
The default config can be found [here](iGabyTM/MasterCooldowns/tree/master/src/main/resources/config.yml).

## Examples

DeluxeMenus Rewards GUI

```yaml
menu_title: '&rDaily Rewards'
inventory_type: HOPPER
open_command: rewards
update_interval: 1
items:
glass:
material: STAINED_GLASS_PANE
data: 7
slots:
- 0
- 1
- 3
- 4
display_name: ' '
available:
material: STORAGE_MINECART
slot: 2
priority: 1
view_requirement:
requirements:
cooldown:
type: '=='
input: '%mcd_left_daily_reward%'
output: '0'
display_name: '&aDaily Reward'
lore:
- ''
- '&aRight Click &7to claim!'
click_commands:
- '[console] mcd add %player_name% daily_reward 86400'
- '[console] eco give %player_name% 10000'
- '[close]'
- '[message] &2&l[!] &aYou have claimed your daily reward, come back tomorrow for more!'
on_cooldown:
material: MINECART
slot: 2
priority: 2
update: true
display_name: '&cDaily Reward'
lore:
- ''
- '&7Available on &c%mcd_left_formatted_daily_reward%'
```


## Statistics
[![BStats](https://bstats.org/signatures/bukkit/MasterCooldowns.svg)](https://bstats.org/plugin/bukkit/MasterCooldowns)

[![Discord](https://i.imgur.com/O1vSizn.png)](https://gabytm.me)