Replace command-costs and command-cooldowns with command filters system #3200
Labels
type: discussion
Thread for discussion of large changes to the plugin.
type: enhancement
Features and feature requests.
Milestone
Currently,
command-costs
andcommand-cooldowns
are separate and behave slightly differently -command-costs
only supports EssentialsX's own commands and doesn't support regexes, whilecommand-cooldowns
supports external plugins commands but doesn't ensure that the command succeeds before setting the cooldown.The new filters system could be implemented in a separate config, which is a list of filters that contain the following options:
name
(optional): a name for the filter, allowing perms to bypass specific filters (as well as allowing us to track cooldowns in player data; if none is provided then we can auto generate a name)command
(required unlesspattern
is provided): the name of an EssentialsX command; these filters will ensure that the command succeeds before charging the player or starting the cooldownpattern
(required unlesscommand
is provided): a regex to match any plugin's command against; these filters will not check whether the command succeedscooldown
(optional): the length of time that the player will have to wait until they can use a command matching this filter again, in secondscost
(optional): the amount that will be deducted from the player's economy balance when they use the commandAn example looks something like this:
The use of a
command
orpattern
parameter instead of a map key also avoids a bug with the currentcommand-cooldowns
where any regex pattern that includes.
fails to parse due to YAML syntax errors.It would be ideal to also migrate over old cooldowns to the new system (similar to how kits were done).
The text was updated successfully, but these errors were encountered: