Setting remaining time of command cooldown overridden by setLastUsage() #5862
Labels
bug
An issue that needs to be fixed. Alternatively, a PR fixing an issue.
completed
The issue has been fully resolved and the change will be in the next Skript update.
good first issue
An issue that would be good for a first-time contributor to make a PR for
priority: low
Issues that are not harmful to the experience but are related to useful changes or additions.
Skript/Server Version
Bug Description
When immediately setting the remaining time of a command, the change is overridden due to the
setLastUsage
call of the command being after the command is executed. The usage call should be before the execution of the code in the command. See line 277 of ch/njol/skript/command/ScriptCommand.java.Expected Behavior
The change to remaining time should persist, and not be overwritten after the command's execute2 method returns.
Steps to Reproduce
Does not work (always 20 seconds)
Works:
Errors or Screenshots
No response
Other
No response
Agreement
The text was updated successfully, but these errors were encountered: