Cooldowns as a service

If there were to be a cooldown library as a sponge service, what would people want included?

Warmups, Cooldowns, Animations / Scheduled Updates, Different systems for warmups, no-movement, no-pvp, no-pve, Chat Messages, Particles, Block Interaction, Command Cancelling, Spam Punishment, Warnings.

I was thinking if some of these could be made, and made configurable it would save plugin authors the trouble, as well as providing a unified configuration for users.

The ability to register additional systems would be helpful as well, and plugins could have configuration options to choose what type of cooldown system they wish to use, which could then be named and configured by the user.

So if I understand this correctly you want to make a library, that defines cooldown types in a config. So teleportation plugins, chat managers or any plugin can get the type of cooldown from the library?

Not sure if thats usefully, …

Yeah pretty much.

It’s more a convenience thing for users, being able to share cooldowns amongst plugins.

Implementing a cooldown is not a big deal. Why do we need an API for that?


Perhaps so that plugins can share a cool down, so say that a plugin has a /home command and another has a /spawn command, if they both define a cool down called “Teleport_Cooldown” then they will share that cool down and ether one will trigger it, and both will obey it.


Then don’t use it? Negative feedback won’t stop me from making it, only a lack of positive/constructive feedback.

it doesnt seem like such a necessary thing, the common idea for plugins like those is that it all comes in a single package. its not very likely that people’re gonna make one plugin for one specific thing like that, nor is it likely that server owners are gonna install multiple plugins of the same purpose. its not a bad idea, but the question is whether we have ample reason to utilize it.

Or, you could just make a ‘Fat Jar’. Pack the library with your plugin, that way you never need someone to download another jar.

1 Like

I’ve been thinking about this some more.

The basic outline of the plugin is that a plugin with explicit support for cooldowns would register a task with the cooldowns service through a small wrapping class that if the cooldowns service is absent will execute the task immediately or fall back to a plugin defined cooldown.

A plugin that wishes to have explicit cooldown support, (think magic spells or abilities as opposed to commands) will register a runnable of some sort with the cooldown service, and optionally define a way to get updates on whether it ran, or what the cooldown timer is. Not passing a progress updater will result in a default progress updater, chooseable by the user (boss bars, system messages, chat, temporary item renames, scoreboards etc)

The task isn’t guarantee’d to run as the cooldown may be in cooldown, or the warmup cancelled.

If the changes for the Economy service go through, then the Context system that permissions use will be separated from permissions and able to be used for other things.

CooldownActions would have a unique id corresponding to the action and plugin performing it. com.magicplugin.skill.wizardfireball for example.

In configuration using a system similar to Permission Options (maybe even using permission options) com.magicplugin.skill.wizardfireball could be assigned to a cooldown. a cooldown can be shared amongst players / actions / teams or be split based on a variety of things. Maybe a region can only use an ability within the region once per minecraft day?

Anyway I would appreciate any constructive input anyone has, or ideas on how to integrate the above with the permissions or context systems.

You like overcomplicated things right.

You dont really need any tasks for cooldowns like this. Simply store in your player wrapper class/data manipulator a map id-long. Thats all what you need for cooldowns.

No I like things being user configurable, and the idea of doing one thing and doing it well instead of having 100 plugins all doing the “essentials” some with cooldowns and some without. Take BoosCooldowns on bukkit for example.