智能自动聊天审核——垃圾信息、广告、毒性言论、威胁和脏话,由 ChatCop 为您处理
Spigot · Paper · Purpur · Folia | 1.20 – 1.21.x | Java 17+ | 单个 jar 文件,无依赖项
ChatCop 会读取玩家发送的每条消息——包括聊天频道、私聊、告示牌、书籍以及铁砧重命名中的内容,并实时进行处理。
其核心优势在于检测机制。大多数聊天插件仅进行关键词匹配,而 ChatCop 会先对消息进行规范化处理。这样,象形文字(leet speak)、符号替换、字母间加点、单词空格化、重复字符以及不可见 Unicode 等变体都会被还原为原始文本,然后再进行检查。
以无害词汇为例:sp4mm3r、s.p.a.m、#s#p#a#m、s p a m 和 example (dot) com 都会触发与纯拼写相同的规则。内置的规则列表涵盖辱骂、仇恨言论、威胁和脏话。
所有处理均在内存中完成,关键部分采用异步执行,且零重型依赖。
1.1.0 新增功能
- 私聊和命令已过滤 —— 此前,每个过滤器都可通过
/msg 轻易绕过
- 告示牌、书籍和铁砧重命名 也已被纳入过滤范围
- 袭击检测 —— 能捕获多个账号同时发送相同内容的情况,这是单玩家追踪无法做到的
- 聊天控制 —— 包含慢速模式、全局聊天锁定以及首次加入延迟,可有效遏制机器人袭击
- 离线禁言 —— 可对不在服务器上的玩家执行禁言和解除禁言
- 积分、警告和历史记录现在可跨重启保存
- 每个过滤器的独立绕过权限,以及免禁言和强制禁言覆盖权限
- 色情内容检测,并与辱骂行为分开报告
- Discord 队列 —— 垃圾信息浪潮不再触发 webhook 的频率限制,且标记消息中的
@everyone 绝不会 ping 到你的服务器
- 内置更新检查器 及可选的 bStats 指标
从 1.0.x 升级? 只需替换 jar 文件即可。每个新功能都有内置默认值,因此你现有的 config.yml 仍可正常工作——仅需添加你想要修改的配置项。
功能特性
五种过滤器、四种响应方式,以及一个会自动升级处罚程度的积分系统。
五种过滤器
| 过滤器 |
检测内容 |
| 垃圾信息 (Spam) |
刷屏检测、重复及近似重复消息(基于相似度而非完全匹配)、过度大写、重复字符、跨玩家袭击检测 |
| 广告 (Advertising) |
IP 地址、URL、域名、Minecraft 服务器地址和 Discord 邀请链接,包括拼写展开形式。IP 和 URL 屏蔽可独立切换,并提供域名白名单用于保护你自己的地址 |
| 毒性 (Toxicity) |
内置辱骂和仇恨言论列表、内置色情内容列表,以及自定义短语 |
| 威胁 (Threats) |
死亡威胁、“kys”、人肉搜索、DDoS 和 swat 威胁,以及自定义短语 |
| 脏话 (Profanity) |
审查模式(显示为 ****)或拦截模式,在整条消息被丢弃前设有单条消息次数限制 |
无法被绕过的检测机制
以下示例使用无害词汇演示——内置列表涵盖真实违规词汇。
- 象形文字(Leet speak)—
sp4mm3r、h4ck3r、n00b
- 分隔符 —
s.p.a.m、#s#p#a#m、s-p-a-m
- 字母间距 —
s p a m
- 重复字符 —
spaaaaam
- 零宽字符和不可见 Unicode
- 自定义短语的全词匹配,因此
nega 不会误报 negative —— 如需部分匹配仍可使用正则表达式
- 每个过滤器均可设置白名单,用于保留服务器合法使用的术语
四种响应方式
| 操作 |
行为描述 |
ALLOW |
放行消息 |
CENSOR |
替换敏感词,发送其余内容 |
BLOCK |
阻止消息发送 |
SHADOW |
幽灵惩罚。消息对除发送者外的所有人隐藏,使其以为消息已成功发送,从而永远不知道你的过滤器拦截了什么 |
自动升级的处罚机制
- 每次违规都会获得积分,良好的行为会使积分随时间衰减
- 达到阈值时执行你配置的命令 —— 兼容 LiteBans、EssentialsX、AdvancedBan 或任何支持命令的工具
- 在此基础上提供按过滤器分开的命令,以便针对特定违规行为即时反应
- 玩家级冷却时间,防止一名垃圾信息发送者在三秒内触发三十次处罚
- 内置禁言和警告功能 —— 临时或永久,包含离线玩家,数据持久化保存到磁盘
聊天控制
- 慢速模式 (Slowmode) —— 消息之间的最小间隔时间
- 聊天锁定 (Chat lock) —— 立即冻结聊天,工作人员仍可发言
- 首次加入延迟 (First-join delay) —— 新连接必须在发送第一条消息前等待一段时间。这对抵御机器人袭击极为有效
警报与集成
- Discord Webhook —— 丰富的嵌入消息、按过滤器配色和开关、手动工作人员操作、具备频率限制意识的队列
- 游戏内工作人员警报,支持自定义格式和声音,可选控制台镜像
- PlaceholderAPI —— 提供 15 个占位符,涵盖积分、警告、禁言状态、慢速模式、聊天锁定和全服统计数据
- bStats 指标(可选,在未设置服务 ID 前默认关闭)
- 更新检查器 —— 支持 Spigot 或 Modrinth,加入时通知管理员。它仅读取版本号,从不下载任何内容
专为真实服务器打造
- Folia 就绪 —— 同一个 jar 文件可在 Spigot、Paper、Purpur 和 Folia 上运行
- 按世界禁用 —— 适用于工作人员和创造模式世界(禁言仍然强制执行)
- 十六进制颜色支持 (
&#RRGGBB) 全站适用,且 Fish & Chips 等文本不会被破坏
- 日志文件轮换 和持久化统计
- 所有面向玩家的消息均可编辑
- 所有命令均支持 Tab 补全
要求
- 服务器: Spigot、Paper、Purpur 或 Folia 1.20+(已测试至 1.21.x)
- Java: 17 或更高版本
- PlaceholderAPI: 可选
- 将
ChatCop-1.1.0.jar 放入你的 plugins/ 文件夹
- 重启服务器
- 编辑
plugins/ChatCop/config.yml 并运行 /chatcop reload
就是这样——默认配置开箱即用,可直接投入生产环境。
命令
主命令:/chatcop — 别名 /cc 和 /cop
| 命令 |
描述 |
权限 |
/chatcop help |
命令概览 |
chatcop.admin |
/chatcop reload |
重新加载配置 |
chatcop.admin |
/chatcop stats |
管理统计数据 |
chatcop.stats |
/chatcop history <player> |
玩家的违规历史(支持离线玩家) |
chatcop.admin |
/chatcop check <player> |
一览点数、警告和静音状态 |
chatcop.admin |
/chatcop test <message> |
查看某条消息会触发什么,但不实际发送(控制台也可用) |
chatcop.admin |
/chatcop clear <player> |
重置玩家的点数和历史记录 |
chatcop.admin |
/chatcop mutelist |
列出当前被禁言的玩家 |
chatcop.mute |
/chatcop slowmode <seconds> |
设置慢速模式,设为 0 以禁用 |
chatcop.admin |
/chatcop lock · /chatcop unlock |
锁定或解锁聊天 |
chatcop.admin |
/ccmute <player> [duration] [reason] |
禁言,支持在线或离线玩家 |
chatcop.mute |
/ccunmute <player> |
解除禁言,支持在线或离线玩家 |
chatcop.mute |
/ccwarn <player> [reason] |
警告玩家 |
chatcop.warn |
持续时间: s、m、h、d、w —— 可组合使用,例如 1h30m —— 或使用 perm 表示永久。
示例:/ccmute Steve 2d Advertising
权限
| 权限 |
描述 |
默认值 |
chatcop.admin |
完全访问权限 |
op |
chatcop.mute |
禁言与解除禁言 |
op |
chatcop.mute.exempt |
不能被其他工作人员禁言 |
false |
chatcop.mute.override |
可以禁言享有豁免权的玩家 |
false |
chatcop.warn |
警告玩家 |
op |
chatcop.notify |
接收游戏内警报 |
op |
chatcop.stats |
查看统计数据 |
op |
chatcop.chatlock.bypass |
在聊天锁定时发言 |
op |
chatcop.bypass |
绕过所有过滤器 |
false |
chatcop.bypass.<filter> |
绕过单个过滤器:spam、advertising、toxicity、threats、profanity |
false |
chatcop.bypass.slowmode |
绕过慢速模式 |
op |
chatcop.bypass.joindelay |
绕过首次加入延迟 |
op |
chatcop.bypass 仅跳过过滤器。它不会让被禁言的玩家发言——禁言始终强制执行。
PlaceholderAPI
玩家变量: %chatcop_points% · %chatcop_warns% · %chatcop_muted% · %chatcop_mute_time% · %chatcop_mute_reason% · %chatcop_bypass%
服务器变量: %chatcop_total_messages% · %chatcop_total_blocked% · %chatcop_total_censored% · %chatcop_total_mutes% · %chatcop_total_warns% · %chatcop_block_rate% · %chatcop_active_mutes% · %chatcop_slowmode% · %chatcop_chat_locked%
配置
每个选项在文件中都有注释,且每个选项都有内置默认值——因此旧配置文件在更新后仍能正常工作。
惩罚命令中的占位符:
| 标记 |
含义 |
标记 |
含义 |
%player% |
违规玩家 |
%punisher% |
触发者 |
%uuid% |
违规玩家的 UUID |
%reason% |
被标记的原因 |
%message% |
违规消息 |
%duration% |
惩罚持续时间 |
%filter% |
过滤器名称 |
%world% |
世界名称 |
在 messages 部分,{name} 和 %name% 两种格式均可使用。
config.yml (点击展开)
general:
# 启用调试模式 - 将过滤决定记录到控制台(生产环境请禁用)
debug: false
# 将所有被拦截的消息保存到日志文件
log-to-file: true
# 日志文件路径(相对于 ChatCop 插件文件夹)
log-file: "logs/chatcop.log"
# 当日志超过此大小时进行轮转,单位为 KB。设为 0 禁用轮转。
log-max-size-kb: 5120
# 静默模式 - 拦截消息且不告知发送者
silent-block: false
# 跳过聊天过滤的世界(例如员工专用世界)。
# 在这些世界中,禁言仍然有效。
disabled-worlds: []
# 启动时检查新版本并通知你。它仅
# 读取最新版本号 - 从不下载或安装任何内容。
# 完全异步运行,如果离线则静默失败。
update-checker:
enabled: true
# 如果存在更新,也在使用 chatcop.admin 权限的玩家加入时通知他们
notify-admins: true
# 检查最新版本的来源:"spigot" 或 "modrinth"
source: "spigot"
# 匿名使用统计 (bStats)。在 bstats.org 注册你的插件,
# 然后在下方粘贴服务 ID。保持为 0 则不发送任何指标数据。
metrics:
enabled: true
service-id: 0
# 显示在所有消息中。支持 & 颜色代码和 &#RRGGBB 十六进制颜色。
# 编写 && 表示字面意义的 & 符号。
prefix: "&8[&bChat&3Cop&8] "
# 每个过滤器都会给予点数。点数会随时间衰减。当玩家总
# 点数超过阈值时,将执行该阈值的命令。这独立于
# 每个过滤器的即时惩罚命令。
punishments:
# 玩家表现良好时每分钟扣除的点数
point-decay-per-minute: 2
# 同一玩家惩罚命令之间的最小间隔秒数。
# 防止垃圾信息发送者在几秒内触发数十次惩罚。
punishment-cooldown-seconds: 3
thresholds:
15:
commands:
- "ccwarn %player% Repeated chat violations"
30:
commands:
- "tempmute %player% 10m Repeated chat violations"
50:
commands:
- "tempmute %player% 1h Excessive chat violations"
# 在过滤器之前运行的全服控制。
chat-control:
# 玩家发送消息之间必须等待的秒数。设为 0 表示禁用。
# 权限绕过:chatcop.bypass.slowmode
slowmode-seconds: 0
# 玩家在可以聊天之前必须在线的秒数。
# 对防止机器人袭击非常有效。设为 0 表示禁用。
# 权限绕过:chatcop.bypass.joindelay
first-join-delay-seconds: 0
# 启动时锁定聊天(拥有 chatcop.chatlock.bypass 权限的管理员仍可发言)
locked-on-start: false
# 如果没有这个配置,每个过滤器都可以通过 /msg 命令轻易绕过。
command-filter:
enabled: true
# 经过聊天过滤器处理的命令文本。
# 格式为 "<命令>:<消息前的参数数量>" - /msg <玩家> <消息>
# 在消息前有一个参数,/me <消息> 则没有。
filtered:
- "msg:1"
- "tell:1"
- "whisper:1"
- "w:1"
- "m:1"
- "t:1"
- "r:0"
- "回复:0"
- "我:0"
- "说:0"
- "邮件:1"
- "广播:0"
# 被封禁玩家完全无法使用的命令。
blocked-when-muted:
- "消息"
- "告诉"
- "耳语"
- "w"
- "m"
- "r"
- "回复"
- "我"
- "邮件"
- "说"
- "广播"
# 玩家可以在其他位置书写文本。
extras:
filter-signs: true
filter-books: true
filter-anvil: true
# 静音存储。
mutes:
# 在重启后保留静音设置
persistent: true
# 静音数据的存储位置(相对于 ChatCop 插件文件夹)
storage-file: "data/mutes.yml"
# 违规点数、警告次数和历史记录。
player-data:
# 在重启后保留这些数据。关闭此项则仅在会话期间有效。
persistent: true
过滤器:
# -- 垃圾信息过滤器 --------------------------------------------
spam:
enabled: true
# 触发此过滤器时获得的违规分数
points: 4
# 用于重复检查的消息记忆时长(秒)
duplicate-content-expiry: 8
# 在屏蔽之前允许发送的相似消息数量
duplicate-threshold: 4
# 洪水窗口内允许的最大消息数量
flood-messages: 6
# 跟踪消息洪水的时长窗口(秒)
flood-window: 3
# 两条消息必须有多相似才算作重复(0.0 - 1.0)
# 1.0 = 仅完全相同,0.8 = 相似度 80%
similarity-threshold: 0.80
# 触发大写警告的大写字母百分比(0 - 100)
caps-threshold: 70
# 应用大写检查前的最小消息长度
caps-min-length: 12
# 因过度使用大写而获得的分数(通常低于主分数)
caps-points: 2
# 阻止字符重复次数过多的消息(如 "heeellooo")
repeated-chars: true
repeated-chars-threshold: 10
# 检测同一行消息同时从多个账户到达的情况,这看起来像是机器人攻击。
# 单玩家追踪无法检测到这一点,因为每个账户只发送一次该消息。
cross-player:
enabled: true
# 在窗口期内必须有多少不同的玩家发送它
player-threshold: 4
# 窗口时长(秒)
window: 10
# 消息必须有多相似(0.0 - 1.0)
similarity: 0.90
points: 6
punishment:
# 触发此过滤器时运行的命令(留空 [] 表示无操作)
commands: []
# -- 广告过滤器 -------------------------------------
advertising:
enabled: true
points: 10
# 阻止原始 IP 地址(例如 192.168.1.1)
block-ips: true
# 阻止 URL、域名和 Discord 邀请链接
block-urls: true
# 额外要阻止的域名。纯文本单词将作为完整单词进行匹配;
# 包含正则表达式字符的内容将被视为正则表达式。
blocked-domains: []
# 始终允许的域名(在此处放置您自己的服务器域名)
whitelist-domains: []
punishment:
commands: []
# -- 毒性过滤 ----------------------------------------
toxicity:
enabled: true
points: 8
# 幽灵/阴影模式:被标记的消息将对除发送者之外的所有人隐藏,
# 这样他们以为消息已成功发送,就不会尝试绕过。
shadow-mode: false
# 内置的种族和身份侮辱词列表
block-slurs: true
# 内置的色情内容列表(与侮辱词分开报告)
block-sexual-content: true
# 智能检测能识破 Leet Speak、符号和字母间距
smart-detection: true
# 您自定义的短语。纯单词作为完整单词匹配,因此 "nega" 将
# 不会标记 "negative"。如果需要部分匹配,请使用正则表达式。
blocked-phrases: []
# 此过滤器绝不应标记的短语
whitelisted-phrases: []
punishment:
commands: []
# -- 威胁过滤 ------------------------------------------
threats:
enabled: true
points: 12
shadow-mode: false
blocked-phrases:
- "i will leak your ip"
- "i will ddos"
- "i will doxx"
whitelisted-phrases: []
punishment:
commands: []
# -- 粗俗用语过滤 ---------------------------------------
profanity:
enabled: true
points: 3
# 审查模式会替换不当词语,而不是屏蔽消息。
# 如果消息无法安全地进行审查(例如通过空格混淆),
# 则会被屏蔽而不是未经审查地发送。
censor-mode: true
# 用于替换不当词语的字符
censor-char: "*"
# 当消息被审查而非屏蔽时获得的积分
censor-points: 1
# 在完全屏蔽消息之前允许出现的粗俗用语数量
max-per-message: 3
blocked-phrases: []
whitelisted-phrases: []
punishment:
commands: []
# Discord 网页钩子(Webhook)警报。
discord:
enabled: false
# 你的 Discord 网页钩子 URL(频道设置 > 集成)
webhook-url: ""
# 同时发布手动管理操作(禁言、解除禁言、警告)
staff-actions: true
# 管理操作嵌入的颜色
action-color: 3447003
# 警报会被排队并逐个发送,以免大量刷屏触发 Discord 的频率限制。
send-interval-seconds: 2
# 队列中的最大警报数量,超出后最旧的将被丢弃
queue-limit: 50
filters:
# 每个过滤器都可以单独启用或禁用以用于网页钩子警报。
# 颜色为十进制数值 - 请使用 https://www.spycolor.com 将十六进制转换为十进制。
Spam:
enabled: false
color: 16776960
Advertising:
enabled: true
color: 16753920
Toxicity:
enabled: true
color: 16711680
Threats:
enabled: true
color: 9109504
Profanity:
enabled: false
color: 16755200
# 如果过滤器名称与上述任何一项都不匹配时使用的默认颜色
default-color: 16711680
# 作为页脚图标显示的图像 URL(留空以禁用)
footer-icon: ""
# 作为嵌入缩略图显示的图像 URL(留空以禁用)
thumbnail: ""
# 游戏内管理警报。
notifications:
# 向拥有 chatcop.notify 权限的玩家发送游戏内警报
staff-alerts: true
# 同时广播手动管理操作(禁言、解除禁言、警告)
staff-action-alerts: true
# 将警报镜像到服务器控制台
log-to-console: true
# 也将警报发送给违规玩家(测试时很有用)
notify-offender: false
# 在警报中将引用的消息截断到此字符数
max-message-length: 50
alert-format: "&8[&cAlert&8] &7%player% &8| &f%filter% &8| &7\"%message%\""
action-format: "&8[&bChatCop&8] &7%actor% &f%action% &7%target%&f %detail%"
# 当发送警报时为管理人员播放声音
alert-sound: true
# 可以是 Bukkit 声音名称(BLOCK_NOTE_BLOCK_PLING)或命名空间键(block.note_block.pling)。两者在所有支持的版本中均有效。
alert-sound-type: "BLOCK_NOTE_BLOCK_PLING"
# 支持 & 颜色代码和 &#RRGGBB 十六进制格式。如需显示字面意义的 & 符号,请写入 &&。
# {name} 和 %name% 占位符均可使用。
messages:
blocked: "&c你的消息被拦截了。原因:&f{reason}"
censored: "&e你的消息包含不当语言并被审查。"
muted: "&c你已被禁言。&7剩余时间:&f{time} &8| &7原因:&f{reason}"
muted-permanent: "&c你已被永久禁言。&7原因:&f{reason}"
unmuted: "&a你已解除禁言。"
warned: "&e警告 &7({count}): &f{reason}"
mute-success: "&a已将 &f{player} &a禁言 &f{duration}&a:&f{reason}"
unmute-success: "&a已成功解除 &f{player}&a 的禁言。"
warn-success: "&a已向 &f{player} &7发出警告 ({count})&a:&f{reason}"
already-muted: "&c{player} 已被禁言。"
not-muted: "&c{player} 未被禁言。"
mute-exempt: "&c无法对 {player} 进行禁言。"
slowmode: "&c慢速模式已开启。&7请在 &f{time} &7后再发言。"
join-delay: "&c你刚刚加入服务器。&7你可以在 &f{time}&7 后聊天。"
chat-locked: "&c聊天目前由管理人员锁定。"
chat-lock-on: "&c聊天已被管理人员锁定。"
chat-lock-off: "&a聊天已解锁。"
reload-success: "&aChatCop 配置已重新加载。"
player-not-found: "&c未找到玩家:&f{player}"
no-permission: "&c你没有执行此操作的权限。"
需要帮助,或者想要某个功能?
加入 Discord
欢迎在 Issues 页面提交 Bug 和建议。如果 ChatCop 帮你保持了聊天室的整洁,一个评分会有很大帮助。
Smart, automatic chat moderation — spam, ads, toxicity, threats and profanity, handled for you
Spigot · Paper · Purpur · Folia | 1.20 – 1.21.x | Java 17+ | One jar, no dependencies
ChatCop reads every message your players send — in chat, in private messages, on signs, in books and in anvil renames — and acts on it in real time.
The difference is the detection. Most chat plugins match words. ChatCop normalises the message first, so leet speak, symbol substitution, dots between letters, spaced-out words, repeated characters and invisible unicode all collapse down to the real text before anything is checked.
Demonstrated on a harmless word: sp4mm3r, s.p.a.m, #s#p#a#m, s p a m and example (dot) com are all caught by the same rule that catches the plain spelling. The built-in lists those rules run against cover slurs, hate speech, threats and profanity.
Everything runs in memory, async where it matters, with zero heavy dependencies.
What's new in 1.1.0
- Private messages and commands are filtered — without this, every filter was one
/msg away from being bypassed
- Signs, books and anvil renames are filtered too
- Raid detection — catches the same line arriving from many accounts at once, which per-player tracking cannot see
- Chat control — slowmode, a global chat lock, and a first-join chat delay that shuts down bot raids
- Offline mutes — mute and unmute players who are not on the server
- Points, warnings and history now survive restarts
- Per-filter bypass permissions, plus mute-exempt and mute-override
- Sexual content detection, reported separately from slurs
- Discord queue — a spam wave can no longer trip your webhook's rate limit, and
@everyone in a flagged message can never ping your server
- Built-in update checker and optional bStats metrics
Upgrading from 1.0.x? Just replace the jar. Every new option has a built-in default, so your existing config.yml keeps working — add only the keys you want to change.
Features
Five filters, four ways to respond, and a points system that escalates punishments on its own.
The five filters
| Filter |
What it catches |
| Spam |
Flood detection, duplicate and near-duplicate messages (similarity based, not exact match), excessive caps, repeated characters, cross-player raid detection |
| Advertising |
IPs, URLs, domains, Minecraft server addresses and Discord invites, including spelled-out forms. IP and URL blocking toggle independently, with a domain whitelist for your own addresses |
| Toxicity |
Built-in slur and hate speech list, built-in sexual content list, plus your own phrases |
| Threats |
Death threats, "kys", doxxing, DDoS and swat threats, plus your own phrases |
| Profanity |
Censor mode (****) or block mode, with a per-message limit before the whole message is dropped |
Detection that doesn't get bypassed
Shown with a harmless word — the built-in lists cover the real ones.
- Leet speak —
sp4mm3r, h4ck3r, n00b
- Separators —
s.p.a.m, #s#p#a#m, s-p-a-m
- Letter spacing —
s p a m
- Repeated characters —
spaaaaam
- Zero-width and invisible unicode
- Whole-word matching for your custom phrases, so
nega does not flag negative — with regex still available when you want partial matching
- A whitelist per filter for the terms your server uses legitimately
Four ways to respond
| Action |
Behaviour |
ALLOW |
Let it through |
CENSOR |
Replace the word and send the rest |
BLOCK |
Stop the message |
SHADOW |
Ghost punishment. The message is hidden from everyone except the sender, so they think it sent fine and never learn what your filter catches |
Punishments that escalate on their own
- Every violation awards points, and points decay over time for good behaviour
- Crossing a threshold runs the commands you configure — works with LiteBans, EssentialsX, AdvancedBan or anything else that has a command
- Per-filter commands on top of that, for an instant reaction to a specific offence
- A per-player cooldown, so one spammer cannot trigger thirty punishments in three seconds
- Built-in mutes and warnings — temporary or permanent, offline players included, persisted to disk
Chat control
- Slowmode — a minimum wait between messages
- Chat lock — freeze chat instantly, staff can still talk
- First-join delay — new connections must wait before their first message. Extremely effective against bot raids
Alerts and integrations
- Discord webhooks — rich embeds, per-filter colour and toggle, manual staff actions, rate-limit aware queue
- In-game staff alerts with a configurable format and sound, optional console mirroring
- PlaceholderAPI — 15 placeholders for points, warnings, mute status, slowmode, chat lock and server-wide statistics
- bStats metrics (optional, and off until you set a service id)
- Update checker — Spigot or Modrinth, notifies admins on join. It only reads a version number, it never downloads anything
Built for real servers
- Folia-ready — the same jar runs on Spigot, Paper, Purpur and Folia
- Per-world disable for staff and creative worlds (mutes stay enforced)
- Hex colour support (
&#RRGGBB) everywhere, and Fish & Chips survives unmangled
- Rotating log file and persistent statistics
- Every player-facing message is editable
- Tab completion on every command
Requirements
- Server: Spigot, Paper, Purpur or Folia 1.20+ (tested through 1.21.x)
- Java: 17 or newer
- PlaceholderAPI: optional
Installation
- Drop
ChatCop-1.1.0.jar into your plugins/ folder
- Restart the server
- Edit
plugins/ChatCop/config.yml and run /chatcop reload
That is it — the defaults are production-ready out of the box.
Commands
Main command: /chatcop — aliases /cc and /cop
| Command |
Description |
Permission |
/chatcop help |
Command overview |
chatcop.admin |
/chatcop reload |
Reload the configuration |
chatcop.admin |
/chatcop stats |
Moderation statistics |
chatcop.stats |
/chatcop history <player> |
A player's violation history (works offline) |
chatcop.admin |
/chatcop check <player> |
Points, warnings and mute status at a glance |
chatcop.admin |
/chatcop test <message> |
See what a message would trigger, without sending it (console too) |
chatcop.admin |
/chatcop clear <player> |
Reset a player's points and history |
chatcop.admin |
/chatcop mutelist |
List active mutes |
chatcop.mute |
/chatcop slowmode <seconds> |
Set slowmode, 0 to disable |
chatcop.admin |
/chatcop lock · /chatcop unlock |
Lock or unlock chat |
chatcop.admin |
/ccmute <player> [duration] [reason] |
Mute, online or offline |
chatcop.mute |
/ccunmute <player> |
Unmute, online or offline |
chatcop.mute |
/ccwarn <player> [reason] |
Warn a player |
chatcop.warn |
Durations: s, m, h, d, w — combinable, e.g. 1h30m — or perm for permanent.
Example: /ccmute Steve 2d Advertising
Permissions
| Permission |
Description |
Default |
chatcop.admin |
Full access |
op |
chatcop.mute |
Mute and unmute |
op |
chatcop.mute.exempt |
Cannot be muted by other staff |
false |
chatcop.mute.override |
Can mute exempt players |
false |
chatcop.warn |
Warn players |
op |
chatcop.notify |
Receive in-game alerts |
op |
chatcop.stats |
View statistics |
op |
chatcop.chatlock.bypass |
Talk while chat is locked |
op |
chatcop.bypass |
Bypass all filters |
false |
chatcop.bypass.<filter> |
Bypass one filter: spam, advertising, toxicity, threats, profanity |
false |
chatcop.bypass.slowmode |
Bypass slowmode |
op |
chatcop.bypass.joindelay |
Bypass the first-join delay |
op |
chatcop.bypass skips the filters. It does not let a muted player talk — mutes are always enforced.
PlaceholderAPI
Player: %chatcop_points% · %chatcop_warns% · %chatcop_muted% · %chatcop_mute_time% · %chatcop_mute_reason% · %chatcop_bypass%
Server: %chatcop_total_messages% · %chatcop_total_blocked% · %chatcop_total_censored% · %chatcop_total_mutes% · %chatcop_total_warns% · %chatcop_block_rate% · %chatcop_active_mutes% · %chatcop_slowmode% · %chatcop_chat_locked%
Configuration
Every option is commented in the file, and every option has a built-in default — so an older config keeps working after an update.
Placeholders for punishment commands:
| Token |
Meaning |
Token |
Meaning |
%player% |
Offending player |
%punisher% |
Who triggered it |
%uuid% |
Offending player's UUID |
%reason% |
Why it was flagged |
%message% |
The offending message |
%duration% |
Punishment duration |
%filter% |
Filter name |
%world% |
World name |
In the messages section, both {name} and %name% forms work.
config.yml (click to expand)
general:
# Enable debug mode - logs filter decisions to console (disable on production)
debug: false
# Save all blocked messages to a log file
log-to-file: true
# Path to the log file (relative to the ChatCop plugin folder)
log-file: "logs/chatcop.log"
# Rotate the log once it passes this size, in KB. 0 disables rotation.
log-max-size-kb: 5120
# Silent mode - block messages without telling the sender
silent-block: false
# Worlds where chat filtering is skipped (e.g. staff worlds).
# Mutes are still enforced in these worlds.
disabled-worlds: []
# Checks for a newer version on startup and tells you about it. It only
# READS the latest version number - it never downloads or installs anything.
# Runs fully async and fails silently if offline.
update-checker:
enabled: true
# Also notify players with chatcop.admin when they join, if an update exists
notify-admins: true
# Where to check for the latest version: "spigot" or "modrinth"
source: "spigot"
# Anonymous usage statistics (bStats). Register your plugin at bstats.org,
# then paste the service id below. Left at 0, no metrics are sent at all.
metrics:
enabled: true
service-id: 0
# Shown in all messages. Supports & color codes and &#RRGGBB hex.
# Write && for a literal ampersand.
prefix: "&8[&bChat&3Cop&8] "
# Every filter awards points. Points decay over time. When a player total
# crosses a threshold, that threshold commands run. This is SEPARATE from
# the per-filter punishment commands, which run instantly.
punishments:
# How many points a player loses per minute of good behaviour
point-decay-per-minute: 2
# Minimum seconds between punishment commands for the same player.
# Stops a spammer from triggering dozens of punishments in seconds.
punishment-cooldown-seconds: 3
thresholds:
15:
commands:
- "ccwarn %player% Repeated chat violations"
30:
commands:
- "tempmute %player% 10m Repeated chat violations"
50:
commands:
- "tempmute %player% 1h Excessive chat violations"
# Server-wide controls that run before the filters.
chat-control:
# Seconds a player must wait between messages. 0 disables it.
# Bypass: chatcop.bypass.slowmode
slowmode-seconds: 0
# Seconds a player must be connected before they may chat.
# Very effective against bot raids. 0 disables it.
# Bypass: chatcop.bypass.joindelay
first-join-delay-seconds: 0
# Start with chat locked (staff with chatcop.chatlock.bypass can still talk)
locked-on-start: false
# Without this, every filter is one /msg away from being bypassed.
command-filter:
enabled: true
# Commands whose text is run through the chat filters.
# Format "<command>:<args-before-message>" - /msg <player> <message>
# has one argument before the message, /me <message> has none.
filtered:
- "msg:1"
- "tell:1"
- "whisper:1"
- "w:1"
- "m:1"
- "t:1"
- "r:0"
- "reply:0"
- "me:0"
- "say:0"
- "mail:1"
- "broadcast:0"
# Commands a muted player may not use at all.
blocked-when-muted:
- "msg"
- "tell"
- "whisper"
- "w"
- "m"
- "r"
- "reply"
- "me"
- "mail"
- "say"
- "broadcast"
# The other places players can write text.
extras:
filter-signs: true
filter-books: true
filter-anvil: true
# Mute storage.
mutes:
# Keep mutes across restarts
persistent: true
# Where mutes are stored (relative to the ChatCop plugin folder)
storage-file: "data/mutes.yml"
# Violation points, warning counts and history.
player-data:
# Keep them across restarts. Turn off to make them session-only.
persistent: true
filters:
# -- SPAM FILTER --------------------------------------------
spam:
enabled: true
# Violation points awarded when this filter is triggered
points: 4
# How many seconds a message is remembered for duplicate checks
duplicate-content-expiry: 8
# How many similar messages are allowed before blocking
duplicate-threshold: 4
# Max number of messages allowed within the flood window
flood-messages: 6
# Time window in seconds to track message flooding
flood-window: 3
# How similar two messages must be to count as duplicate (0.0 - 1.0)
# 1.0 = identical only, 0.8 = 80% similar
similarity-threshold: 0.80
# Percentage of capital letters to trigger caps warning (0 - 100)
caps-threshold: 70
# Minimum message length before the caps check applies
caps-min-length: 12
# Points awarded for excessive caps (usually lower than main points)
caps-points: 2
# Block messages with a character repeated too many times ("heeellooo")
repeated-chars: true
repeated-chars-threshold: 10
# Catches the same line arriving from several accounts at once, which is
# what a bot raid looks like. Per-player tracking cannot see this, because
# each account only sends the message once.
cross-player:
enabled: true
# How many different players must send it within the window
player-threshold: 4
# Window in seconds
window: 10
# How similar the messages must be (0.0 - 1.0)
similarity: 0.90
points: 6
punishment:
# Commands to run when this filter is triggered (leave empty [] for none)
commands: []
# -- ADVERTISING FILTER -------------------------------------
advertising:
enabled: true
points: 10
# Block raw IP addresses (e.g. 192.168.1.1)
block-ips: true
# Block URLs, domains and Discord invites
block-urls: true
# Extra domains to block. A plain word is matched as a whole word;
# anything containing regex characters is treated as a regex.
blocked-domains: []
# Domains that are always allowed (put your own server domains here)
whitelist-domains: []
punishment:
commands: []
# -- TOXICITY FILTER ----------------------------------------
toxicity:
enabled: true
points: 8
# Ghost/shadow mode: flagged messages are hidden from everyone EXCEPT the
# sender, so they think it sent fine and don't try to bypass.
shadow-mode: false
# Built-in list of racial and identity slurs
block-slurs: true
# Built-in list of sexual content (reported separately from slurs)
block-sexual-content: true
# Smart detection sees through leet speak, symbols and letter spacing
smart-detection: true
# Your own phrases. A plain word matches as a whole word, so "nega" will
# NOT flag "negative". Use regex if you want partial matching.
blocked-phrases: []
# Phrases that should never be flagged by this filter
whitelisted-phrases: []
punishment:
commands: []
# -- THREAT FILTER ------------------------------------------
threats:
enabled: true
points: 12
shadow-mode: false
blocked-phrases:
- "i will leak your ip"
- "i will ddos"
- "i will doxx"
whitelisted-phrases: []
punishment:
commands: []
# -- PROFANITY FILTER ---------------------------------------
profanity:
enabled: true
points: 3
# Censor mode replaces bad words instead of blocking the message.
# If a message can't be censored safely (spaced-out obfuscation, for
# example) it is blocked rather than sent through uncensored.
censor-mode: true
# Character used to replace bad words
censor-char: "*"
# Points awarded when a message is censored rather than blocked
censor-points: 1
# How many profane words are allowed before blocking the message entirely
max-per-message: 3
blocked-phrases: []
whitelisted-phrases: []
punishment:
commands: []
# Discord webhook alerts.
discord:
enabled: false
# Your Discord webhook URL (channel settings > integrations)
webhook-url: ""
# Also post manual staff actions (mutes, unmutes, warns)
staff-actions: true
# Colour for staff action embeds
action-color: 3447003
# Alerts are queued and sent one at a time so a spam wave doesn't
# trip Discord's rate limit.
send-interval-seconds: 2
# Maximum queued alerts before the oldest are dropped
queue-limit: 50
filters:
# Each filter can be individually enabled/disabled for webhook alerts.
# Color is decimal - use https://www.spycolor.com to convert from hex.
Spam:
enabled: false
color: 16776960
Advertising:
enabled: true
color: 16753920
Toxicity:
enabled: true
color: 16711680
Threats:
enabled: true
color: 9109504
Profanity:
enabled: false
color: 16755200
# Fallback color if the filter name doesn't match any above
default-color: 16711680
# URL to an image shown as the footer icon (leave empty to disable)
footer-icon: ""
# URL to an image shown as the embed thumbnail (leave empty to disable)
thumbnail: ""
# In-game staff alerts.
notifications:
# Send in-game alerts to players with chatcop.notify
staff-alerts: true
# Also announce manual staff actions (mute, unmute, warn)
staff-action-alerts: true
# Mirror alerts to the server console
log-to-console: true
# Send the alert to the offending player too (useful when testing)
notify-offender: false
# Trim the quoted message in alerts to this many characters
max-message-length: 50
alert-format: "&8[&cAlert&8] &7%player% &8| &f%filter% &8| &7\"%message%\""
action-format: "&8[&bChatCop&8] &7%actor% &f%action% &7%target%&f %detail%"
# Play a sound to staff when an alert is sent
alert-sound: true
# Either a Bukkit sound name (BLOCK_NOTE_BLOCK_PLING) or a namespaced
# key (block.note_block.pling). Both work on every supported version.
alert-sound-type: "BLOCK_NOTE_BLOCK_PLING"
# Supports & color codes and &#RRGGBB hex. Write && for a literal &.
# Both {name} and %name% placeholders work.
messages:
blocked: "&cYour message was blocked. Reason: &f{reason}"
censored: "&eYour message contained inappropriate language and was censored."
muted: "&cYou are muted. &7Time remaining: &f{time} &8| &7Reason: &f{reason}"
muted-permanent: "&cYou are permanently muted. &7Reason: &f{reason}"
unmuted: "&aYou are no longer muted."
warned: "&eWarning &7({count}): &f{reason}"
mute-success: "&aMuted &f{player} &afor &f{duration}&a: &f{reason}"
unmute-success: "&aSuccessfully unmuted &f{player}&a."
warn-success: "&aWarned &f{player} &7({count})&a: &f{reason}"
already-muted: "&c{player} is already muted."
not-muted: "&c{player} is not muted."
mute-exempt: "&c{player} cannot be muted."
slowmode: "&cSlowmode is on. &7Wait &f{time} &7before chatting again."
join-delay: "&cYou just joined. &7You can chat in &f{time}&7."
chat-locked: "&cChat is currently locked by staff."
chat-lock-on: "&cChat has been locked by staff."
chat-lock-off: "&aChat has been unlocked."
reload-success: "&aChatCop configuration reloaded."
player-not-found: "&cPlayer not found: &f{player}"
no-permission: "&cYou don't have permission to do that."
Need help, or want a feature?
Join the Discord
Bugs and suggestions are welcome on the issues page. If ChatCop keeps your chat clean, a rating helps a lot.
评论 0
登录后参与评分
还没有评论,来抢沙发吧