MiniMessageBridge
全局旧版到 MiniMessage 的翻译层

无需触碰任何配置文件,即可转换所有插件的颜色代码
什么是 MiniMessageBridge?
MiniMessageBridge 是一个高性能数据包拦截器,能够实时将 Minecraft 的旧版颜色代码(§ 和 &)转换为现代 MiniMessage 格式。
问题所在:
旧插件使用丑陋的 §c&l 格式化代码,在现代服务器上看起来非常糟糕。你想要鲜艳的红石色、渐变色和悬停效果,但这些插件并不支持 MiniMessage。
解决方案:
MiniMessageBridge 位于你的插件和玩家之间。它会拦截每一个出站聊天数据包,检测旧版格式化代码,并立即将其转换为你自定义的 MiniMessage 定义。
插件发送: §c§lHello World
玩家看到: Hello World
(亮粉色粗体文本)
功能特性
- 零配置要求 - 开箱即用,具备合理的默认设置
- 数据包级拦截 - 在协议层面修改输出,影响所有插件
- 通用兼容性 - 适用于任何插件中的硬编码消息
- 高性能 - 使用 Caffeine 缓存,拥有 5000 条目的 LRU 缓存
- 运行时可配置 - 重新加载配置而无需重启服务器
- 现代 Paper 支持 - 完全兼容 Paper 1.20+ Adventure API
- 高级 MiniMessage - 支持渐变、彩虹色、悬停事件、点击事件
- 选择性拦截 - 选择要修改的数据包类型
- 调试模式 - 详细的日志记录以便故障排除
- bStats 集成 - 匿名使用统计数据
工作原理

1. 检测
插件使用旧版代码发送消息:
§cError: Invalid command
2. 拦截
ProtocolLib 在数据包到达玩家之前捕获出站 SYSTEM_CHAT 数据包
3. 序列化
数据包的 Adventure Component 被转换回旧版格式以检测格式化代码
4. 翻译
旧版代码与你的配置映射进行匹配,并转换为 MiniMessage 标签
5. 渲染
MiniMessage 将标签反序列化为包含红石色的现代 Adventure Component
6. 交付
修改后的数据包以美观的现代格式化方式发送给玩家
安装指南
前置要求:
- Paper 1.20+(或其分支如 Purpur, Pufferfish)
- ProtocolLib 5.1.0+
- Java 17+
步骤:
- 下载 ProtocolLib 并将其放入你的 plugins/ 文件夹
- 下载 MiniMessageBridge 并将其放入你的 plugins/ 文件夹
- 启动服务器
- 编辑 plugins/MiniMessageBridge/config.yml 以自定义你的配色方案
- 运行 /mmb reload 或重启服务器以应用更改
默认配置结构:
legacy-mappings:
"&c": "<#ff3860>" # 将 &c 映射为亮粉色
"&a": "<#00ff41>" # 将 &a 映射为霓虹绿
"§c": "<#ff3860>" # 同时映射节符号变体
format-mappings:
"&l": "<bold>" # 粗体格式化
"&r": "<reset>" # 重置所有格式化
settings:
enable-cache: true # 启用翻译缓存
debug: false # 调试日志
packet-interception:
system-chat: true # 拦截服务器消息
action-bar: true # 拦截动作栏
高级示例 - 渐变:
legacy-mappings:
"&c": "<gradient:#ff3860:#ff0000>" # 红色渐变
"&a": "<rainbow>" # 彩虹循环
"&6": "<hover:show_text:'<gold>Click!'><gold>" # 悬停文本
性能表现
- 翻译缓存消除了对相同消息的重复解析
- 使用并发数据结构确保线程安全
- 平均额外开销:<每条约 0.1ms
- 内存占用:5000 个缓存条目约 ~10MB
- 处理现代 MiniMessage 插件时零影响(旁路模式)
支持
Github
Discord
MiniMessageBridge
Global Legacy-to-MiniMessage Translation Layer

Transform every plugin's colors without touching a single config file
What is MiniMessageBridge?
MiniMessageBridge is a high-performance packet interceptor that globally translates legacy Minecraft color codes (§ and &) into modern MiniMessage format in real-time.
The Problem:
Old plugins use ugly §c&l formatting that looks terrible on modern servers. You want vibrant hex colors, gradients, and hover effects, but those plugins don't support MiniMessage.
The Solution:
MiniMessageBridge sits between your plugins and your players. It intercepts every outgoing chat packet, detects legacy formatting, and instantly translates it to your custom MiniMessage definitions.
Plugin sends: §c§lHello World
Player sees: Hello World
(Hot pink bold text)
Features
- Zero Configuration Required - Works out of the box with sensible defaults
- Packet-Level Interception - Modifies output at the protocol level, affects ALL plugins
- Universal Compatibility - Works with hardcoded messages from any plugin
- High Performance - Caffeine caching with 5000 entry LRU cache
- Runtime Configurable - Reload configs without restart
- Modern Paper Support - Fully compatible with Paper 1.20+ Adventure API
- Advanced MiniMessage - Support for gradients, rainbows, hover events, click events
- Selective Interception - Choose which packet types to modify
- Debug Mode - Detailed logging for troubleshooting
- bStats Integration - Anonymous usage statistics
How It Works

1. Detection
Plugin sends a message using legacy codes:
§cError: Invalid command
2. Interception
ProtocolLib catches the outgoing SYSTEM_CHAT packet before it reaches the player
3. Serialization
The packet's Adventure Component is converted back to legacy format to detect formatting codes
4. Translation
Legacy codes are matched against your config mappings and converted to MiniMessage tags
5. Rendering
MiniMessage deserializes the tags into a modern Adventure Component with hex colors
6. Delivery
The modified packet is sent to the player with beautiful modern formatting
Installation
Requirements:
- Paper 1.20+ (or forks like Purpur, Pufferfish)
- ProtocolLib 5.1.0+
- Java 17+
Steps:
- Download ProtocolLib and place it in your plugins/ folder
- Download MiniMessageBridge and place it in your plugins/ folder
- Start your server
- Edit plugins/MiniMessageBridge/config.yml to customize your color scheme
- Run /mmb reload or restart to apply changes
Default Config Structure:
legacy-mappings:
"&c": "<#ff3860>" # Map &c to hot pink
"&a": "<#00ff41>" # Map &a to neon green
"§c": "<#ff3860>" # Also map section symbol variant
format-mappings:
"&l": "<bold>" # Bold formatting
"&r": "<reset>" # Reset all formatting
settings:
enable-cache: true # Enable translation caching
debug: false # Debug logging
packet-interception:
system-chat: true # Intercept server messages
action-bar: true # Intercept action bar
Advanced Example - Gradients:
legacy-mappings:
"&c": "<gradient:#ff3860:#ff0000>" # Red gradient
"&a": "<rainbow>" # Rainbow cycling
"&6": "<hover:show_text:'<gold>Click!'><gold>" # Hover text
Performance
- Translation cache eliminates re-parsing of identical messages
- Concurrent data structures for thread safety
- Average overhead: <0.1ms per message
- Memory usage: ~10MB for 5000 cached entries
- Zero impact when processing modern MiniMessage plugins (bypass mode)
Support
Github
Discord
评论 0
登录后参与评分
还没有评论,来抢沙发吧