AnvilWatch
AnvilWatch 是一款轻量级的 Minecraft 管理插件,通过铁砧监控和控制物品重命名行为。专为服务器管理员设计,确保所有重命名操作都被记录,并根据可配置的被禁词列表自动阻止不合适的名称。
如有疑问,请加入 Discord!
功能
- 将所有通过铁砧进行的物品重命名操作记录到日志文件中
- 阻止包含被禁词的物品名称(不区分大小写)
- 当发生重命名时,向拥有相应权限的所有在线管理员发送警报
- 支持基于权限的绕过机制,允许受信任的用户例外处理
- 提供一组管理员命令来管理被禁词和插件行为
- 无需重启服务器即可实时重载被禁词列表
- 高级过滤: 支持正则表达式 (Regex)、同形字符归一化以及 Leet-speak(黑客语)检测。
- 当发生重命名时,向拥有相应权限的所有在线管理员发送警报。
为什么使用 AnvilWatch?
玩家使用具有攻击性、不适当或破坏性的名称重命名物品是 Minecraft 服务器中常见的问题。AnvilWatch 提供了一种简单有效的方式来:
- 使用可自定义的词过滤器自动阻止此类重命名
- 保留所有重命名事件的详细日志,以便进行管理和问责
- 在重命名尝试发生时实时通知工作人员
- 使用游戏内命令轻松管理过滤器和设置
正则表达式与高级过滤
AnvilWatch 支持强大的正则表达式 (Regex) 用于高级管理。你的 BannedWords.txt 中的每个条目都被视为一个正则表达式模式,允许你阻止整族词汇或特定的字符模式。
- 不区分大小写: 所有检查均自动不区分大小写。
- 模式匹配: 使用正则表达式捕捉变体。例如,
bad.* 将阻止 "badword"、"badstuff" 和 "badlink"。
- 字符集: 使用
b[a4]dw[o0]rd 来捕捉如 "b4dw0rd" 这样的 Leet-speak 变体。
- 归一化: 插件会在检查过滤器之前,自动将同形字符(来自其他字母表的相似外观字符)和 Leet-speak 转换回标准文本,从而防止简单的绕过行为。
命令
| 命令 |
描述 |
/anvilwatch help |
显示可用命令列表 |
/anvilwatch reload |
从 BannedWords.txt 重新加载 config.yml 和禁词列表 |
/anvilwatch add <word> |
将某个词添加到禁词列表中 |
/anvilwatch remove <word> |
从禁词列表中移除某个词 |
/anvilwatch log <on/off> |
切换游戏内改名日志消息的开关,并将设置保存至重启后仍生效 |
/anvilwatch check <文本> |
检查提供的文本是否匹配当前的禁用词列表,并在检测到匹配模式时报告拦截信息 |
/anvilwatch recent [页码] |
显示最近10条成功的和已被拦截的重命名记录,支持点击分页浏览 |
别名: /anw
用法: /anvilwatch <help|reload|add|remove|log|check|recent> <参数>
权限
| 权限 |
描述 |
默认值 |
anvilwatch.admin |
接收重命名警报并使用插件管理命令 |
op |
anvilwatch.bypass |
允许在不受词缀过滤器限制的情况下重命名物品 |
false |
配置
-
禁用词列表: 由插件文件夹中的 BannedWords.txt 文件管理。每行非注释内容均被视为不区分大小写的 Java 正则表达式。
-
配置文件: config.yml 会在插件文件夹中生成,用于控制玩家警告、管理员通知、通知显示模式、日志位置以及被阻止尝试的记录。
-
消息: 可配置的消息使用 MiniMessage 格式。可用的占位符为 <player>、<item>、<old> 和 <new>。
-
玩家警告: messages.player-blocked 控制当玩家的改名尝试被阻止时显示的消息。
-
管理员消息: messages.admin-rename 控制成功改名的通知,而 messages.admin-blocked 控制被阻止尝试的通知。
-
通知显示: messages.admin-display 接受 CHAT、ACTION_BAR 或 BOTH。
-
成功改名日志: logging.rename-file 控制成功改名的日志位置,默认值为 logs/anvil_renames.log。
-
被阻止尝试日志: logging.blocked-file 控制被阻止尝试的日志位置,默认值为 logs/blocked_renames.log。
-
被阻止尝试记录: logging.log-blocked-attempts 控制是否将被阻止的尝试写入阻止日志,默认值为 true。
-
日志路径: 相对路径将在 AnvilWatch 插件文件夹内解析。也支持绝对路径,缺失的父目录会自动创建。
-
持久化通知: /anvilwatch log off 偏好设置存储在生成的 data.yml 文件中,并在服务器重启后保留。
-
历史日志: 现有日志文件会被保留,新条目将追加到其中。
-
无需重启服务器: 使用 /anvilwatch reload 即可应用对配置和禁用词列表的更改。
一个默认的 config.yml 看起来像这样:
messages:
player-blocked: "<red>你不能在物品名称中使用该词。</red>"
admin-rename: "<yellow><player></yellow> 将 <aqua><item></aqua> 从 '<red><old></red>' 重命名为 '<green><new></green>'"
admin-blocked: "<yellow><player></yellow> 尝试在 <aqua><item></aqua> 上使用被禁用的名称:'<red><new></red>'"
admin-display: CHAT
logging:
rename-file: "logs/anvil_renames.log"
blocked-file: "logs/blocked_renames.log"
log-blocked-attempts: true
兼容性
- Minecraft 版本: 26.2
- API 版本: 26.2
- Java 版本: 25
- 依赖项: 无
开始使用
- 将插件 JAR 文件放入服务器的
plugins/ 文件夹中。
- 启动服务器以生成
config.yml、BannedWords.txt、日志目录以及独立的日志文件。
- 查看并编辑
config.yml,自定义消息、通知显示和日志记录设置。
- 通过手动编辑
BannedWords.txt 或在游戏内使用 /anvilwatch add <word> 添加禁词。
- 将
anvilwatch.admin 权限授予可信的工作人员。
- 使用
/anvilwatch check <text> 验证当前过滤器对某个单词或短语的处理方式。
- 使用
/anvilwatch recent 查看成功和已阻止的重命名活动。
- 在玩家重命名物品时,监控日志文件和游戏内警报。
AnvilWatch
AnvilWatch is a lightweight Minecraft moderation plugin that monitors and controls item renaming through anvils. Designed for server administrators, it ensures that all rename actions are tracked and that inappropriate names are blocked automatically based on a configurable banned word list.
Please join the Discord if you have questions!
Features
- Logs all item renames done through anvils to a log file
- Blocks item names that contain banned words (case-insensitive)
- Alerts all online admins with the correct permission when a rename occurs
- Supports permission-based bypass for trusted users
- Provides a set of admin commands to manage banned words and plugin behavior
- Live reloading of banned word list without restarting the server
- Advanced Filtering: Supports Regular Expressions (Regex), Homoglyph normalization, and Leet-speak detection.
- Alerts all online admins with the correct permission when a rename occurs.
Why Use AnvilWatch?
Players renaming items with offensive, inappropriate, or disruptive names is a common issue on Minecraft servers. AnvilWatch provides a simple and effective way to:
- Automatically prevent these renames using a customizable word filter
- Keep a detailed log of all rename events for moderation and accountability
- Notify staff in real time when rename attempts occur
- Manage filters and settings easily in-game using commands
Regex & Advanced Filtering
AnvilWatch supports powerful Regular Expressions (Regex) for advanced moderation. Each entry in your BannedWords.txt is treated as a regex pattern, allowing you to block entire families of words or specific character patterns.
- Case-Insensitive: All checks are automatically case-insensitive.
- Pattern Matching: Use regex to catch variations. For example,
bad.* will block "badword", "badstuff", and "badlink".
- Character Sets: Use
b[a4]dw[o0]rd to catch leet-speak variations like "b4dw0rd".
- Normalizations: The plugin automatically converts homoglyphs (look-alike characters from other alphabets) and leet-speak back to standard text before checking your filters, preventing simple bypasses.
Commands
| Command |
Description |
/anvilwatch help |
Displays a list of available commands |
/anvilwatch reload |
Reloads config.yml and the banned word list from BannedWords.txt |
/anvilwatch add <word> |
Adds a word to the banned word list |
/anvilwatch remove <word> |
Removes a word from the banned word list |
/anvilwatch log <on/off> |
Toggles in-game rename log messages for the user and saves the setting across restarts |
/anvilwatch check <text> |
Checks text against the current banned word list and reports a matching pattern when blocked |
/anvilwatch recent [page] |
Shows the 10 most recent successful and blocked rename entries together, with clickable pagination |
Alias: /anw
Usage: /anvilwatch <help|reload|add|remove|log|check|recent> <args>
Permissions
| Permission |
Description |
Default |
anvilwatch.admin |
Receive rename alerts and use plugin management commands |
op |
anvilwatch.bypass |
Allows renaming items without word filter restrictions |
false |
Configuration
- Banned Word List: Managed in the
BannedWords.txt file located in the plugin folder. Each non-comment line is treated as a case-insensitive Java regular expression.
- Configuration File:
config.yml is generated in the plugin folder and controls player warnings, administrator notifications, notification display modes, log locations, and blocked-attempt logging.
- Messages: Configurable messages use MiniMessage formatting. Available placeholders are
<player>, <item>, <old>, and <new>.
- Player Warning:
messages.player-blocked controls the message shown when a player's rename attempt is blocked.
- Admin Messages:
messages.admin-rename controls successful-rename notifications, while messages.admin-blocked controls blocked-attempt notifications.
- Notification Display:
messages.admin-display accepts CHAT, ACTION_BAR, or BOTH.
- Successful Rename Log:
logging.rename-file controls the successful-rename log location. It defaults to logs/anvil_renames.log.
- Blocked Attempt Log:
logging.blocked-file controls the blocked-attempt log location. It defaults to logs/blocked_renames.log.
- Blocked Attempt Logging:
logging.log-blocked-attempts controls whether blocked attempts are written to the blocked log and defaults to true.
- Log Paths: Relative paths are resolved inside the AnvilWatch plugin folder. Absolute paths are also supported, and missing parent directories are created automatically.
- Persistent Notifications:
/anvilwatch log off preferences are stored in the generated data.yml file and survive server restarts.
- Historical Logs: Existing log files are preserved and new entries are appended.
- No server restart required: Changes to the configuration and banned word list can be applied using
/anvilwatch reload.
A default config.yml looks like this:
messages:
player-blocked: "<red>You cannot use that word in item names.</red>"
admin-rename: "<yellow><player></yellow> renamed <aqua><item></aqua> from '<red><old></red>' to '<green><new></green>'"
admin-blocked: "<yellow><player></yellow> attempted to use a blocked name on <aqua><item></aqua>: '<red><new></red>'"
admin-display: CHAT
logging:
rename-file: "logs/anvil_renames.log"
blocked-file: "logs/blocked_renames.log"
log-blocked-attempts: true
Compatibility
- Minecraft Version: 26.2
- API Version: 26.2
- Java Version: 25
- Dependencies: None
Getting Started
- Drop the plugin JAR into your server's
plugins/ folder.
- Start the server to generate
config.yml, BannedWords.txt, the log directory, and the separate log files.
- Review and edit
config.yml to customize messages, notification display, and logging.
- Add banned words either manually to
BannedWords.txt or in-game using /anvilwatch add <word>.
- Assign the
anvilwatch.admin permission to trusted staff.
- Use
/anvilwatch check <text> to verify how the current filter handles a word or phrase.
- Use
/anvilwatch recent to review successful and blocked rename activity.
- Monitor the log files and in-game alerts as players rename items.
评论 0
登录后参与评分
还没有评论,来抢沙发吧