Improve Command Cooldown
Kyrobi opened this issue ยท 4 comments
Feature request
Feature description
An improvement on the current cooldown system. For example, have it on the highest priority and block not just commands registered with the Bukkit ecosystem or whatnot.
Kind of like what LiteBans does with what commands to disable when a player is muted.
How the feature is useful
Won't really change how the current system works, but will just improve it.
Reference: kangarko/ChatControl-Pro#1324
I don't really know how to explain this either, but I'll try my best.
It seems like Essentials only blocks commands by plugins who have registered it.
Plugins like ChatControl or other others that lets you "create your own command" technically don't register the command. They just match what you type you chat and execute the command.
Take ChatControl for example, you can create your own command. However, those commands aren't registered, therefore Essentials can't even pick it up.
From your description, ChatControl abuses the PlayerCommandPreprocessEvent
to avoid registering commands. PlayerCommandPreprocessEvent
should be used to intercept the start of Spigot's command handling process, and should never be used by plugins to run commands:
Examples of incorrect uses are:
- Using this event to run command logic
(source: Spigot's "Bukkit" javadocs)
You should use another plugin to set up custom commands - from a quick glance, SimpleAlias (wiki) can do everything you'd want and should work properly with EssentialsX cooldowns (though SimpleAlias also includes its own built-in cooldown system).
As a sidenote, we do not "support" adding commands through the PlayerCommandPreprocessEvent, we only filter that.
It is up to our users if they want to create a new filter that acts like a command (i.e. sends a message or runs a proxy command) where in reality it is not a real registered command.
Thanks for prompt and professional reply md.