CommandNotifier (CN) 是一款服务器指令执行通知系统。根据配置选项和权限,符合条件的玩家将在指令被执行(无论是玩家执行还是控制台执行)时收到通知。即使您离线,也不会错过任何信息——当您重新登录时,系统会以清晰分区、可导航的聊天列表形式,向您展示自您上次离开以来所有已执行的指令。该插件的每个方面都可自定义!
测试服务器:142.44.222.241:25602
核心功能
- 可自定义的指令执行通知显示方式。
- 内置指令日志浏览器,可浏览历史记录。
- 忽略特定指令。
- 内置 Tab 自动补全。
- 每位玩家独立的通知开关选项。
- 本地 SQL 日志记录系统。
- 可配置的 JSON 消息格式。
- 所有消息文本 100% 可自定义。
- 智能登录系统,提示您自上次登出以来执行的指令。
- 在交互式分区列表中查看指定时间段内执行的指令。
配置文件
config.yml
主要配置文件,用于控制插件的基本行为和通知规则。
# 是否让 OP 在未拥有 commandnotifier.notify 权限时也接收指令通知。
NotifyOpsByDefault: false
# 是否不记录并通知非真实指令的执行(例如无效指令)。
IgnoreInvalidCommands: true
# 是否向有权限的玩家通知其他玩家执行的指令。
PlayerCommandNotifications: true
# 是否向有权限的玩家通知控制台执行的指令。
ConsoleCommandNotifications: true
# 是否在玩家加入时显示自其上次登出以来的指令日志分区。
ShowLogOnJoin: true
# 反转忽略列表,将其变为白名单模式。
InvertIgnoreList: false
# 指定不应被记录和触发通知的指令列表。
# 插件会自动解析被忽略指令的别名并一同忽略。
IgnoreList:
- commandnotifier
- broadcast
- balance
- tpahere
- tpdeny
- back
- fly
- god
- kit
- tpa
- is
# 更新检查器。
UpdateCheckerEnabled: true
# false:所有 OP 在加入时都会收到新更新通知。
# true:只有同时拥有 commandnotifier.update 权限的 OP 才会收到通知。
# 注意:任何拥有 commandnotifier.update 权限的用户(无论是否为 OP)都会被通知。
UpdateCheckerPermissionOnly: falsemessages.yml
消息配置文件,用于自定义插件发送的所有文本消息。
# 所有消息完全支持颜色代码、格式和 ASCII 符号。
# 设置 Prefix 并使用 %prefix% 在消息中添加对应前缀。
# 在任何消息前加上 <ActionBar> 可将其作为 ActionBar 消息发送。
# 将消息留空 ('') 即可禁用它。
# 您还可以创建带有悬停和点击事件的消息。语法选项(逗号和引号之间不允许有空格):
# - ["Message","/Command"]
# - ["Message","Hover"]
# - ["Message","/Command","Hover"]
# - ["Message","/Command","Suggest"]
# - ["Message","/Command","Hover","Suggest"]
# 您可以在一条消息中添加任意数量的事件。例如:
# '%prefix% &cInvalid arguments! ["&c&n&oHelp","/commandnotifier help","&aClick to get help!"]'
# "Suggest" 标签表示点击事件应建议该指令(默认是直接运行)。
Prefix: '&7[ &9CommandNotifier&7 ] '
Messages:
General:
InvalidPermission: '%prefix% &cYou do not have permission to do this!'
NoCommands: Unknown command. Type "/help" for help.
PlayerOnly: '%prefix% &cCommand can only be used as a Player!'
InvalidArguments: '%prefix% &cInvalid arguments! ["&c&n&oHelp","/commandnotifier help","&aClick to get help!"]'
ConfigurationsReloaded: '%prefix% &aConfiguration files successfully reloaded!'
CommandNotifier:
Enabled: '%prefix% &aCommand notifications have been enabled!'
Disabled: '%prefix% &aCommand notifications have been disabled!'
ExecutedCommand: '%prefix% &e%player% &aexecuted &e%command%'
CommandsSinceLogout: '%prefix% &eExecuted commands since you last logged out:'
NoCommandsInSpecifiedTimespan: '%prefix% &cThere were no executed commands in the specified timespan!'
LogEntryHeader: '&e&l&m--- -&e Page &a%page%/%pages% &e&l&m------------'
LogEntryFormat: ' &7&l● &a%timestamp% &e&l> &e%player% &aexecuted &e%command%'
LogEntryFooter: '&e&l&m--- -&e ["[&9Previous&f]","/commandnotifier log page previous","&aClick to go to the previous page"] &e&l&m--&e ["[&9Next&f]","/commandnotifier log page next","&aClick to go to the next page"] &e&l&m--- -'指令与权限
所有 /commandnotifier 指令都需要基础权限 commandnotifier.commands 以及对应的子指令权限。
指令列表
/cn [help]
别名:h
打印帮助菜单。菜单可点击并包含带有说明的悬停消息。
权限:commandnotifier.commands.help
/cn toggle
别名:tog, t
切换指令通知的接收状态。
权限:commandnotifier.commands.toggle
/cn log <time...>
别名:l
打印从当前时间减去指定时长的时间点开始的所有已执行指令日志。
权限:commandnotifier.commands.log
/cn log page <"next"/"previous"/page>
别名:l
在检索到的日志中导航。跳转到下一页/上一页或指定页码。
权限:commandnotifier.commands.log
/cn reload
别名:rel, r
重新加载所有配置文件。
权限:commandnotifier.commands.reload
其他权限
commandnotifier.notify
拥有此权限的玩家将接收指令通知。
commandnotifier.update
拥有此权限的玩家会收到新版本更新通知。
commandnotifier.log.bypass
拥有此权限的玩家执行的指令将不会被记录。
安装与设置
安装 CommandNotifier 与安装其他插件一样简单。
- 下载 CommandNotifier。
- 将插件文件拖放至服务器的
plugins文件夹。 - 启动/重启/重载您的服务器。
- 根据您的意愿配置插件。
Discord Webhook 集成
通过创建 Discord Webhook,您可以让 CommandNotifier 将所有已执行的指令记录到您 Discord 服务器的指定频道中。
如何创建 Webhook:
- 在 Discord 频道设置中创建 Webhook。
- 复制 “WEBHOOK URL”。
- 将其粘贴到
config.yml文件中的WebhookURL配置项即可。
版本与支持
CommandNotifier 仅支持 Spigot 服务器。也就是说,该插件在 PaperSpigot 等 Spigot 分支上应该也能正常工作。
已确认可运行的版本:
- 1.8
- 1.9
- 1.10
- 1.11
- 1.12
- 1.13
- 1.14
- 1.15