Discord 聊天记录器
通过 Webhook 将你的 Minecraft 服务器聊天中继到 Discord 频道。无需机器人账号、令牌或网关连接——只需一个 Webhook URL。
设计上为单向传输:Minecraft 的聊天会显示在 Discord 中,而 Discord 的消息不会显示在 Minecraft 中。
设置方法
- 在 Discord 中:服务器设置 -> 集成 -> Webhooks -> 新建 Webhook,选择一个频道,然后点击 复制 Webhook URL。
- 将 jar 文件放入
plugins/(Bukkit 及代理端)或 mods/(Fabric 和 NeoForge),并启动一次服务器以生成配置文件。
- 将你的 Webhook URL 粘贴到配置文件中的
webhook-url 字段。
- 运行
/discordchatlogger reload,或者重启服务器。
请妥善保管 Webhook URL —— 任何拥有该链接的人都可以向你的频道发送消息。
支持的平台
| 平台 |
版本 |
| Spigot / Paper / Purpur / Folia |
1.8.8 至 26.2,单个 jar 包通用 |
| Velocity |
3.x 和 4.x |
| BungeeCord / Waterfall |
当前版本 |
| Fabric |
1.20.1 至 1.21.11(每个版本需要一个单独的 jar) |
| NeoForge |
1.20.4 至 26.2(每个版本需要一个单独的 jar) |
目前尚不支持 Minecraft 26.x 的 Fabric 版本:Minecraft 26 采用非混淆发布,而 Fabric 的构建工具仍需要映射集。请使用 NeoForge 版本。
为何体积小巧
没有第三方依赖。请求使用 Java 内置的 HTTP 客户端,所需的少量 JSON 由手动编写,因此 Bukkit 版 jar 仅约 30 KB,不会与其他插件捆绑的库发生冲突。
正确处理的事项
- 聊天内容永远无法 ping
@everyone、某个角色或用户,无论玩家输入什么
- 聊天中输入的 Markdown 会被转义,从而防止日志被重新格式化
- 消息会进行批处理以遵守 Discord 的频率限制;若触发频率限制,则会暂停并重试,而不是丢弃消息
- 被其他插件取消的消息(如禁言玩家、词缀过滤)不会被中继
- 在代理端永远不会中继命令,因此输错的
/login 不会泄露信息
- 不触碰主线程,且 Webhook URL 绝不会写入日志
配置
支持将玩家名称和皮肤作为 Discord 作者显示、自定义消息格式、可选的每服务器标签、颜色代码剥离,以及可选的加入/离开和死亡消息。
源码、问题反馈及完整文档:
Discord Chat Logger
Relays your Minecraft server chat into a Discord channel using a webhook. No bot
account, no token, no gateway connection - just a webhook URL.
One-way by design: Minecraft chat shows up in Discord, Discord messages do not show
up in Minecraft.
Setting it up
- In Discord: Server Settings -> Integrations -> Webhooks -> New Webhook, pick a
channel, and press Copy Webhook URL.
- Put the jar in
plugins/ (Bukkit and proxies) or mods/ (Fabric and NeoForge)
and start the server once so the config file is written.
- Paste your webhook URL into
webhook-url in the config.
- Run
/discordchatlogger reload, or restart the server.
Keep the webhook URL secret - anyone who has it can post to your channel.
Supported platforms
| Platform |
Versions |
| Spigot / Paper / Purpur / Folia |
1.8.8 through 26.2, from one single jar |
| Velocity |
3.x and 4.x |
| BungeeCord / Waterfall |
current |
| Fabric |
1.20.1 to 1.21.11 (one jar per version) |
| NeoForge |
1.20.4 to 26.2 (one jar per version) |
Fabric on Minecraft 26.x is not available yet: Minecraft 26 ships unobfuscated and
Fabric's build tooling still requires a mapping set. Use the NeoForge build there.
Why it is small
There are no third-party dependencies. Requests use the HTTP client built into Java
and the small amount of JSON needed is written by hand, so the Bukkit jar is about
30 KB and cannot clash with libraries that other plugins bundle.
Things it gets right
- Chat can never ping
@everyone, a role, or a user, whatever a player types
- Markdown typed in chat is escaped, so the log cannot be reshaped
- Messages are batched to stay inside Discord's rate limit, and a rate limit pauses
and retries rather than dropping messages
- Messages cancelled by other plugins (muted players, word filters) are not relayed
- Commands are never relayed on proxies, so a mistyped
/login cannot leak
- Nothing touches the main thread, and the webhook URL is never written to the log
Configuration
Player name and skin as the Discord author, custom message format, an optional
per-server label, colour-code stripping, and optional join/leave and death messages.
Source, issues and full documentation:
评论 0
登录后参与评分
还没有评论,来抢沙发吧