Chrono
一个轻量级的服务器任务调度插件。可以按时间间隔、特定时间点或链式组合来安排命令执行。
为什么选择 Chrono?
大多数调度插件要么功能过剩,要么仅具备基本功能。Chrono 处于中间地带:既强大到足以支持复杂设置,又简单到让你无需阅读 Wiki 即可在 30 秒内完成配置。
功能
- 间隔调度 — 每隔 30 秒、10 分钟、2 小时等任意你需要的时间运行命令
- Cron 调度 — 在精确的时钟时间运行,例如
daily-at-03:00 或 weekly-monday-08:00
- 任务链 — 任务 A 完成后自动运行任务 B,并可在两者之间设置可选延迟
- 纯链式任务 — 无调度计划的特殊任务,旨在被其他任务触发
- 延迟 — 在任务触发前添加等待时间(
delay:30s)
- 启用/禁用 — 暂停任务而不删除它们
- 手动触发 — 按需运行任何任务以进行测试
- 图形界面 (GUI) — 游戏内物品栏视图,支持点击控制
- 执行日志 — 查看每个任务上次运行的时间及是否成功
- 导入/导出 — 以 JSON 格式备份和恢复任务
- Tab 补全 — 所有参数均支持 Tab 键补全
- JSON 存储 — 任务保存至
tasks.json,重启后保留,无需数据库设置
命令
/chrono add name:AutoSave command:save-all interval:10m
/chrono add name:Restart command:restart cron:daily-at-03:00
/chrono add name:Notify command:say Done!
/chrono chain AutoSave Notify
/chrono list
/chrono info <name>
/chrono remove <name>
/chrono enable <name>
/chrono disable <name>
/chrono run <name>
/chrono edit <name> <field> <value>
/chrono logs <name>
/chrono gui
/chrono export
/chrono import <file>
/chrono reload
/chrono help
调度格式
间隔 (Interval) — 从任务创建时开始计数:
| 格式 |
含义 |
30s |
每 30 秒一次 |
10m |
每 10 分钟一次 |
2h |
每 2 小时一次 |
1d |
每天一次 |
Cron — 在特定的时钟时间触发:
| 格式 |
含义 |
hourly |
每小时整点 (:00) |
midnight |
每天 00:00 |
noon |
每天 12:00 |
daily-at-HH:MM |
例如 daily-at-08:30 |
every-Nmin |
例如 every-5min |
every-Nh |
例如 every-2h |
weekly-DAY-HH:MM |
例如 weekly-monday-08:00 |
任务链
将任务链接在一起以构建序列:
/chrono add name:Save command:save-all interval:6h
/chrono add name:Announce command:broadcast Server saved! delay:2s
/chrono chain Save Announce
Announce 将在 Save 完成后 2 秒触发,每 6 小时循环一次。无需额外配置。
链式操作具备循环安全性 —— Chrono 会阻止任何可能导致无限循环的链条。
权限
| 节点 |
描述 |
chrono.admin |
完全访问所有功能 |
chrono.add |
创建任务 |
chrono.remove |
删除任务 |
chrono.edit |
编辑任务 |
chrono.enable / chrono.disable |
切换任务状态 |
chrono.run |
手动触发任务 |
chrono.list |
查看任务列表 |
chrono.reload |
重载插件 |
chrono.gui |
打开图形界面 |
chrono.export / chrono.import |
备份和恢复数据 |
要求
- Paper/Spigot/Bukkit/Purpur 1.21.x
- Java 21
源码
github.com/DamianDaniel/chrono
Chrono
A lightweight task scheduler plugin for servers. Schedule commands to run on a timer, at specific times, or chain them together.
Why Chrono?
Most scheduler plugins are either overkill or barely functional. Chrono hits the middle ground: powerful enough for complex setups, simple enough that you can set it up in 30 seconds without reading a wiki.
Features
- Interval scheduling — run a command every 30 seconds, 10 minutes, 2 hours, whatever you need
- Cron scheduling — run at exact clock times like
daily-at-03:00 or weekly-monday-08:00
- Task chaining — run task B automatically after task A completes, with optional delay between them
- Chain-only tasks — tasks with no schedule, meant to be triggered by other tasks
- Delays — add a wait before a task fires (
delay:30s)
- Enable/disable — pause tasks without deleting them
- Manual trigger — run any task on demand for testing
- GUI — in-game inventory view with click controls
- Execution logs — see when each task last ran and whether it succeeded
- Import/export — back up and restore tasks as JSON
- Tab completion — every argument is tab-completable
- JSON storage — tasks are saved to
tasks.json, survive restarts, no database setup
Commands
/chrono add name:AutoSave command:save-all interval:10m
/chrono add name:Restart command:restart cron:daily-at-03:00
/chrono add name:Notify command:say Done!
/chrono chain AutoSave Notify
/chrono list
/chrono info <name>
/chrono remove <name>
/chrono enable <name>
/chrono disable <name>
/chrono run <name>
/chrono edit <name> <field> <value>
/chrono logs <name>
/chrono gui
/chrono export
/chrono import <file>
/chrono reload
/chrono help
Schedule Formats
Interval — counts from when the task was created:
| Format |
Meaning |
30s |
every 30 seconds |
10m |
every 10 minutes |
2h |
every 2 hours |
1d |
every day |
Cron — fires at specific clock times:
| Format |
Meaning |
hourly |
every hour at :00 |
midnight |
every day at 00:00 |
noon |
every day at 12:00 |
daily-at-HH:MM |
e.g. daily-at-08:30 |
every-Nmin |
e.g. every-5min |
every-Nh |
e.g. every-2h |
weekly-DAY-HH:MM |
e.g. weekly-monday-08:00 |
Task Chaining
Chain tasks together to build sequences:
/chrono add name:Save command:save-all interval:6h
/chrono add name:Announce command:broadcast Server saved! delay:2s
/chrono chain Save Announce
Announce fires 2 seconds after Save completes, every 6 hours. No extra config.
Chains are cycle-safe — Chrono blocks any chain that would loop.
Permissions
| Node |
Description |
chrono.admin |
Full access to everything |
chrono.add |
Create tasks |
chrono.remove |
Delete tasks |
chrono.edit |
Edit tasks |
chrono.enable / chrono.disable |
Toggle tasks |
chrono.run |
Manually trigger tasks |
chrono.list |
View tasks |
chrono.reload |
Reload plugin |
chrono.gui |
Open GUI |
chrono.export / chrono.import |
Backup and restore |
Requirements
- Paper/Spigot/Bukkit/Purpur 1.21.x
- Java 21
Source
github.com/DamianDaniel/chrono
评论 0
登录后参与评分
还没有评论,来抢沙发吧