Allow the administrator to place cooldowns on commands that users can execute
Such is done by monitoring the PlayerCommandPreprocessEvent.
Will need a HashMap<Player, HashMap<String, Instant>> to store the cooldowns
Setting to allow for the cooldowns to be persistent over restart
Time is in seconds.
Permissions to bypass the cooldown (phantomcore.custom-command-cooldown-bypass.COMMAND)
When the user runs the command, it checks --
Is the user in the cooldown map?
Yes?
Have they surpassed enough time to execute the command again?
Yes?
Allow execution of the command and reset their time on the cooldown map.
No?
Cancel execution of the command and inform the user.
No?
Allow execution of the command and add them to the cooldown map.
Allow the administrator to place cooldowns on commands that users can execute
Such is done by monitoring the
PlayerCommandPreprocessEvent
.Will need a HashMap<Player, HashMap<String, Instant>> to store the cooldowns
Setting to allow for the cooldowns to be persistent over restart
Time is in seconds.
Permissions to bypass the cooldown (
phantomcore.custom-command-cooldown-bypass.COMMAND
)When the user runs the command, it checks --
Example Configuration:
Default Cooldowns
/heal
= 300 seconds (5 minutes)/feed
= 300 seconds (5 minutes)Considerations for the plugin's users
/tpa
= 3 seconds?