DragonChat
技术文档
概述
DragonChat 是一款面向 Paper 1.21.11 的下一代聊天插件,旨在用现代、快速且高度可配置的通信系统完全替换 Minecraft 原版聊天功能。
DragonChat 基于 Java 21、Paper API 以及 Adventure/MiniMessage 构建,在保持与现代 Paper 服务器完全兼容的同时,提供丰富的文本格式、卓越的性能和最大的灵活性。
其模块化架构允许通过配置文件单独启用或禁用每个功能,因此既适合小型社区,也适用于大规模网络。
主要目标
DragonChat 的设计旨在实现以下目标:
- 完全替换原版聊天系统。
- 同时支持现代和旧版格式化。
- 提供模块化架构,其中每个功能均可启用或禁用。
- 与 LuckPerms 和 PlaceholderAPI 进行深度集成。
- 在高玩家数量的服务器上保持卓越性能。
- 通过先进的聊天拦截系统最小化与其他聊天插件的冲突。
聊天系统
DragonChat 使用 Paper 的 AsyncChatEvent 作为其主要聊天处理器。
当 chat.force-chat-handler 启用时,插件将完全抑制原版聊天并成为唯一的消息渲染器。
为了确保这一行为——即使在运行多个聊天插件的服务器上——DragonChat 注册了两个优先级的抑制监听器:
- LOWEST(最低)优先级
- MONITOR(监控)优先级
它还拦截 Paper 的旧版聊天事件,防止其他插件在 DragonChat 已经处理完消息后恢复原版聊天。
这确保了 DragonChat 始终作为活跃的聊天处理器。
支持的聊天格式化
DragonChat 同时支持多种格式化系统。
MiniMessage
<red>Hello</red>
旧版 & 颜色代码
&cHello
旧版 § 颜色代码
§cHello
HEX 颜色
&#FF0000Hello
渐变
<gradient:#FFD700:#FF0000>DRAGON</gradient>
彩虹色
<rainbow>Hello</rainbow>
文本装饰
- 粗体 (Bold)
- 斜体 (Italic)
- 下划线 (Underline)
- 删除线 (Strikethrough)
- 乱码/魔法字符 (Obfuscated/Magic)
- 重置 (Reset)
拥有相应权限的玩家可以自由使用 MiniMessage 标签、& 颜色代码和 § 颜色代码。
基于权限的格式化
DragonChat 会自动移除玩家无权使用的格式化内容。
支持的权限包括:
chat.color
chat.hex
chat.gradient
chat.rainbow
chat.format.bold
chat.format.italic
chat.format.underline
chat.format.strikethrough
chat.format.obfuscated
这些权限与 LuckPerms 完全兼容。
群组格式化
DragonChat 直接与 LuckPerms 集成。
插件会自动检测每个玩家的主组,并根据该组应用可配置的聊天格式。
每个组可以拥有独立的:
- 前缀 (Prefix)
- 后缀 (Suffix)
- 颜色
- 聊天布局
- 占位符配置
PlaceholderAPI 支持
如果安装了 PlaceholderAPI,DragonChat 会自动解析所有可配置格式中的占位符。
无需额外设置。
重载系统
DragonChat 包含一个安全的重载命令。
/dragonchat reload
别名:
/dchat reload
重载操作包括:
- 重新加载
config.yml
- 清除缓存的群组格式
- 重新加载格式化设置
- 刷新运行时配置
所需权限:
chat.reload
私聊
DragonChat 包含一个完全可配置的私聊系统。
主命令:
/msg
别名:
/tell
/w
/message
/pm
可配置选项包括:
msg.sent-format
msg.received-format
msg.sound.enabled
msg.sound.name
msg.sound.volume
msg.sound.pitch
提及系统
DragonChat 支持使用以下格式提及玩家:
@PlayerName
当玩家被提及时,插件可以自动执行以下操作:
- 高亮显示玩家名称
- 播放可配置的声音
- 显示动作栏 (Action Bar)
- 显示标题 (Title)
- 显示副标题 (Subtitle)
所有行为均可配置。
禁言系统
DragonChat 包含一套完整的 moderation(管理)系统。
命令:
/mute
/tempmute
/unmute
/mutelist
/checkmute
禁言数据存储在:
mutes.yml
插件将禁言信息缓存在内存中,以便在聊天事件中快速查找。
加入、离开及死亡消息
DragonChat 完全替换了 Minecraft 的默认服务器消息。
支持的消息类型包括:
- 玩家加入 (Player Join)
- 玩家离开 (Player Quit)
- 死亡消息 (Death Messages)
死亡消息支持多种死因,包括:
- PvP
- 摔落伤害
- 岩浆
- 火焰
- 爆炸
- 虚空
- 溺水
- 闪电
- 饥饿
每条消息均可完全自定义配置。
性能
DragonChat 已针对高性能 Paper 服务器进行了优化。
关键优化包括:
- 缓存群组格式
- 内存中存储禁言数据
- 异步聊天处理
- 最小化对象分配
- 高效的 MiniMessage 解析
当强制聊天模式启用时,聊天格式处理是异步进行的,而最终的消息传递安全地传输到主服务器线程,以最大程度地兼容其他插件。
配置文件
config.yml
主配置文件,包含:
- 聊天设置
- 群组格式
- 提及设置
- 私聊设置
- 禁言设置
- 加入/离开消息
- 死亡消息
- 模块开关
plugin.yml
包含:
mutes.yml
用于持久化存储所有活跃和临时禁言的数据文件。
兼容性
DragonChat 专为以下环境构建:
可选集成:
结语
DragonChat 是一款为现代 Minecraft 服务器打造的专业级聊天解决方案。
它将完全模块化的架构、高级文本格式化、高性能异步处理以及与其他最流行的服务器插件的深度集成相结合。
无论您运行的是小型社区服务器还是大型网络,DragonChat 都提供了对 Minecraft 原版聊天的完整替代方案,具备最大的灵活性、性能和兼容性。
CONFIG.YML
Spoiler
modules:
chat: true
joinquit: true
death: true
mute: true
mention: true
msg: true
chat:
event-priority: HIGHEST
force-chat-handler: true
allow-cancelled-override: true
format-cache-seconds: 30
default-format: "<gray>[<white>%dragonchat_group%</white>]</gray> %player_displayname% <dark_gray>»</dark_gray> %message%"
groups:
owner:
chat-format: "<gradient:#FFD700:#FF0000><bold>OWNER</bold></gradient> %player_displayname% <dark_gray>»</dark_gray> %message%"
join-message: "<green>+</green> <gradient:#FFD700:#FF0000>%player_name%</gradient>"
quit-message: "<red>-</red> <gradient:#FFD700:#FF0000>%player_name%</gradient>"
death-message: "<red>%player_name% has fallen as a dragon would.</red>"
default:
chat-format: "<gray>%player_name%</gray> <dark_gray>»</dark_gray> %message%"
join-message: "<green>+</green> <gray>%player_name%</gray>"
quit-message: "<red>-</red> <gray>%player_name%</gray>"
death-message: "<red>%player_name% died.</red>"
mention:
format: "<yellow><bold>@%player_name%</bold></yellow>"
sound: "minecraft:block.note_block.pling"
volume: 1.0
pitch: 1.2
actionbar: "<yellow>%sender_name% mentioned you.</yellow>"
title: ""
subtitle: ""
msg:
sent-format: "&f[ A &b%target_name% &f] %message%"
received-format: "&f[ Da &b%source_name% &f] %message%"
usage: "<red>Usage: /msg <player> <message></red>"
offline: "<red>%target_name% is not online.</red>"
self-message: "<red>You cannot message yourself.</red>"
no-permission: "<red>You do not have permission.</red>"
sound:
enabled: true
name: "minecraft:block.note_block.pling"
volume: 1.0
pitch: 1.2
mute:
message: "<red>You are muted.</red> <gray>Reason:</gray> <white>%reason%</white> <gray>Expires:</gray> <white>%expires%</white>"
broadcast: "<red>%target%</red> <gray>was muted by</gray> <white>%sender%</white><gray>.</gray>"
unmute-message: "<green>%target% is no longer muted.</green>"
death-messages:
pvp: "<red>%player_name% was slain by %killer_name%.</red>"
fall: "<red>%player_name% hit the ground too hard.</red>"
lava: "<red>%player_name% tried to swim in lava.</red>"
fire: "<red>%player_name% burned.</red>"
explosion: "<red>%player_name% exploded.</red>"
void: "<red>%player_name% fell into the void.</red>"
drowning: "<red>%player_name% drowned.</red>"
lightning: "<red>%player_name% was struck by lightning.</red>"
hunger: "<red>%player_name% starved.</red>"
default: "<red>%player_name% died.</red>"
DragonChat
Technical Documentation
Overview
DragonChat is a next-generation chat plugin for Paper 1.21.11, designed to completely replace Minecraft's vanilla chat with a modern, fast, and highly configurable communication system.
Built with Java 21, the Paper API, and Adventure/MiniMessage, DragonChat delivers rich text formatting, excellent performance, and maximum flexibility while remaining fully compatible with modern Paper servers.
Its modular architecture allows every feature to be individually enabled or disabled through the configuration, making it suitable for both small communities and large-scale networks.
Main Goals
DragonChat has been designed with the following objectives:
- Completely replace the vanilla chat system.
- Support both modern and legacy formatting simultaneously.
- Provide a modular architecture where every feature can be enabled or disabled.
- Offer deep integration with LuckPerms and PlaceholderAPI.
- Maintain excellent performance on high-player-count servers.
- Minimize conflicts with other chat plugins through an advanced chat interception system.
Chat System
DragonChat uses Paper's AsyncChatEvent as its primary chat handler.
When chat.force-chat-handler is enabled, the plugin completely suppresses the vanilla chat and becomes the only message renderer.
To guarantee this behavior—even on servers running multiple chat plugins—DragonChat registers suppression listeners at both:
- LOWEST priority
- MONITOR priority
It also intercepts Paper's legacy chat events, preventing other plugins from restoring the vanilla chat after DragonChat has already processed the message.
This ensures DragonChat always remains the active chat handler.
Supported Chat Formatting
DragonChat supports multiple formatting systems simultaneously.
MiniMessage
<red>Hello</red>
Legacy Ampersand Colors
&cHello
Legacy Section Sign Colors
§cHello
HEX Colors
&#FF0000Hello
Gradients
<gradient:#FFD700:#FF0000>DRAGON</gradient>
Rainbow
<rainbow>Hello</rainbow>
Text Decorations
- Bold
- Italic
- Underline
- Strikethrough
- Obfuscated (Magic)
- Reset
Players can freely use MiniMessage tags, & color codes, and § color codes when they have the appropriate permissions.
Permission-Based Formatting
DragonChat automatically removes formatting that the player is not allowed to use.
Supported permissions include:
chat.color
chat.hex
chat.gradient
chat.rainbow
chat.format.bold
chat.format.italic
chat.format.underline
chat.format.strikethrough
chat.format.obfuscated
Permissions are fully compatible with LuckPerms.
Group Formatting
DragonChat integrates directly with LuckPerms.
The plugin automatically detects each player's primary group and applies a configurable chat format based on that group.
Each group may have its own:
- Prefix
- Suffix
- Colors
- Chat layout
- Placeholder configuration
PlaceholderAPI Support
If PlaceholderAPI is installed, DragonChat automatically parses placeholders inside every configurable format.
No additional setup is required.
Reload System
DragonChat includes a safe reload command.
/dragonchat reload
Alias:
/dchat reload
The reload operation:
- Reloads
config.yml
- Clears cached group formats
- Reloads formatting settings
- Refreshes runtime configuration
Required permission:
chat.reload
Private Messaging
DragonChat includes a fully configurable private messaging system.
Main command:
/msg
Aliases:
/tell
/w
/message
/pm
Configurable options include:
msg.sent-format
msg.received-format
msg.sound.enabled
msg.sound.name
msg.sound.volume
msg.sound.pitch
Mention System
DragonChat supports player mentions using:
@PlayerName
When a player is mentioned, the plugin can automatically:
- Highlight the player's name
- Play a configurable sound
- Display an Action Bar
- Show a Title
- Show a Subtitle
All behaviors are configurable.
Mute System
DragonChat includes a complete moderation system.
Commands:
/mute
/tempmute
/unmute
/mutelist
/checkmute
Mute data is stored inside:
mutes.yml
The plugin keeps mute information cached in memory for fast lookup during chat events.
Join, Quit & Death Messages
DragonChat fully replaces Minecraft's default server messages.
Supported message types include:
- Player Join
- Player Quit
- Death Messages
Death messages support multiple causes, including:
- PvP
- Fall Damage
- Lava
- Fire
- Explosion
- Void
- Drowning
- Lightning
- Starvation
Every message is fully configurable.
Performance
DragonChat has been optimized for high-performance Paper servers.
Key optimizations include:
- Cached group formats
- In-memory mute storage
- Asynchronous chat processing
- Minimal object allocation
- Efficient MiniMessage parsing
When Force Chat Mode is enabled, chat formatting is processed asynchronously, while the final message delivery is safely transferred to the main server thread for maximum compatibility with other plugins.
Configuration Files
config.yml
Main configuration file containing:
- Chat settings
- Group formats
- Mentions
- Private messages
- Mute settings
- Join/Quit messages
- Death messages
- Module toggles
plugin.yml
Contains:
- Commands
- Permissions
- Plugin metadata
- Optional dependencies
mutes.yml
Persistent storage for all active and temporary mutes.
Compatibility
DragonChat is built specifically for:
Optional integrations:
Conclusion
DragonChat is a professional-grade chat solution built for modern Minecraft servers.
It combines a fully modular architecture, advanced text formatting, high-performance asynchronous processing, and deep integration with the most popular server plugins.
Whether you're running a small community server or a large network, DragonChat provides a complete replacement for Minecraft's vanilla chat with maximum flexibility, performance, and compatibility.
CONFIG.YML
Spoiler
modules:
chat: true
joinquit: true
death: true
mute: true
mention: true
msg: true
chat:
event-priority: HIGHEST
force-chat-handler: true
allow-cancelled-override: true
format-cache-seconds: 30
default-format: "<gray>[<white>%dragonchat_group%</white>]</gray> %player_displayname% <dark_gray>»</dark_gray> %message%"
groups:
owner:
chat-format: "<gradient:#FFD700:#FF0000><bold>OWNER</bold></gradient> %player_displayname% <dark_gray>»</dark_gray> %message%"
join-message: "<green>+</green> <gradient:#FFD700:#FF0000>%player_name%</gradient>"
quit-message: "<red>-</red> <gradient:#FFD700:#FF0000>%player_name%</gradient>"
death-message: "<red>%player_name% has fallen as a dragon would.</red>"
default:
chat-format: "<gray>%player_name%</gray> <dark_gray>»</dark_gray> %message%"
join-message: "<green>+</green> <gray>%player_name%</gray>"
quit-message: "<red>-</red> <gray>%player_name%</gray>"
death-message: "<red>%player_name% died.</red>"
mention:
format: "<yellow><bold>@%player_name%</bold></yellow>"
sound: "minecraft:block.note_block.pling"
volume: 1.0
pitch: 1.2
actionbar: "<yellow>%sender_name% mentioned you.</yellow>"
title: ""
subtitle: ""
msg:
sent-format: "&f[ A &b%target_name% &f] %message%"
received-format: "&f[ Da &b%source_name% &f] %message%"
usage: "<red>Usage: /msg <player> <message></red>"
offline: "<red>%target_name% is not online.</red>"
self-message: "<red>You cannot message yourself.</red>"
no-permission: "<red>You do not have permission.</red>"
sound:
enabled: true
name: "minecraft:block.note_block.pling"
volume: 1.0
pitch: 1.2
mute:
message: "<red>You are muted.</red> <gray>Reason:</gray> <white>%reason%</white> <gray>Expires:</gray> <white>%expires%</white>"
broadcast: "<red>%target%</red> <gray>was muted by</gray> <white>%sender%</white><gray>.</gray>"
unmute-message: "<green>%target% is no longer muted.</green>"
death-messages:
pvp: "<red>%player_name% was slain by %killer_name%.</red>"
fall: "<red>%player_name% hit the ground too hard.</red>"
lava: "<red>%player_name% tried to swim in lava.</red>"
fire: "<red>%player_name% burned.</red>"
explosion: "<red>%player_name% exploded.</red>"
void: "<red>%player_name% fell into the void.</red>"
drowning: "<red>%player_name% drowned.</red>"
lightning: "<red>%player_name% was struck by lightning.</red>"
hunger: "<red>%player_name% starved.</red>"
default: "<red>%player_name% died.</red>"
评论 0
登录后参与评分
还没有评论,来抢沙发吧