StopTimer
一款现代化的、高度可定制的 Spigot / Paper / Folia 插件,用于带有倒计时的服务器定时关闭。功能包括自定义关机原因、模板管理、可定制 BossBar、Discord 集成、PlaceholderAPI 支持以及多语言本地化。
功能
- 灵活倒计时:支持以秒 (
s)、分钟 (m) 或小时 (h) 为单位启动倒计时(例如 30s、5m、1h)。
- 动态关机原因与模板:
- 使用
r:<reason> 直接指定自定义原因(例如 /stopserver 5m r:Server maintenance)。
- 使用
t:<template> 调用预定义的复用模板(例如 /stopserver 5m t:update)。
- 支持
%reason% 占位符,可用于聊天、标题、动作栏、BossBar、Discord 和踢出消息中。
- 可定制 BossBar:实时进度条,支持配置颜色(
RED, BLUE, GREEN, PINK, PURPLE, WHITE, YELLOW)和样式(SOLID, NOTCHED_6, NOTCHED_10, NOTCHED_12, NOTCHED_20)。
- 多阶段通知:配置阈值秒数,在特定时间点广播聊天消息、标题/副标题以及 Discord 消息。
- DiscordSRV 集成(可选):自动将关机倒计时和取消通知发送到您的 Discord 频道。
- PlaceholderAPI 集成(可选):向记分板、标签页列表和菜单暴露剩余倒计时时间和格式化消息。
- 智能 Tab 补全:自动补全时长、子命令(
reload、cancel)、原因(r:)和模板(t:<template_name>)。
- 多语言支持:内置英文 (
en) 和繁体中文 (zh_tw)。
- bStats 指标:匿名统计数据收集,以帮助改进插件。
- 支持 Folia & Paper:专为高性能现代服务器软件构建和优化。
命令与权限
所有命令的权限节点:stoptimer.stopserver(默认:OP)
| 命令 |
描述 |
/stopserver [time] [r:<reason> | t:<template>] |
启动关机倒计时,可选择附带原因或模板。 |
/stopserver cancel |
取消正在进行的关机倒计时。 |
/stopserver reload |
实时重载配置文件、模板和语言文件。 |
命令示例:
/stopserver — 使用 config.yml 中的默认时间和默认模板启动倒计时。
/stopserver 5m — 5分钟后关机,使用默认原因。
/stopserver 10m r:Urgent Maintenance — 10分钟后关机,原因设为 "Urgent Maintenance"。
/stopserver 3m t:update — 3分钟后关机,使用模板 "update"。
/stopserver cancel — 取消正在运行的倒计时。
/stopserver reload — 重载 config.yml、templates.yml 和当前激活的语言文件。
配置
config.yml
# 用于所有消息的语言 (en, zh_tw 或自定义)
language: en
# 如果未指定时间,使用的默认倒计时时长
DefaultTime: 5m
# BossBar 显示设置
BossBar:
Enable: true
Color: RED # RED, GREEN, BLUE, YELLOW, PINK, PURPLE, WHITE
Style: SOLID # SOLID, NOTCHED_6, NOTCHED_10, NOTCHED_12, NOTCHED_20
# 通知阶段
NotifyTime:
Title:
Enable: true
FirstRun: false
Seconds: [300, 60, 10, 5, 4, 3, 2, 1]
Message:
Enable: true
FirstRun: true
Seconds: [1800, 600, 300, 60, 10, 5, 4, 3, 2, 1]
Discord:
Enable: true
FirstRun: true
Seconds: [1800, 600, 300, 60, 10]
templates.yml
定义自定义的可复用关机原因模板:
templates:
default: "Server stopping"
update: "Server updating"
maintenance: "Server maintenance"
本地化 (i18n)
StopTimer 自带内置翻译,位于 plugins/StopTimer/lang/ 目录下:
en.yml (English)
zh_tw.yml (繁體中文)
自定义语言:
- 创建新的 YAML 文件:
plugins/StopTimer/lang/<code>.yml(从 en.yml 复制)。
- 翻译其中的消息。
- 在
config.yml 中更新 language: <code>。
- 执行
/stopserver reload。
消息中可用的占位符:
%time% — 格式化的剩余时间(例如 5 minutes 0 seconds)。
%reason% — 动态或模板定义的关机原因。
PlaceholderAPI 占位符
安装 PlaceholderAPI 后,以下占位符可用:
| 占位符 |
描述 |
输出示例 |
%stoptimer_time% |
格式化的剩余时间 |
4 minutes 20 seconds |
%stoptimer_time_raw% |
原始剩余秒数 |
260 |
%stoptimer_message% |
完整的格式化广播消息 |
Server will restart in 4 minutes 20 seconds! |
StopTimer
A modern, highly customizable Spigot / Paper / Folia plugin for scheduled server shutdowns with countdown timers. Features custom shutdown reasons, template management, customizable BossBars, Discord integration, PlaceholderAPI support, and multi-language localization.
Features
- Flexible Countdown: Start countdowns with units in seconds (
s), minutes (m), or hours (h) (e.g., 30s, 5m, 1h).
- Dynamic Shutdown Reasons & Templates:
- Direct custom reasons using
r:<reason> (e.g., /stopserver 5m r:Server maintenance).
- Predefined reusable templates using
t:<template> (e.g., /stopserver 5m t:update).
%reason% placeholder supported across chat, title, actionbar, BossBar, Discord, and kick messages.
- Customizable BossBar: Real-time progress bar with configurable colors (
RED, BLUE, GREEN, PINK, PURPLE, WHITE, YELLOW) and styles (SOLID, NOTCHED_6, NOTCHED_10, NOTCHED_12, NOTCHED_20).
- Multi-Stage Notifications: Configure threshold seconds to broadcast chat messages, titles/subtitles, and Discord messages.
- DiscordSRV Integration (Optional): Automatically send shutdown countdowns and cancel notices to your Discord channels.
- PlaceholderAPI Integration (Optional): Expose remaining countdown times and formatted messages to scoreboards, tablists, and menus.
- Smart Tab-Completion: Auto-completes durations, subcommands (
reload, cancel), reasons (r:), and templates (t:<template_name>).
- Multi-Language Support: Bundled with English (
en) and Traditional Chinese (zh_tw).
- bStats Metrics: Anonymous statistics collection to help improve the plugin.
- Folia & Paper Supported: Built and optimized for high-performance modern server software.
Commands & Permissions
Permission node for all commands: stoptimer.stopserver (Default: OP)
| Command |
Description |
/stopserver [time] [r:<reason> | t:<template>] |
Start the shutdown countdown with optional reason or template. |
/stopserver cancel |
Cancel the ongoing shutdown countdown. |
/stopserver reload |
Reload configuration, templates, and language files live. |
Command Examples:
/stopserver — Starts countdown using the default time and default template from config.yml.
/stopserver 5m — Shuts down in 5 minutes with the default reason.
/stopserver 10m r:Urgent Maintenance — Shuts down in 10 minutes with reason "Urgent Maintenance".
/stopserver 3m t:update — Shuts down in 3 minutes with the template "update".
/stopserver cancel — Cancels the running countdown.
/stopserver reload — Reloads config.yml, templates.yml, and active language file.
Configuration
config.yml
# Language to use for all messages (en, zh_tw, or custom)
language: en
# Default countdown duration if none is specified
DefaultTime: 5m
# BossBar display settings
BossBar:
Enable: true
Color: RED # RED, GREEN, BLUE, YELLOW, PINK, PURPLE, WHITE
Style: SOLID # SOLID, NOTCHED_6, NOTCHED_10, NOTCHED_12, NOTCHED_20
# Notification stages
NotifyTime:
Title:
Enable: true
FirstRun: false
Seconds: [300, 60, 10, 5, 4, 3, 2, 1]
Message:
Enable: true
FirstRun: true
Seconds: [1800, 600, 300, 60, 10, 5, 4, 3, 2, 1]
Discord:
Enable: true
FirstRun: true
Seconds: [1800, 600, 300, 60, 10]
templates.yml
Define custom, reusable shutdown reason templates:
templates:
default: "Server stopping"
update: "Server updating"
maintenance: "Server maintenance"
Localization (i18n)
StopTimer ships with built-in translations in plugins/StopTimer/lang/:
en.yml (English)
zh_tw.yml (繁體中文)
Custom Languages:
- Create a new YAML file:
plugins/StopTimer/lang/<code>.yml (copy from en.yml).
- Translate the messages.
- Update
language: <code> in config.yml.
- Execute
/stopserver reload.
Available Placeholders in Messages:
%time% — Formatted remaining time (e.g., 5 minutes 0 seconds).
%reason% — Dynamic or template shutdown reason.
PlaceholderAPI Placeholders
When PlaceholderAPI is installed, the following placeholders are available:
| Placeholder |
Description |
Example Output |
%stoptimer_time% |
Formatted remaining time |
4 minutes 20 seconds |
%stoptimer_time_raw% |
Raw remaining seconds |
260 |
%stoptimer_message% |
Full formatted broadcast message |
Server will restart in 4 minutes 20 seconds! |
评论 0
登录后参与评分
还没有评论,来抢沙发吧