-
-
Notifications
You must be signed in to change notification settings - Fork 76
Description
Description
Sometimes commands may perform (relatively) CPU-intensive tasks. In this case, you probably don't want players to execute the command too rapidly. A common use case for example could be for commands that perform database queries. The fix to this problem would be to add an execution delay between commands. This delay will be per player (although I suppose there might be use cases for a global delay too).
Spigot does have an "anti-command spam" limiter, and sure you can make this limiter more strict but spigot/paper's build in anti-command spam features apply to ALL commands. I think it would be useful to have the ability in CommandAPI to edit the delays per-command.
Previously, a command API I built for my plugins used this but after I switched to CommandAPI, this is the one feature I do miss from my stuff ;(
Expected code
new CommandAPICommand("command")
...
.withDelay(500, TimeUnit.MILLISECONDS)
...
Extra details
No response