ZealousChat
一款为 Paper 和 Spigot 服务器打造的、基于 MiniMessage 的现代聊天格式化插件
技术介绍
ZealousChat 利用 Paper 的高性能 AsyncChatEvent 和 MiniMessage 组件,构建了一个完全可配置的聊天系统来替换原版聊天。它自带按权限组/世界划分的特定格式、私聊功能、物品栏占位符以及细粒度的权限模型——同时保持轻量级且适用于生产环境。
功能特性
- 全链路 MiniMessage 支持 – 渐变、十六进制颜色、悬停/点击事件
- 基于权限组、世界及权限的格式,具备优先级系统
- 私聊功能(
/msg, /reply),支持社交间谍模式与冷却时间
- 跨服私聊(可选,需连接 MySQL),适用于运行多个服务器的网络集群
- 聊天/消息开关,支持玩家个人设置或服务器全局设置(管理员可绕过)
- 物品栏占位符
[inv], [ender], [armor], [hand], [pos], [health]
- URL 自动链接 & @提及(可配置)
- 高级脏话过滤器,支持正则表达式和模糊匹配,并具备分级惩罚机制
- 基于数据库的违规记录追踪,采用缓存以提升性能
- PlaceholderAPI 桥接(可选软依赖)
- 热重载插件配置(
/zchat reload)
- 自定义消息:可修改插件内使用的所有提示信息。
ZealousChat 是一款高性能的 1.20.4+ 聊天格式化插件,使用可配置的基于 MiniMessage 的聊天格式来格式化聊天消息。ZealousChat 包含了其他插件往往缺失的许多额外功能,例如在聊天中发送只读的你的物品栏/主手/护甲/末影箱视图、格式化的 /msg 和 /reply 命令、消息上的点击/悬停效果、@提及等。
ZealousChat 还具备针对服务器网络的特殊功能,如跨服私聊和跨服聊天频道(用于 staffchat 等)。
ZealousChat 使用 Paper API 实现其所有功能,并设计为尽可能高效。
展示图片
命令
插件核心
/zealouschat (/chatplugin, /zchat) — ZealousChat 的基础命令
- 权限:
zchat.admin
- 此命令并非实际执行操作的命令,而是所有子命令的基础。
配置命令
/zealouschat reload — 重载插件配置
/zealouschat info — 显示当前插件设置及启用的功能
/zealouschat test <message> — 预览聊天格式化效果
格式管理
/zealouschat format set default <format> — 设置默认聊天格式
- 权限:
zchat.admin.format
- 参数:
<format>: MiniMessage 格式字符串
/zealouschat format set group <group> <format> — 定义特定权限组的格式
- 权限:
zchat.admin.format
- 参数:
<group>: 权限组名称
<format>: MiniMessage 格式字符串
/zealouschat format set world <world> <format> — 定义特定世界的格式
- 权限:
zchat.admin.format
- 参数:
<world>: 世界名称
<format>: MiniMessage 格式字符串
/zealouschat format list — 列出所有当前的聊天格式
功能开关
/zealouschat toggle colors — 启用/禁用聊天中的颜色代码
/zealouschat toggle formatting — 启用/禁用文本格式化
/zealouschat toggle mentions — 启用/禁用玩家 @提及
/zealouschat toggle cooldown — 启用/禁用聊天冷却
私聊
/msg <player> <message> — 发送私聊消息(别名: /message, /tell, /whisper, /w)
- 权限:
zchat.message
- 参数:
<player>: 接收者玩家名称
<message>: 消息内容
/reply <message> — 回复上一条私聊消息的发件人(别名: /r, /respond)
跨服私聊
当你在 storage.conf 中启用跨服消息功能时(需要 MySQL 或 Redis 数据库),ZealousChat 可以在同一网络下的多个 Paper 服务器之间传递私聊消息。
- 当目标玩家在另一个服务器上在线时,
/msg 将尝试进行跨服投递
/reply 也支持跨服目标
- 已关闭私聊功能的接收者不会收到跨服消息
聊天与社交间谍开关
/zealouschat toggle chat — 切换公开聊天的开启/关闭状态
/zealouschat toggle messages — 切换私聊的开启/关闭状态
- 权限:
zchat.toggle.messages
/zealouschat toggle socialspy — 启用/禁用私聊的社交间谍模式
/zealouschat alerts — 切换提示音/提醒的开启/关闭状态
/zealouschat toggle status — 查看你当前的聊天和私聊状态
频道命令
/channel list — 列出所有可用频道
- 权限:
zchat.channel.use.list
/channel join <channel> — 加入一个频道
- 权限:
zchat.channel.use.join
- 参数:
/channel leave <channel> — 离开一个频道
- 权限:
zchat.channel.use.leave
- 参数:
/channel focus <channel> — 将某个频道设置为活动频道(默认消息发送到的位置)
- 权限:
zchat.channel.use.focus
- 参数:
/channel who <channel> — 列出频道中的成员
- 权限:
zchat.channel.use.who
- 参数:
脏话过滤系统
脏话过滤系统提供高级的不当用语检测功能,支持可配置的惩罚层级、数据库持久化存储,以及为受信任的管理员提供的绕过权限。
该系统目前处于实验阶段。可能会出现(主要是轻微的)问题。请报告您发现的任何错误。
过滤类型
正则表达式匹配
- 使用正则表达式进行精确的模式匹配
- 默认不区分大小写(例如
(?i)badword)
- 支持复杂模式和词边界
- 自动缓存编译后的模式以提升性能
莱文斯坦距离匹配
- 基于字符间距离的模糊匹配
- 可配置的距离阈值(默认:2-3个字符)
- 检测过滤词的拼写错误和变体
- 将消息拆分为单个单词进行比较
惩罚系统
- 违规追踪:每个过滤组独立追踪违规行为
- 分级惩罚:将违规次数映射到命令列表
- 命令占位符:使用
{player} 表示违规玩家的名称
- 控制台执行:所有惩罚命令均作为控制台命令运行
- 数据库持久化:违规计数在服务器重启后保持不变
性能特性
- 缓存:在线玩家的违规信息缓存在内存中以便即时访问
- 异步处理:违规处理在异步线程中运行,以防止聊天延迟
- 数据库优化:通过适当的索引实现高效查询
- 正则缓存:编译后的模式被缓存以避免重新编译
管理员控制
/zealouschat admin clear <type> — 清除各种与聊天相关的数据
- 权限:
zchat.admin.clear
- 参数:
<type>:以下之一:toggles(重置所有聊天开关)、socialspy(重置所有社交间谍状态)、cooldowns(清除消息冷却时间)、blocks(清除所有屏蔽列表)、alerts(清除所有警报状态)或 all(清除所有数据)
/zealouschat admin gtoggle <type> — 切换全局聊天功能(别名:/gtoggle, /chatplugin admin gtoggle, /zealouschat admin gtoggle, /zchat admin gtoggle)
- 权限:
zchat.admin.gtoggle
- 参数:
<type>:以下之一:chat、privatemessages、both、all
/zealouschat admin toggle chat <player> <true|false> — 强制切换玩家的公共聊天功能
- 权限:
zchat.admin.toggle.chat
- 参数:
<player>:目标玩家名称
<true|false>:启用或禁用聊天
/zealouschat admin toggle messages <player> <true|false> — 强制切换玩家的私人消息功能
- 权限:
zchat.admin.toggle.messages
- 参数:
<player>:目标玩家名称
<true|false>:启用或禁用私人消息
/zealouschat admin toggle all <player> <true|false> — 强制同时切换玩家的聊天和私人消息功能
- 权限:
zchat.admin.toggle.all
- 参数:
<player>:目标玩家名称
<true|false>:启用或禁用两者
/zealouschat admin socialspy <player> <true|false> — 强制切换玩家的社交间谍功能
- 权限:
zchat.admin.socialspy
- 参数:
<player>:目标玩家名称
<true|false>:启用或禁用社交间谍
/zealouschat admin stats — 显示全服务器的聊天和私人消息开关统计信息
/zealouschat admin alerts <player> <true|false> — 强制切换玩家的警报功能
- 权限:
zchat.admin.alerts
- 参数:
<player>:目标玩家名称
<true|false>:启用或禁用警报
/zealouschat admin block <player> <target> — 强制一名玩家屏蔽另一名玩家
- 权限:
zchat.admin.block
- 参数:
<player>:执行屏蔽操作的玩家
<target>:被屏蔽的玩家
/zealouschat admin unblock <player> <target> — 强制一名玩家解除对另一名玩家的屏蔽
- 权限:
zchat.admin.block
- 参数:
<player>:执行解除屏蔽操作的玩家
<target>:被解除屏蔽的玩家
/zealouschat admin clearblocks <player> — 清除某玩家的所有屏蔽设置
快速入门
- 将构建好的 jar 文件放入
plugins/ 目录并重启服务器。
- 编辑
plugins/ZealousChat/config.conf —— 更改可通过 /zealouschat reload 重新加载。
- (可选)在
plugins/ZealousChat/database.conf 中配置数据库设置,并在 plugins/ZealousChat/messages.conf 中配置消息。
- 授予玩家格式权限(如
zchat.format.vip)或允许使用颜色代码(zchat.color)。
- 在聊天消息中发送
[inv]、[hand]、[ender]、[health] 和 [pos] 以显示物品栏信息。
占位符
所有聊天、私信和配置字符串均支持 MiniMessage 格式,并且在安装插件时支持任何 PlaceholderAPI 标签。
支持版本 / 依赖项
- PaperMC / Spigot 1.20+(可能在旧版本上也能运行,未经测试)
- Java 17+
- (可选)PlaceholderAPI 用于外部占位符
权限
点击查看权限节点
| 节点 |
默认值 |
描述 |
zchat.* |
op |
授予所有权限 |
zchat.admin |
op |
访问根/管理员命令 |
zchat.admin.reload |
op |
重新加载配置 |
zchat.admin.info |
op |
查看插件信息 |
zchat.admin.test |
op |
测试格式化 |
zchat.admin.format |
op |
管理聊天格式 |
zchat.admin.toggle |
op |
切换插件功能 |
zchat.admin.block |
op |
管理玩家黑名单 |
zchat.color |
true |
在聊天中使用颜色代码 |
zchat.formatting |
true |
使用文本格式化代码 |
zchat.url |
true |
发送可点击的 URL |
zchat.mention |
true |
使用 @提及 |
zchat.bypass.cooldown |
op |
绕过聊天/消息冷却时间 |
zchat.bypass.swearfilter |
op |
绕过脏话过滤器限制 |
zchat.format.admin |
op |
使用 Admin 聊天格式 |
zchat.format.moderator |
false |
使用 Moderator 聊天格式 |
zchat.format.vip |
false |
使用 VIP 聊天格式 |
zchat.message |
true |
发送和接收私人消息 |
zchat.channel.use.list |
true |
使用 /channel list 命令 |
zchat.channel.use.join |
true |
使用 /channel join 命令 |
zchat.channel.use.leave |
true |
使用 /channel leave 命令 |
zchat.channel.use.focus |
true |
使用 /channel focus 命令 |
zchat.channel.use.who |
true |
使用 /channel who 命令 |
zchat.toggle |
true |
聊天/消息开关权限的父级节点 |
zchat.toggle.chat |
true |
切换公共聊天 |
zchat.toggle.messages |
true |
切换私人消息 |
zchat.status |
true |
查看自己的聊天状态 |
zchat.alerts.toggle |
true |
开启或关闭警报 |
zchat.socialspy |
op |
监控私人消息 |
zchat.commandspy |
op |
监控玩家命令 |
zchat.bypass.chattoggle |
op |
即使禁用也能聊天 |
zchat.bypass.messagetoggle |
op |
即使禁用也能发送私聊 |
zchat.bypass.globalchat |
op |
绕过全局聊天开关 |
zchat.bypass.globalmessages |
op |
绕过全局消息开关 |
zchat.viewinventory |
true |
查看共享物品栏 |
zchat.inventory.placeholders |
true |
使用物品栏占位符 |
zchat.admin.toggle.chat |
op |
强制切换某玩家的聊天功能 |
zchat.admin.toggle.messages |
op |
强制切换某玩家的私聊功能 |
zchat.admin.toggle.all |
op |
强制同时切换聊天和私聊功能 |
zchat.admin.gtoggle |
op |
切换全局聊天功能 |
zchat.admin.socialspy |
op |
强制为某玩家开启社交间谍 |
zchat.admin.stats |
op |
查看服务器范围的统计数据 |
zchat.admin.alerts |
op |
强制为某玩家开启或关闭警报 |
zchat.admin.clear |
op |
清除各种与聊天相关的数据 |
需要帮助?
• Discord: 加入 Discord
• Email: pluginsupport@bruhmo.men
ZealousChat
A modern, MiniMessage-powered chat formatter for Paper & Spigot servers
Technical introduction
ZealousChat replaces Vanilla chat with a fully configurable system built on the Paper's high performance AsyncChatEvent and MiniMessage components. It ships with rank/world specific formats, private messaging, inventory placeholders and a granular permission model – all while remaining light-weight and production ready.
Features
- MiniMessage everywhere – gradients, hex colours, hover/click events
- Rank, world & permission based formats with priority system
- Private messaging (
/msg, /reply) with social-spy & cooldowns
- Cross-server private messaging (optional, MySQL required) for networks running multiple servers
- Chat / Message toggles per-player or server-wide (with staff bypass)
- Inventory placeholders
[inv], [ender], [armor], [hand], [pos], [health]
- URL auto-linking & @mentions (configurable)
- Advanced swear filter with regex and fuzzy matching, with a tiered punishment system.
- Database-backed infraction tracking with caching for performance
- PlaceholderAPI bridge (optional soft-depend)
- Hot-reloadable plugin configurations (
/zchat reload)
- Customizable Messages for all messages used within the plugin.
ZealousChat is a high performance, 1.20.4+ chat formatting plugin that uses configurable MiniMessage-based chat formats to format chat messages. ZealousChat includes many extra features other plugins leave out, like the ability to send a read-only view of your inventory/hand/armor/enderchest in chat, formatted /msg and /reply commands, click/hover messages on messages, @mentions and more.
ZealousChat also has special features for server networks, such as cross-server private messaging, and cross server chat channels (for staffchat and similar).
ZealousChat implements all of its features using the Paper API, and is designed to be as efficient as possible.
Showcase Images
Commands
Plugin Core
/zealouschat (/chatplugin, /zchat) — Base command for ZealousChat
- Permission:
zchat.admin
- This command is not an actual command, but rather the base for all sub-commands.
Configuration Commands
/zealouschat reload — Reload plugin configurations
- Permission:
zchat.admin.reload
/zealouschat info — Display current plugin settings and enabled features
- Permission:
zchat.admin.info
/zealouschat test <message> — Preview chat formatting
- Permission:
zchat.admin.test
- Parameters:
<message>: Text to format and display
Format Management
/zealouschat format set default <format> — Set default chat format
- Permission:
zchat.admin.format
- Parameters:
<format>: MiniMessage format string
/zealouschat format set group <group> <format> — Define group-specific format
- Permission:
zchat.admin.format
- Parameters:
<group>: Permission group name
<format>: MiniMessage format string
/zealouschat format set world <world> <format> — Define world-specific format
- Permission:
zchat.admin.format
- Parameters:
<world>: World name
<format>: MiniMessage format string
/zealouschat format list — List all current chat formats
- Permission:
zchat.admin.format
Feature Toggles
/zealouschat toggle colors — Enable/disable color codes in chat
- Permission:
zchat.admin.toggle
/zealouschat toggle formatting — Enable/disable text formatting
- Permission:
zchat.admin.toggle
/zealouschat toggle mentions — Enable/disable player @mentions
- Permission:
zchat.admin.toggle
/zealouschat toggle cooldown — Enable/disable chat cooldown
- Permission:
zchat.admin.toggle
Private Messaging
/msg <player> <message> — Send a private message (aliases: /message, /tell, /whisper, /w)
- Permission:
zchat.message
- Parameters:
<player>: Recipient player name
<message>: Message text
/reply <message> — Reply to the last private message sender (aliases: /r, /respond)
- Permission:
zchat.message
- Parameters:
Cross-server private messages
When you enable cross-server messaging in storage.conf (requires a MySQL or Redis database), ZealousChat can deliver private messages across multiple Paper servers on the same network.
/msg will attempt cross-server delivery when the target is online on another server
/reply also supports cross-server targets
- Recipients that have private messages toggled off will not receive cross-server messages
Chat & Social Spy Toggles
/zealouschat toggle chat — Toggle your public chat on/off
- Permission:
zchat.toggle.chat
/zealouschat toggle messages — Toggle your private messages on/off
- Permission:
zchat.toggle.messages
/zealouschat toggle socialspy — Enable/disable social spy for private messages
- Permission:
zchat.socialspy
/zealouschat alerts — Toggle alerts on/off
- Permission:
zchat.alerts.toggle
/zealouschat toggle status — View your current chat & private message status
Channel Commands
/channel list — List all available channels
- Permission:
zchat.channel.use.list
/channel join <channel> — Join a channel
- Permission:
zchat.channel.use.join
- Parameters:
/channel leave <channel> — Leave a channel
- Permission:
zchat.channel.use.leave
- Parameters:
/channel focus <channel> — Set a channel as the active channel (where your messages go by default)
- Permission:
zchat.channel.use.focus
- Parameters:
/channel who <channel> — List members in a channel
- Permission:
zchat.channel.use.who
- Parameters:
Swear Filter System
The swear filter provides advanced profanity detection with configurable punishment tiers, database persistence, and bypass permissions for trusted staff.
This system is currently experimental. There will be (mostly small) issues here. Please report any bugs you find.
Filter Types
Regex Matching
- Uses regular expressions for precise pattern matching
- Case-insensitive by default (e.g.,
(?i)badword)
- Supports complex patterns and word boundaries
- Automatically caches compiled patterns for performance
Levenshtein Distance Matching
- Fuzzy matching based on character distance between words
- Configurable distance threshold (default: 2-3 characters)
- Detects misspellings and variations of filtered words
- Splits messages into individual words for comparison
Punishment System
- Infraction Tracking: Each filter group tracks infractions independently
- Tiered Punishments: Map infraction counts to command lists
- Command Placeholders: Use
{player} for the offending player's name
- Console Execution: All punishment commands run as console
- Database Persistence: Infraction counts persist across server restarts
Performance Features
- Caching: Online player infractions cached in memory for instant access
- Async Processing: Infraction handling runs asynchronously to prevent chat delays
- Database Optimization: Efficient queries with proper indexing
- Regex Caching: Compiled patterns cached to avoid recompilation
Administrator Controls
/zealouschat admin clear <type> — Clear various chat-related data
- Permission:
zchat.admin.clear
- Parameters:
<type>: One of: toggles (resets all chat toggles), socialspy (resets all social spy states), cooldowns (clears message cooldowns), blocks (clears all block lists), alerts (clears all alert states), or all (clears all data)
/zealouschat admin gtoggle <type> — Toggle global chat features (aliases: /gtoggle, /chatplugin admin gtoggle, /zealouschat admin gtoggle, /zchat admin gtoggle)
- Permission:
zchat.admin.gtoggle
- Parameters:
<type>: One of: chat, privatemessages, both, all
/zealouschat admin toggle chat <player> <true|false> — Force toggle public chat for a player
- Permission:
zchat.admin.toggle.chat
- Parameters:
<player>: Target player name
<true|false>: Enable or disable chat
/zealouschat admin toggle messages <player> <true|false> — Force toggle private messages for a player
- Permission:
zchat.admin.toggle.messages
- Parameters:
<player>: Target player name
<true|false>: Enable or disable private messages
/zealouschat admin toggle all <player> <true|false> — Force toggle both chat & private messages
- Permission:
zchat.admin.toggle.all
- Parameters:
<player>: Target player name
<true|false>: Enable or disable both
/zealouschat admin socialspy <player> <true|false> — Force toggle social spy for a player
- Permission:
zchat.admin.socialspy
- Parameters:
<player>: Target player name
<true|false>: Enable or disable social spy
/zealouschat admin stats — Display server-wide chat and private message toggle statistics
- Permission:
zchat.admin.stats
/zealouschat admin alerts <player> <true|false> — Force toggle alerts for a player
- Permission:
zchat.admin.alerts
- Parameters:
<player>: Target player name
<true|false>: Enable or disable alerts
/zealouschat admin block <player> <target> — Force a player to block another player
- Permission:
zchat.admin.block
- Parameters:
<player>: Player who will do the blocking
<target>: Player to be blocked
/zealouschat admin unblock <player> <target> — Force a player to unblock another player
- Permission:
zchat.admin.block
- Parameters:
<player>: Player who will do the unblocking
<target>: Player to be unblocked
/zealouschat admin clearblocks <player> — Clear all blocks for a player
- Permission:
zchat.admin.block
- Parameters:
<player>: Player whose block list will be cleared
Quick Start
- Drop the built jar into
plugins/ and restart.
- Edit
plugins/ZealousChat/config.conf – changes can be reloaded with /zealouschat reload.
- (Optional) Configure database settings in
plugins/ZealousChat/database.conf and messages in plugins/ZealousChat/messages.conf.
- Grant players a format permission such as
zchat.format.vip or allow colours with zchat.color.
- Send
[inv], [hand], [ender], [health] and [pos] in chat messages to display inventory information.
Placeholders
All Chat, PM and config strings support MiniMessage plus any PlaceholderAPI tags when the plugin is present.
Supported Versions / Dependencies
- PaperMC / Spigot 1.20+ (may work on older versions, untested)
- Java 17+
- (Optional) PlaceholderAPI for external placeholders
Permissions
Click to view permission nodes
| Node |
Default |
Description |
zchat.* |
op |
Grant everything |
zchat.admin |
op |
Access root/admin commands |
zchat.admin.reload |
op |
Reload configuration |
zchat.admin.info |
op |
View plugin info |
zchat.admin.test |
op |
Test formatting |
zchat.admin.format |
op |
Manage chat formats |
zchat.admin.toggle |
op |
Toggle plugin features |
zchat.admin.block |
op |
Manage player block lists |
zchat.color |
true |
Use colour codes in chat |
zchat.formatting |
true |
Use text formatting codes |
zchat.url |
true |
Send clickable URLs |
zchat.mention |
true |
Use @mentions |
zchat.bypass.cooldown |
op |
Bypass chat/message cooldowns |
zchat.bypass.swearfilter |
op |
Bypass swear filter restrictions |
zchat.format.admin |
op |
Use Admin chat format |
zchat.format.moderator |
false |
Use Moderator chat format |
zchat.format.vip |
false |
Use VIP chat format |
zchat.message |
true |
Send & receive private messages |
zchat.channel.use.list |
true |
Use the /channel list command |
zchat.channel.use.join |
true |
Use the /channel join command |
zchat.channel.use.leave |
true |
Use the /channel leave command |
zchat.channel.use.focus |
true |
Use the /channel focus command |
zchat.channel.use.who |
true |
Use the /channel who command |
zchat.toggle |
true |
Parent of chat/message toggle perms |
zchat.toggle.chat |
true |
Toggle public chat |
zchat.toggle.messages |
true |
Toggle private messages |
zchat.status |
true |
View own chat status |
zchat.alerts.toggle |
true |
Toggle alerts on/off |
zchat.socialspy |
op |
Monitor private messages |
zchat.commandspy |
op |
Monitor player commands |
zchat.bypass.chattoggle |
op |
Chat even when disabled |
zchat.bypass.messagetoggle |
op |
PM even when disabled |
zchat.bypass.globalchat |
op |
Bypass global chat toggle |
zchat.bypass.globalmessages |
op |
Bypass global message toggle |
zchat.viewinventory |
true |
View shared inventories |
zchat.inventory.placeholders |
true |
Use inventory placeholders |
zchat.admin.toggle.chat |
op |
Force toggle chat for a player |
zchat.admin.toggle.messages |
op |
Force toggle messages for a player |
zchat.admin.toggle.all |
op |
Force toggle both chat & messages |
zchat.admin.gtoggle |
op |
Toggle global chat features |
zchat.admin.socialspy |
op |
Force toggle social spy for player |
zchat.admin.stats |
op |
View server-wide statistics |
zchat.admin.alerts |
op |
Force toggle alerts for a player |
zchat.admin.clear |
op |
Clear various chat-related data |
Need help?
• Discord: Join Discord
• Email: pluginsupport@bruhmo.men
评论 0
登录后参与评分
还没有评论,来抢沙发吧