聊天管理器 - 格式,反刷屏,自动广播,自定义消息。

聊天管理器 - 格式,反刷屏,自动广播,自定义消息。

完整聊天管理器,欢迎,加入,格式,占位符,反垃圾(自定义正则表达式),清空聊天,自动广播,更多...

实用

💬 ChatManager

配置文档

以下所有修改均在 config.json 文件中进行。 该插件会自动生成并管理此文件,路径为:

/mods/ChatManager/config.json

✏️ 你可以使用任何文本编辑器直接编辑它。

⚠️ 重要提示: 请勿修改变量名(键),只需修改其值(true/false、字符串、数字、列表等)。

⚙️ 通用设置 — generalConfig

disableHytaleMessage — 设置为 true 时,隐藏 Hytale 自带的聊天消息,仅显示 ChatManager 自身的格式化和加入/离开消息。

"disableHytaleMessage": true

enablePerWorldChat — 设置为 true 时,聊天按世界分隔:玩家只能看到同一世界玩家发送的消息。

"enablePerWorldChat": true

welcomeMessage — 玩家加入时私下发送给他们的消息。支持 TinyMessage 格式以设置颜色和样式。

"welcomeMessage": "Welcome!"

joinMessage / leaveMessage — 当玩家加入或离开时向整个服务器广播。使用 {player} 作为占位符。

"joinMessage": "{player} is joined on server.",
"leaveMessage": "{player} have left the server."

💬 聊天格式 — configChat

chatFormat — 控制每条聊天消息的显示方式。使用以下占位符构建:

{player} {prefix} {suffix} {message}

{prefix} 和 {suffix} 显示玩家的 LuckPerms 群组前缀/后缀。需要安装 LuckPerms

"chatFormat": "{prefix} : {player} : {suffix} : <yellow> {message} </yellow>"

clearChatMessage — 运行 /clearchat(见下方)后向所有人显示的消息。

"clearChatMessage": "<yellow> The Chat is reload. </yellow>"

🧹 要立即清除聊天,请使用:

/clearchat

别名:/cc

🛡️ 反垃圾信息 — antiSpam

messageCooldownMs — 玩家两次发送消息之间必须等待的最短时间(毫秒)。cooldownMessage 中的占位符 {time} 会填入剩余的秒数。

"messageCooldownMs": 3000,
"cooldownMessage": "Please wait {time} seconds before sending another message."

blockedDomains — 被屏蔽的域名后缀列表,在消息中出现(如链接)时将被阻止。

"blockedDomains": [".com", ".it", ".net"],
"blockedLinkMessage": "Posting links or URLs is not allowed in chat."

⚠️ 注意:此规则会匹配消息中任意位置的子字符串,因此包含 ".com" 或 ".net" 的无辜词语也可能被屏蔽。请根据需求添加/删除条目。

bannedWords — 聊天中完全不允许出现的词语或短语列表。

"bannedWords": ["fuck", "idiot", "...."],
"bannedWordMessage": "Your message contains inappropriate language"

maxSimilarMessages / similarityThreshold — 防止玩家发送几乎相同的消息。similarityThreshold(0 到 1)控制两条消息需要有多接近才被视为"相似"——越接近 1,检测越严格。

"maxSimilarMessages": 3,
"similarityThreshold": 0.85,
"repeatMessage": "Please don't repeat the same message."

maxCapsPercentage — 阻止大写字母占比超过此百分比的消息。

"maxCapsPercentage": 70,
"maxCapStringMessage": "Please avoid using excessive capital letters in your messages."

blockIPAddresses / ipRegex — 启用时,阻止任何匹配 IP 地址模式的消息,以防止玩家在聊天中共享服务器 IP。

"blockIPAddresses": true,
"ipRegex": "\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b",
"blockedIPMessage": "Posting IP addresses is not allowed in chat."

⚠️ 只有当你熟悉正则表达式时才修改 ipRegex——错误的正则可能导致无法屏蔽 IP,或错误地屏蔽正常消息。

bypassGroups — 免于上述所有反垃圾规则(冷却、禁词、大写、链接、IP、重复)的 LuckPerms 群组。

"bypassGroups": ["VIP", "OWNER"]

📣 自动消息 — configAutoMessage

可以任意添加条目到 autoMessageList 中——每条消息都会自动广播,并在自己的计时器上重复。适用于规则、促销和公告。

messageContent — 发送到全局聊天的文本。

intervalSeconds — 此消息重复的间隔时间,单位为秒。

remainingSeconds — 距离下次广播此消息的剩余秒数。主要用于内部倒计时跟踪——通常可以保持原样。

{
  "messageContent": "Buy VIP → /store",
  "intervalSeconds": 1200,
  "remainingSeconds": 1145
}

🙏 感谢

如有任何问题、错误报告或功能请求,请留言。💬