EssentialsX

EssentialsX

2M Downloads

Command cooldown does not function on /repair

mrcoffee1026 opened this issue ยท 2 comments

commented

Information

Full output of /ess version:

[11:11:26 INFO]: Server version: 1.15.1-R0.1-SNAPSHOT git-Paper-50 (MC: 1.15.1)
[11:11:26 INFO]: EssentialsX version: 2.17.1.52
[11:11:26 INFO]: PlaceholderAPI version: 2.10.4
[11:11:26 INFO]: LuckPerms version: 5.0.39
[11:11:26 INFO]: Vault version: 1.7.2-b107
[11:11:26 INFO]: ChestShop version: 3.10-SNAPSHOT (build 164)
[11:11:26 INFO]: EssentialsXProtect version: 2.17.1.52
[11:11:26 INFO]: EssentialsXAntiBuild version: 2.17.1.52
[11:11:26 INFO]: EssentialsXSpawn version: 2.17.1.52

Server log: no relevant log activity.

EssentialsX config: Relevant portion of config:

command-cooldowns:
#  feed: 100 # 100 second cooldown on /feed command
#  '*': 5 # 5 Second cooldown on all commands
  - '^(fix|repair)( all)?': 43200
  - fix: 43200
  - repair: 43200

Details

Description
Have attempted to cooldown the essentials repair feature using both regex and plain text settings in command-cooldowns. Have checked ess debug and verified that essentials does not even verify if the user has the permission essentials.commandcooldowns.bypass when the user uses the repair command... all it checks is if they have the essentials.repair permission and so always runs the command regardless of now many times per second they choose to run it.

Steps to reproduce
Attempt to apply cooldown to /repair, /repair all, /fix, /fix all... any combination of the above... then try to run any of those commands as many times as you like in however short of a time as you'd like.

Expected behavior
Command should either obey command-cooldowns or repair/repair all will need its own cooldown like heal/feed gets.

Screenshots

commented

It looks like you're defining your cooldowns incorrectly. The correct format is as follows:

command-cooldowns:
  repair: 43200

not as above:

command-cooldowns:
  - '^(fix|repair)( all)?': 43200
  - fix: 43200
  - repair: 43200

Note the lack of a - before the definition in the correct format. The command-cooldowns section isn't a list, but rather a parent node. The removal of the - and preceding space from your definitions should hopefully solve your issue.

Extra: proof of the cooldown function working correctly with the fixed format:

[08:43:30 INFO]: ExplodingGravy issued server command: /repair
[08:43:30 INFO]: [Essentials] checking if ExplodingGravy has essentials.commandcooldowns.bypass - false
[08:43:30 INFO]: [Essentials] Checking command 'repair' against cooldown 'repair( .*)?': true
[08:43:30 INFO]: [Essentials] Applying 43200000ms cooldown on /repair for ExplodingGravy.

image

commented

thanks for that i'd never have seen the issue.