mMotd
快速、带缓存的服务器列表资料,支持排程、维护控制及以隐私优先的分析统计。
功能特性
- 支持渐变效果的 MiniMessage 双行 MOTD,并配备一秒不可变渲染缓存。
- 支持加权随机条目以及基于星期几和时间的优先级排程,包括跨夜时段。
- 支持针对精确或通配符主机名、客户端协议范围、首次连接请求和重复连接请求的资料配置。
- 提供维护模式 MOTD、踢出消息、权限绕过、精确 IP 白名单以及持久化的开启/关闭命令。
- 当启用内置服务器白名单时,自动显示白名单 MOTD。
- 每个资料独立使用本地 64×64 像素图标,并具备路径和符号链接转义保护。
- 支持实际、偏移、固定或隐藏的玩家数量显示;自定义悬停样本及协议/版本标签。
- 支持事件倒计时占位符,并可指定时区。
- 可选的内存中“从 ping 到加入”分析统计,支持 TTL(生存时间)和严格的地址限制。
- 默认英文,附带完整的
en_US 和 ru_RU 语言文件。
Ping 处理器从不读取文件、查询数据库、解析 DNS、调用 PlaceholderAPI 或读取世界状态。它仅选择一个已渲染的不可变条目,并更新一个可选的有界内存计数器。
要求与安装
- Java 25
- Paper、Purpur 或 Folia 26.3
- 将
mMotd-1.1.1.jar 放入服务器的 plugins 目录。
- 启动服务器一次。
- 编辑
plugins/mMotd/config.yml。
- 运行
/mmotd reload。
默认语言为英语。设置 language: ru_RU 并重新加载,即可将所有命令反馈切换为俄语。现有的语言文件会自动接收新添加的默认键值。
资料 (Profiles)
motd:
entries:
- id: default
weight: 3
audience: ANY
hosts: []
protocol: { min: -1, max: -1 }
line1: "<gradient:#00FF87:#60EFFF><bold>SERVER</bold></gradient>"
line2: "<gray>Online: <white>{online}/{max}</white> · Event in {countdown}"
text: "Welcome"
- id: events
weight: 1
audience: RETURNING
hosts: ["events.example.com", "*.event.example.com"]
protocol: { min: -1, max: -1 }
line1: "<gold><bold>EVENT NETWORK</bold>"
line2: "<gray>Join the next event in <white>{countdown}</white>"
schedule:
- days: [FRIDAY, SATURDAY]
time: "18:00-02:00"
entry: events
priority: 100
必须存在一个全局 ANY 条目(无主机名或协议限制),作为安全回退方案。无效条目和排程会单独报告;如果重新加载后没有有效的回退方案,则拒绝操作且不会替换当前正在使用的缓存。
支持的占位符包括:{online}、{max}、{tps}、{version}、{time}、{date}、{unique_players}、{motd_line}、{countdown}、{countdown_days}、{countdown_hours}、{countdown_minutes} 和 {countdown_seconds}。
将 countdown.target 设置为带有偏移量的 ISO-8601 值,例如 2026-12-31T18:00:00+03:00。将 time-zone 设置为 system 或 IANA 时区(如 Europe/Moscow)。
图标、玩家显示与安全
图标路径相对于 plugins/mMotd 目录,即使通过符号链接也必须解析在该目录内,并且必须指向有效的 64×64 PNG 文件。缺失或无效的文件将被跳过,而资料的其余部分仍可使用。
配置输入受到限制:条目、排程、悬停文本、文本长度、权重、协议范围、主机名模式、IP 白名单和分析缓存大小均设有安全上限。动态命令错误文本作为未解析的 MiniMessage 数据插入。
由于加载离线玩家列表可能开销较大,{unique_players} 的刷新频率故意低于在线人数和 TPS。如有需要,可更改 cache.unique-player-refresh-seconds。
命令与权限
| 命令 |
权限 |
描述 |
/mmotd preview |
mmotd.command.preview |
显示当前的回退预览 |
/mmotd reload |
mmotd.command.reload |
验证配置并原子性地替换缓存 |
/mmotd maintenance on|off |
mmotd.command.maintenance |
持久化切换维护模式 |
/mmotd stats |
mmotd.command.stats |
显示本地 ping 和转化统计数据 |
mmotd.admin 授予所有命令权限以及 mmotd.maintenance.bypass。
本地分析与遥测
本地 Ping 分析默认处于禁用状态。启用后,客户端地址会立即转换为加盐的 SHA-256 哈希值,仅保留在内存中,上限为 analytics.max-unique-addresses,并在经过 analytics.address-ttl-minutes 分钟后移除。原始地址和哈希值永远不会被持久化或发送到外部。重启服务器将重置盐值和所有本地统计数据。
mMotd 单独使用匿名的 bStats 指标。不会收集任何 IP 地址、哈希值、MOTD 文本、主机名或玩家标识符。可以通过设置 metrics.enabled: false 来禁用 bStats。
更新检查器仅读取公共 Modrinth 版本元数据。它绝不会下载或替换 JAR 文件,并且可以通过设置 updates.enabled: false 来禁用。
构建
./gradlew clean build
根据 MIT 许可证授权。
mMotd
Fast, cached server-list profiles with schedules, maintenance controls, and privacy-first analytics.
Features
- Two-line MiniMessage MOTDs with gradients and a one-second immutable render cache.
- Weighted random entries and priority-based weekday/time schedules, including overnight windows.
- Profiles for exact or wildcard hostnames, client protocol ranges, first-time pings, and returning pings.
- Maintenance MOTD, kick message, permission bypass, exact IP whitelist, and persistent on/off command.
- Automatic whitelist MOTD while the built-in server whitelist is enabled.
- Local 64×64 favicons per profile, with path and symlink escape protection.
- Actual, offset, fixed, or hidden player counts; custom hover sample and protocol/version label.
- Event countdown placeholders with an explicit time zone.
- Optional in-memory ping-to-join analytics with TTL and a strict address limit.
- English by default, with complete bundled
en_US and ru_RU language files.
The ping handler never reads files, queries a database, resolves DNS, invokes PlaceholderAPI, or reads world state. It only selects an already-rendered immutable entry and updates an optional bounded in-memory counter.
Requirements and installation
- Java 25
- Paper, Purpur, or Folia 26.3
- Put
mMotd-1.1.1.jar in the server's plugins directory.
- Start the server once.
- Edit
plugins/mMotd/config.yml.
- Run
/mmotd reload.
English is the default. Set language: ru_RU and reload to switch all command feedback to Russian. Existing language files automatically receive newly added default keys.
Profiles
motd:
entries:
- id: default
weight: 3
audience: ANY
hosts: []
protocol: { min: -1, max: -1 }
line1: "<gradient:#00FF87:#60EFFF><bold>SERVER</bold></gradient>"
line2: "<gray>Online: <white>{online}/{max}</white> · Event in {countdown}"
text: "Welcome"
- id: events
weight: 1
audience: RETURNING
hosts: ["events.example.com", "*.event.example.com"]
protocol: { min: -1, max: -1 }
line1: "<gold><bold>EVENT NETWORK</bold>"
line2: "<gray>Join the next event in <white>{countdown}</white>"
schedule:
- days: [FRIDAY, SATURDAY]
time: "18:00-02:00"
entry: events
priority: 100
A global ANY entry without hostname or protocol limits is required as a safe fallback. Invalid entries and schedules are reported individually; a reload with no valid fallback is rejected without replacing the live cache.
Supported placeholders are {online}, {max}, {tps}, {version}, {time}, {date}, {unique_players}, {motd_line}, {countdown}, {countdown_days}, {countdown_hours}, {countdown_minutes}, and {countdown_seconds}.
Set countdown.target to an ISO-8601 value with an offset, for example 2026-12-31T18:00:00+03:00. Set time-zone to system or an IANA zone such as Europe/Moscow.
Icons, player display, and safety
Icon paths are relative to plugins/mMotd, must resolve inside that directory even through symlinks, and must point to valid 64×64 PNG files. Missing or invalid files are skipped while the rest of the profile remains usable.
Configuration input is bounded: entries, schedules, hover lines, text length, weights, protocol ranges, hostname patterns, IP whitelist, and analytics cache size all have safe limits. Dynamic command error text is inserted as unparsed MiniMessage data.
{unique_players} is deliberately refreshed less often than online count and TPS because loading the offline-player list can be expensive. Change cache.unique-player-refresh-seconds if needed.
Commands and permissions
| Command |
Permission |
Description |
/mmotd preview |
mmotd.command.preview |
Show the current fallback preview |
/mmotd reload |
mmotd.command.reload |
Validate configuration and atomically replace the cache |
/mmotd maintenance on|off |
mmotd.command.maintenance |
Persistently toggle maintenance mode |
/mmotd stats |
mmotd.command.stats |
Show local ping and conversion statistics |
mmotd.admin grants every command permission and mmotd.maintenance.bypass.
Local analytics and telemetry
Local ping analytics are disabled by default. When enabled, client addresses are immediately transformed into salted SHA-256 hashes, retained only in memory, bounded by analytics.max-unique-addresses, and removed after analytics.address-ttl-minutes. Raw addresses and hashes are never persisted or sent externally. Restarting the server resets the salt and all local statistics.
mMotd separately uses anonymous bStats metrics. No IP addresses, hashes, MOTD text, hostnames, or player identifiers are collected. Disable bStats with metrics.enabled: false.
The update checker only reads public Modrinth version metadata. It never downloads or replaces JAR files and can be disabled with updates.enabled: false.
Build
./gradlew clean build
Licensed under the MIT License.
评论 0
登录后参与评分
还没有评论,来抢沙发吧