PieMotd
适用于 Paper 1.20.4+ 的动态 MOTD、服务器图标和加入欢迎标题插件,内置 WebUI,可通过浏览器管理全部配置。
v2.1.0 · Paper 1.20.4+ · Java 21 · MIT License
功能特性
- MOTD 支持 MiniMessage 格式(渐变、彩虹色、十六进制颜色),并支持多条消息轮换
- 轮换基于时间驱动——无论连接频率如何,均严格遵循配置的间隔;轮换方式(随机/顺序)与轮换时机(按间隔/按每次连接)可独立组合使用
- 服务器图标轮换提供三种模式:随机、顺序、每小时轮换;轮换列表自动取自
icons 目录下的所有图片
- 加入欢迎标题与音效提供三种显示模式:每次加入、仅首次加入、每天一次(数据保存在玩家存档中,重启后不丢失)
- 多语言支持;语言文件拆分存放于
lang/ 目录下,切换语言仅需修改配置
- 内置 WebUI ——无需手动编辑 YAML 文件(详见下文)


WebUI

插件启动后会运行一个本地 HTTP 服务。在浏览器中打开即可管理全部配置——保存后自动重载。
它主要解决了两个日常痛点:
实时 MiniMessage 预览。 MOTD 和欢迎标题中的渐变、彩虹色及变量会直接在页面上渲染为游戏内实际显示的效果。变量会以可读标签形式展示(例如 %online% 显示为“在线玩家数”,悬停可查看原始形式)。修改 MOTD 不再需要经历“编辑→重载→打开服务器列表”的循环;标签错误也能立即察觉。
从浏览器上传图标。 任意尺寸的图片会自动缩放至 64x64,按顺序命名为 icon1, icon2… 并加入轮换列表;不需要的图片也可在同一页面删除。无需图像编辑器调整大小,无需 FTP,无需手动编辑配置文件。

其他细节:
config.yml 中的每个选项都有对应的控件——无需手动编辑文件
- 保存操作会写入原始配置文件并保留注释;数值范围、路径有效性及枚举值均经过校验,无效值将保留原值并产生警告
- 顶部栏显示插件版本、MC 版本、在线玩家数和 TPS
安全性:
- 登录令牌仅可从服务器控制台生成——默认 128 位随机、单次使用、10 分钟过期
- 会话使用 HttpOnly + SameSite=Strict Cookie,默认有效期 12 小时,支持滑动续期
- 登录接口限流:连续 10 次失败将封锁 IP 60 秒
- 文件读取与删除接口限制在插件目录内;配置写入时会针对白名单校验数值范围和枚举值
两种部署模式
通过 config.yml 中的 webui.mode 进行切换。
PORT(默认):WebUI 监听独立端口——适用于 VPS 或专用服务器,直接访问 http://服务器IP:8080/。
PATH:WebUI 挂载于子路径下,适用于仅提供单个端口的面板主机。反向代理将外部路径转发至插件:
location /piemotd/ {
proxy_pass http://127.0.0.1:8080/piemotd/;
}
MCSManager 和 Pterodactyl 等面板的路由/反向代理功能原理相同。前端资源与 API 均使用相对路径,因此两种模式均可在不修改页面的情况下正常工作。
在此场景下,建议将 webui.bind 设置为 127.0.0.1,以便仅允许面板的本地转发访问该服务。
安装
- 服务端要求:Paper 1.20.4+(或其分支),Java 21+
- 将
PieMotd-2.1.0.jar 放入 plugins/ 目录并重启服务器
- 以下文件将自动生成:
plugins/PieMotd/
├── config.yml # 主配置文件
├── lang/
│ ├── zh_cn.yml # 简体中文
│ └── en_us.yml # English
└── icons/
└── default.png # 默认图标
配置
完整 config.yml
motd:
enabled: true # 启用 MOTD
update-interval: 10 # 轮换间隔(秒)
update-enabled: true # true=按间隔轮换 / false=每次连接时切换
random: true # true=随机选择 / false=顺序轮换
messages: [] # MOTD 列表,支持 MiniMessage 和变量
server-icon:
enabled: true # 启用图标轮换
default: "icons/default.png" # 默认图标(当 icons 文件夹为空时使用)
rotation-interval: 10.0 # 轮换间隔(秒)
rotation-mode: "RANDOM" # RANDOM / SEQUENTIAL / TIME(hourly)
# 轮换列表 = icons 文件夹中的所有图片(可通过 WebUI 上传/删除)
welcome:
enabled: true
display-mode: "EVERY_TIME" # EVERY_TIME / FIRST_JOIN / ONCE_PER_DAY
title:
main: "" # 主标题,支持 %player%
subtitle: "" # 副标题
fade-in: 20 # 淡入(刻)
stay: 100 # 停留(刻)
fade-out: 20 # 淡出(刻)
sound:
enabled: true
sound: "entity.player.levelup"
volume: 1.0
pitch: 1.0
settings:
language: "zh_cn" # lang/ 目录内的文件名
webui:
enabled: true # 启用 WebUI
mode: "PORT" # PORT(独立) / PATH(子路径)
bind: "0.0.0.0" # 监听地址
port: 8080 # 监听端口
base-path: "/piemotd" # PATH 模式下的子路径
token-expire-minutes: 10 # 登录令牌有效期(分钟,单次使用)
session-expire-hours: 12 # 登录后会话有效期(小时)
变量
| 变量 |
说明 |
%online% / %max_players% |
在线玩家数 / 最大玩家数 |
%tps% |
服务器 TPS |
%time% / %date% |
当前时间 / 日期 |
%memory_used% / %memory_max% |
已用内存 / 最大内存(MB) |
%server_version% |
服务器版本 |
%player% / %player_count% |
玩家名称 / 玩家数量(仅限欢迎标题) |
每次 ping 请求时都会替换变量。/piemotd preview 命令和 WebUI 预览界面显示占位符标签;服务器列表则显示实际值。
命令
| 命令 |
说明 |
权限 |
/piemotd reload |
重新加载整个配置(别名 /pmotd、/pm) |
piemotd.reload |
/piemotd preview |
在聊天栏中预览当前的 MOTD |
piemotd.admin |
/piemotd webui token |
生成一个 WebUI 登录令牌,仅限控制台使用 |
piemotd.admin |
/piemotd help |
显示帮助信息 |
无 |
权限
| 权限 |
说明 |
默认设置 |
piemotd.reload |
重新加载配置 |
OP |
piemotd.admin |
管理员权限 |
OP |
piemotd.* |
所有权限 |
— |
WebUI 使用方法
- 在控制台中运行
/piemotd webui token —— 将打印出令牌和访问 URL
- 在浏览器中打开该 URL(PATH 模式下为反向代理地址)
- 输入令牌;令牌为一次性使用——如果过期或输错,请重新生成一个新的
- 编辑配置;MOTD 和欢迎标题会实时渲染
- 点击“保存并应用”——更改立即生效
常见问题
WebUI 无法打开?
请检查 webui.enabled 是否为 true,端口是否未被占用且防火墙允许访问;在 PATH 模式下,确保反向代理路径与 base-path 匹配。
令牌过期或输错?
再次在控制台中运行 /piemotd webui token —— 旧令牌会自动失效。
上传图片是否有大小要求?
没有——任何尺寸都会被缩放至 64x64 并以 PNG 格式存储。请注意,服务器列表图标以 64x64 渲染,因此过小的源图放大后会显得模糊。
控制台横幅或中文文本乱码?
这是终端编码问题;请确保启动脚本中包含 -Dfile.encoding=UTF-8(Paper 的默认启动脚本已包含此项)。
为什么预览中没有替换变量?
变量会在每次 ping 请求时进行替换。预览界面显示的是占位符标签;服务器列表显示的是实际值。
许可证
[MIT License](LICENSE) © 2026 R3_141
PieMotd
Dynamic MOTD, server icon and join welcome title plugin for Paper 1.20.4+, with a built-in WebUI for managing the entire configuration from a browser.
v2.1.0 · Paper 1.20.4+ · Java 21 · MIT License
Features
- MOTD supports MiniMessage format (gradients, rainbow, hex colors) with multiple rotating messages
- Rotation is time-driven — the configured interval is honored exactly regardless of ping frequency; rotation method (random/sequential) and rotation timing (interval/per ping) can be combined independently
- Server icon rotation with three modes: random, sequential, hourly; the rotation list is automatically taken from all images in the icons directory
- Join welcome title and sound with three display modes: every join, first join only, once per day (persisted in player data, survives restarts)
- Multi-language support; language files are split under
lang/ and switching only requires a config change
- Built-in WebUI — no need to edit YAML by hand (see below)


WebUI

After startup the plugin runs a local HTTP service. Open it in a browser to manage the entire configuration — saving reloads automatically.
It mainly solves two day-to-day hassles:
Live MiniMessage preview. Gradients, rainbow and variables of the MOTD and welcome title are rendered directly on the page as they will appear in-game. Variables are shown as readable labels (%online% becomes "online players", hover to see the raw form). Changing a MOTD no longer means the edit → reload → open-the-server-list loop; broken tags are visible immediately.
Upload icons from the browser. Images of any size are automatically scaled to 64x64, named icon1, icon2… in order and added to the rotation list; unwanted ones can be deleted from the same page. No image editor for resizing, no FTP, no manual config edits.

Other details:
- Every option in config.yml has a matching control — no manual file editing required
- Saving writes to the original config file and keeps comments; numeric ranges, path validity and enum values are validated, invalid values keep the original and produce a warning
- The top bar shows the plugin version, MC version, online players and TPS
Security:
- Login tokens can only be generated from the server console — 128-bit random, single use, 10 minute expiry by default
- Sessions use an HttpOnly + SameSite=Strict cookie, 12 hours by default with sliding renewal
- The login endpoint is rate limited: 10 consecutive failures blocks the IP for 60 seconds
- File read and delete endpoints are restricted to the plugin directory; config writes validate ranges and enum values against whitelists
Two deployment modes
Switch via webui.mode in config.yml.
PORT (default): the WebUI listens on its own port — for VPS or dedicated servers, access http://serverIP:8080/ directly.
PATH: the WebUI is mounted under a sub-path, for panel hosts with only one open port. A reverse proxy forwards the external path to the plugin:
location /piemotd/ {
proxy_pass http://127.0.0.1:8080/piemotd/;
}
The routing / reverse-proxy features of panels like MCSManager and Pterodactyl work the same way. Frontend assets and APIs use relative paths, so both modes work without changing the page.
For this scenario it is recommended to set webui.bind to 127.0.0.1, so only the panel's local forwarding can reach the service.
Installation
- Server: Paper 1.20.4+ (or forks), Java 21+
- Drop
PieMotd-2.1.0.jar into plugins/ and restart the server
- The following files are generated automatically:
plugins/PieMotd/
├── config.yml # main configuration
├── lang/
│ ├── zh_cn.yml # 简体中文
│ └── en_us.yml # English
└── icons/
└── default.png # default icon
Configuration
Full config.yml
motd:
enabled: true # enable MOTD
update-interval: 10 # rotation interval (seconds)
update-enabled: true # true=rotate by interval / false=switch on every ping
random: true # true=pick randomly / false=sequential
messages: [] # MOTD list, supports MiniMessage and variables
server-icon:
enabled: true # enable icon rotation
default: "icons/default.png" # default icon (used when the icons folder is empty)
rotation-interval: 10.0 # rotation interval (seconds)
rotation-mode: "RANDOM" # RANDOM / SEQUENTIAL / TIME(hourly)
# the rotation list = every image in the icons folder (upload/delete in the WebUI)
welcome:
enabled: true
display-mode: "EVERY_TIME" # EVERY_TIME / FIRST_JOIN / ONCE_PER_DAY
title:
main: "" # main title, supports %player%
subtitle: "" # subtitle
fade-in: 20 # fade in (ticks)
stay: 100 # stay (ticks)
fade-out: 20 # fade out (ticks)
sound:
enabled: true
sound: "entity.player.levelup"
volume: 1.0
pitch: 1.0
settings:
language: "zh_cn" # file name inside lang/
webui:
enabled: true # enable the WebUI
mode: "PORT" # PORT(standalone) / PATH(sub-path)
bind: "0.0.0.0" # listen address
port: 8080 # listen port
base-path: "/piemotd" # sub-path in PATH mode
token-expire-minutes: 10 # login token validity (minutes, single use)
session-expire-hours: 12 # session validity after login (hours)
Variables
| Variable |
Description |
%online% / %max_players% |
online players / max players |
%tps% |
server TPS |
%time% / %date% |
current time / date |
%memory_used% / %memory_max% |
used / max memory (MB) |
%server_version% |
server version |
%player% / %player_count% |
player name / player count (welcome title only) |
Variables are substituted on every ping. /piemotd preview and the WebUI preview show placeholder labels; the server list shows real values.
Commands
| Command |
Description |
Permission |
/piemotd reload |
reload the entire configuration (aliases /pmotd, /pm) |
piemotd.reload |
/piemotd preview |
preview the current MOTD in chat |
piemotd.admin |
/piemotd webui token |
generate a WebUI login token, console only |
piemotd.admin |
/piemotd help |
show help |
none |
Permissions
| Permission |
Description |
Default |
piemotd.reload |
reload the configuration |
OP |
piemotd.admin |
admin permission |
OP |
piemotd.* |
all permissions |
— |
WebUI usage
- Run
/piemotd webui token in the console — the token and access URL are printed
- Open the URL in a browser (PATH mode: the reverse proxy address)
- Enter the token; tokens are single use — generate a new one if it expires or you mistype it
- Edit the configuration; MOTD and welcome title render live
- Click "Save and apply" — changes take effect immediately
FAQ
The WebUI doesn't open?
Check that webui.enabled is true, the port is not in use and the firewall allows it; in PATH mode make sure the reverse proxy path matches base-path.
Token expired or mistyped?
Run /piemotd webui token in the console again — old tokens are invalidated automatically.
Are there image size requirements for uploads?
No — any size is scaled to 64x64 and stored as PNG. Keep in mind the server list renders icons at 64x64, so very small sources will look blurry when upscaled.
Console banner or Chinese text garbled?
A terminal encoding issue; make sure the startup script contains -Dfile.encoding=UTF-8 (included in Paper's default startup script).
Why aren't variables replaced in the preview?
Variables are substituted on every ping. Previews show placeholder labels; the server list shows real values.
License
[MIT License](LICENSE) © 2026 R3_141
评论 0
登录后参与评分
还没有评论,来抢沙发吧