Command Cooldown
Command Cooldown
Command Cooldown 允许你在配置文件中为任意指令设置冷却时间。它能用来做什么?普通用户在使用诸如 /warp(传送)等指令时,可能需要等待 xxx 秒的冷却时间,而捐赠者权限组则可以获得更短的冷却时间,甚至完全无冷却。或者你只是想在 /smite(天罚)的使用间隔中加入 60 秒的延迟!这一切都是可能的!
配置
在 config.yml 中,只需添加你想限制的指令,后跟延迟的秒数。之后,拥有权限 "commandcooldown." + (指令名) + (延迟秒数) 的所有用户在使用该指令时将必须等待相应的秒数。即使服务器重载或重启,任何冷却状态都会保持持久!
示例:如果在配置文件中的 "commands:" 下添加了 "- heal60",那么所有拥有权限 "commandcooldown.heal60" 的玩家在使用 /heal 时将必须等待 60 秒。如果你在配置中也添加了 "- heal20",并且玩家同时拥有 "commandcooldown.heal20" 和 "commandcooldown.heal60" 这两个权限,他们只需要等待 20 秒。
配置文件中自带两个使用示例。
指令
- /commandcooldown - 无需重启服务器即可重载插件配置。
权限
- commandcooldown.override - 覆盖所有冷却时间。
- commandcooldown.[指令][延迟秒数] - 为特定权限组设置指令冷却。此权限仅在配置文件中预先设置后才生效。示例:commandcooldown.smite60。
- 如果玩家没有任何与该指令相关的 commandcooldown 权限,则他/她将不受配置中针对该指令设定的任何冷却限制。
- commandcooldown.reload - 允许使用 /commandcooldown 指令,从而无需重启服务器即可重载配置。
如果你好奇的话,这里是源代码:source
Command Cooldown
Command Cooldown
Command Cooldown allows you to set a cooldown for any command, set in a config. What can you use it for? Standard users might have to wait xxx amount of seconds between uses of a command like warp, while donator ranks would get lower, or perhaps even no cooldown between uses. Or perhaps you just want a 60 seconds delay between uses of /smite! It's all possible!
Configuration
In the config.yml, simple add the command you want limited, followed by the seconds of delay. After that, every user with the permission "commandcooldown." + (commandname) + (seconds of delay) will have to wait that amount of seconds between uses of the command. Any cooldowns will stay persistent even if the server reloads or restarts!
Example: In the config, if " - heal60" is added under "commands:", all players with the permission "commandcooldown.heal60" will have to wait 60 seconds between uses of /heal. If you also have " - heal20" in the config, and a player has both permissions "commandcooldown.heal20" and "commandcooldown.heal60", they will only have to wait 20 seconds.
The config comes with two example uses.
Commands
- /commandcooldown - reloads the plugin configuration without having to restart the server.
Permissions
- commandcooldown.override - override all cooldowns.
- commandcooldown.[command][seconds of delay] - delay a command for a specific rank. This permission will only be active if it has been set in the config first. Example: commandcooldown.smite60.
- If a player does not have any commandcooldown permissions relating to a command, he or she will not be limited by any cooldowns that are in the configuration pertaining to that command.
- commandcooldown.reload - allows use of /commandcooldown, which reloads the configuration without having to restart the server.
Here is the source code, if you're curious: source
评论 0
登录后参与评分
还没有评论,来抢沙发吧