DeathsToDiscord
DeathsToDiscord 是一款轻量级的 Paper 插件,用于将 Minecraft 服务器的死亡排行榜同步到 Discord。
它不会在每次玩家死亡时发送新的 Discord 消息,而是创建一条排行榜消息并自动持续更新。
1.5.1 新增内容
- 适配 Paper 26.3 stable build 244
- 更新了内部依赖项以提高兼容性和维护性
- 继续支持 Paper 26.2 及更高版本
功能特性
- 玩家死亡时自动更新 Discord 排行榜
- 使用单条 Discord 消息,避免消息刷屏
- 支持显示所有玩家或可配置的前 N 名排行榜
- 包含离线和已见过的玩家
- 可选显示死亡数为零的玩家
- 如果 Discord 消息被删除,会自动恢复排行榜
- 处理快速连续死亡时不会发送不必要的 Discord 请求
- 防止超出 Discord 的消息长度限制
- 支持通过
/d2d reload 实时重载配置
- 无需 Discord 机器人
工作原理
DeathsToDiscord 读取记录玩家死亡次数的 Minecraft 计分板目标(objective)。
插件启动时,它会连接到配置好的 Discord Webhook,并创建或恢复排行榜消息。每当有玩家死亡,排行榜就会重新构建,现有的 Discord 消息也会自动更新。
插件会在服务器重启之间记住该 Discord 消息的 ID,因此每次服务器启动时不会创建新的排行榜消息。
要求
- Paper 26.2 或更高版本
- Java 25
- 一个 Discord Webhook
- 一个用于追踪死亡次数的 Minecraft 计分板目标
简易设置
- 将 DeathsToDiscord 安装到服务器的
plugins 文件夹中。
- 启动服务器以生成配置文件。
- 添加你的 Discord Webhook URL。
- 设置你要使用的计分板目标名称。
- 重启服务器或运行
/d2d reload。
就这么简单——排行榜将保持自动同步。
命令
/d2d reload
重载配置并刷新 Discord 排行榜。
权限:d2d.admin
适用场景
DeathsToDiscord 非常适合 SMP、私人服务器、社区服务器,以及任何希望在不运行单独机器人的情况下,以简单方式在 Discord 中展示服务器死亡排名的场景。
Discord Webhook 设置
- 打开 Discord 服务器,选择要显示排行榜的频道。
- 打开 服务器设置 → 集成 → Webhooks。
- 创建一个新的 Webhook 并选择所需的频道。
- 复制 Webhook URL。
- 将其粘贴到 DeathsToDiscord 配置中的
webhook-url 处。
请将 Webhook URL 视为密码。任何人只要拥有该 URL,就可以使用该 Webhook 向对应的 Discord 频道发布消息。
Minecraft 计分板设置
DeathsToDiscord 读取现有的计分板目标。它本身不会创建或增加死亡计数目标。
要创建一个名为 deaths 的标准死亡计数器,请运行:
/scoreboard objectives add deaths deathCount "Deaths"
若要查看服务器上已有的目标,请运行:
/scoreboard objectives list
如果你的死亡目标使用了不同的名称,请在 config.yml 的 objective-name 下设置该名称。
配置
配置文件位置:
plugins/DeathsToDiscord/config.yml
默认配置:
webhook-url: "PASTE_WEBHOOK_URL_HERE"
# 来自 /scoreboard objectives list 的计分板目标名称
objective-name: "deaths"
# "ALL" = 列出所有人
# "TOP" = 仅列出前 N 名
mode: "ALL"
top: 10
# 如果为 true,则包含死亡数为 0 的玩家
show-zero-deaths: true
# 插件将创建第一条消息并自动填充此字段
message-id: ""
# 短暂延迟以批量处理快速死亡并避免速率限制
update-delay-seconds: 2
# Discord 消息内容最多可达 2000 个字符。
# 此处保留少量安全缓冲,并在排行榜过大时进行截断而非直接失败。
max-discord-content-characters: 1900
webhook-url
用于创建和更新排行榜消息的 Discord Webhook URL。
webhook-url: "PASTE_WEBHOOK_URL_HERE"
objective-name
DeathsToDiscord 读取的 Minecraft 计分板目标名称,用于获取每个玩家的死亡次数。
objective-name: "deaths"
使用 /scoreboard objectives list 验证正确的目标名称。
mode
控制显示多少被追踪的玩家。
mode: "ALL"
可用值:
ALL — 显示符合 Discord 消息长度的所有被追踪玩家
TOP — 仅显示排名最高的玩家,数量由 top 设置限制
玩家按死亡次数从高到低排序。若次数相同,则按字母顺序排列。
top
当 mode 设置为 TOP 时,设置显示的玩家数量。
top: 10
最小有效值为 1。
show-zero-deaths
控制是否包含死亡数为零的玩家。
show-zero-deaths: true
true — 包含死亡数为零的玩家
false — 隐藏死亡数为零的玩家
message-id
存储 Discord 排行榜消息的 ID。
message-id: ""
初始设置时请留空。DeathsToDiscord 会自动创建第一条消息并将其中 ID 保存于此。
通常不应手动编辑此值。如果排行榜消息从 Discord 中被删除,请清空该值,保存配置,并运行 /d2d reload,以便插件创建替换消息。
如果你将插件迁移到不同的 Webhook 或 Discord 频道,且现有消息无法再通过该 Webhook 编辑,你也应清空此值。
update-delay-seconds
在死亡发生后更新 Discord 之前增加短暂的延迟。
update-delay-seconds: 2
这有助于将快速发生的多次死亡合并为一次更新,并减少不必要的 Webhook 请求。设置为 0 将禁用延迟。
max-discord-content-characters
设置 DeathsToDiscord 用于排行榜消息的最大字符数。
max-discord-content-characters: 1900
Discord 对普通消息内容的最大字符限制为 2,000 个。DeathsToDiscord 默认设置为 1900,以预留安全缓冲。配置值的最小值为 500,最大值为 2000。
如果排行榜过大,插件会保留尽可能多的排名玩家,并添加一行说明省略了多少其他玩家。
命令
/d2d reload
重新加载 config.yml 并立即更新 Discord 排行榜消息。
权限:
d2d.admin
该权限默认授予服务器操作员(operators)。
排行榜工作原理
当 DeathsToDiscord 启动且已配置有效的 Webhook 时,它会立即同步排行榜。
如果 message-id 为空,插件将创建一条新的 Discord 消息,并自动将其 ID 保存到 config.yml 中。后续的更新都会编辑同一条消息。
每当有玩家死亡时,DeathsToDiscord 会等待配置的 update-delay-seconds 时间,然后从配置的分项计分板目标(scoreboard objective)重新构建排行榜。在延迟期间发生的多次死亡会被合并到同一次更新中。
Discord 排行榜样式如下:
? Death Leaderboard (Everyone)
1. PlayerOne — 12
2. PlayerTwo — 7
3. PlayerThree — 2
Tracked players: 3
Updated: ...
故障排除
插件提示未设置 Webhook URL
打开 plugins/DeathsToDiscord/config.yml,将 PASTE_WEBHOOK_URL_HERE 替换为有效的 Discord Webhook URL,保存文件后运行 /d2d reload。
找不到计分板目标
运行:
/scoreboard objectives list
然后确保 objective-name 与服务器上记录死亡次数的计分板目标名称完全匹配。
Discord 排行榜消息被删除
设置:
message-id: ""
保存配置文件并运行:
/d2d reload
DeathsToDiscord 将创建一条新的排行榜消息,并自动保存新的消息 ID。
Webhook 或 Discord 频道已更改
如果旧的 message-id 所属的消息无法被新 Webhook 编辑,请清空 message-id 并运行 /d2d reload,以便通过新 Webhook 创建一条新消息。
部分玩家未显示
请检查以下内容:
- 服务器是否正在追踪该玩家。
- 配置的分项计分板目标中包含预期的分数。
- 如果玩家死亡次数为零,
show-zero-deaths 是否已启用。
mode 是否设置为 TOP 且上限排除了该玩家。
- 排行榜是否已达到配置的 Discord 内容字符限制。
排行榜提示部分玩家被省略
完整排行榜的大小超过了配置的 Discord 消息字符限制。请将 max-discord-content-characters 增加至最多 2000,使用 TOP 模式,或减少显示的玩家数量。
支持与错误报告
如果您发现错误或有任何功能建议,请在 GitHub Issues 页面提交问题。
许可证
DeathsToDiscord 根据 MIT License 发布。
DeathsToDiscord
DeathsToDiscord is a lightweight Paper plugin that keeps your Minecraft server's death leaderboard synced to Discord.
Instead of sending a new Discord message every time someone dies, the plugin creates one leaderboard message and keeps updating it automatically.
What's New in 1.5.1
- Updated for Paper 26.3 stable build 244
- Updated internal dependencies for improved compatibility and maintenance
- Continues to support Paper 26.2 and newer
Features
- Automatically updates the Discord leaderboard when a player dies
- Uses a single Discord message instead of creating message spam
- Supports ALL players or a configurable TOP leaderboard
- Includes offline and previously seen players
- Optionally shows players with zero deaths
- Automatically restores the leaderboard if the Discord message is deleted
- Handles rapid deaths without sending unnecessary Discord requests
- Protects against Discord's message-length limit
- Supports live configuration reloads with
/d2d reload
- No Discord bot required
How It Works
DeathsToDiscord reads a Minecraft scoreboard objective that tracks player deaths.
When the plugin starts, it connects to your configured Discord webhook and creates or restores the leaderboard message. Whenever a player dies, the leaderboard is rebuilt and the existing Discord message is updated automatically.
The plugin remembers the Discord message between server restarts, so it does not create a new leaderboard every time the server starts.
Requirements
- Paper 26.2 or newer
- Java 25
- A Discord webhook
- A Minecraft scoreboard objective that tracks deaths
Simple Setup
- Install DeathsToDiscord in your server's
plugins folder.
- Start the server to generate the configuration.
- Add your Discord webhook URL.
- Set the scoreboard objective you want to use.
- Restart the server or run
/d2d reload.
That's it — the leaderboard will stay synchronized automatically.
Commands
/d2d reload
Reloads the configuration and refreshes the Discord leaderboard.
Permission: d2d.admin
Good For
DeathsToDiscord works well for SMPs, private servers, community servers, and anywhere you want a simple way to display your server's death rankings in Discord without running a separate bot.
Discord Webhook Setup
- Open the Discord server and choose the channel where the leaderboard should appear.
- Open Server Settings → Integrations → Webhooks.
- Create a new webhook and select the desired channel.
- Copy the webhook URL.
- Paste it into
webhook-url in the DeathsToDiscord configuration.
Treat the webhook URL like a password. Anyone with the URL can use that webhook to post to its Discord channel.
Minecraft Scoreboard Setup
DeathsToDiscord reads an existing scoreboard objective. It does not create or increment the death objective itself.
To create a standard death counter named deaths, run:
/scoreboard objectives add deaths deathCount "Deaths"
To see the objectives already available on your server, run:
/scoreboard objectives list
If your death objective uses a different name, set that name under objective-name in config.yml.
Configuration
Configuration file:
plugins/DeathsToDiscord/config.yml
Default configuration:
webhook-url: "PASTE_WEBHOOK_URL_HERE"
# Your scoreboard objective name from /scoreboard objectives list
objective-name: "deaths"
# "ALL" = list everyone
# "TOP" = list top N only
mode: "ALL"
top: 10
# If true, players with 0 deaths are included in the leaderboard
show-zero-deaths: true
# The plugin will create the first message and fill this automatically
message-id: ""
# Small delay to batch rapid deaths & avoid rate limits
update-delay-seconds: 2
# Discord message content can be up to 2000 characters.
# This leaves a small safety buffer and trims very large leaderboards instead of failing.
max-discord-content-characters: 1900
webhook-url
The Discord webhook URL used to create and update the leaderboard message.
webhook-url: "PASTE_WEBHOOK_URL_HERE"
objective-name
The Minecraft scoreboard objective DeathsToDiscord reads for each player's death count.
objective-name: "deaths"
Use /scoreboard objectives list to verify the correct objective name.
mode
Controls how many tracked players are displayed.
mode: "ALL"
Available values:
ALL — displays all tracked players that fit in the Discord message
TOP — displays only the highest-ranked players, limited by the top setting
Players are sorted from the highest death count to the lowest. Ties are sorted alphabetically.
top
Sets the number of players shown when mode is set to TOP.
top: 10
The minimum effective value is 1.
show-zero-deaths
Controls whether players with zero deaths are included.
show-zero-deaths: true
true — include players with zero deaths
false — hide players with zero deaths
message-id
Stores the ID of the Discord leaderboard message.
message-id: ""
Leave this blank during the initial setup. DeathsToDiscord creates the first message automatically and saves its ID here.
Normally, this value should not be edited manually. If the leaderboard message is deleted from Discord, clear the value, save the config, and run /d2d reload so the plugin can create a replacement message.
You should also clear it if you move the plugin to a different webhook or Discord channel and the existing message can no longer be edited through that webhook.
update-delay-seconds
Adds a short delay before updating Discord after a death.
update-delay-seconds: 2
This helps combine rapid deaths into one update and reduces unnecessary webhook requests. A value of 0 disables the delay.
max-discord-content-characters
Sets the maximum size DeathsToDiscord will use for the leaderboard message.
max-discord-content-characters: 1900
Discord allows a maximum of 2,000 characters for normal message content. DeathsToDiscord defaults to 1900 to leave a safety buffer. Configured values are limited to a minimum of 500 and a maximum of 2000.
If the leaderboard is too large, the plugin keeps as many ranked players as will fit and adds a line showing how many additional players were omitted.
Commands
/d2d reload
Reloads config.yml and immediately updates the Discord leaderboard message.
Permission:
d2d.admin
The permission defaults to server operators.
How the Leaderboard Works
When DeathsToDiscord starts with a valid webhook configured, it immediately synchronizes the leaderboard.
If message-id is blank, the plugin creates a new Discord message and automatically saves its ID to config.yml. Future updates edit that same message.
Whenever a player dies, DeathsToDiscord waits for the configured update-delay-seconds value and then rebuilds the leaderboard from the configured scoreboard objective. Rapid deaths during the delay are combined into the same update.
A Discord leaderboard resembles:
? Death Leaderboard (Everyone)
1. PlayerOne — 12
2. PlayerTwo — 7
3. PlayerThree — 2
Tracked players: 3
Updated: ...
Troubleshooting
The plugin says the webhook URL is not set
Open plugins/DeathsToDiscord/config.yml, replace PASTE_WEBHOOK_URL_HERE with a valid Discord webhook URL, save the file, and run /d2d reload.
The objective cannot be found
Run:
/scoreboard objectives list
Then make sure objective-name exactly matches the death objective on the server.
The Discord leaderboard message was deleted
Set:
message-id: ""
Save the config and run:
/d2d reload
DeathsToDiscord will create a new leaderboard message and save the new message ID automatically.
The webhook or Discord channel was changed
If the old message-id belongs to a message that the new webhook cannot edit, clear message-id and run /d2d reload to create a new message through the new webhook.
Some players are not displayed
Check the following:
- The player has been tracked by the server.
- The configured scoreboard objective contains the expected score.
show-zero-deaths is enabled if the player has zero deaths.
mode is not set to TOP with a limit that excludes the player.
- The leaderboard has not reached the configured Discord content limit.
The leaderboard says some players were omitted
The full leaderboard is larger than the configured Discord message limit. Increase max-discord-content-characters up to 2000, use TOP mode, or reduce the number of players displayed.
Support and Bug Reports
If you find a bug or have a feature request, open an issue on the GitHub Issues page.
License
DeathsToDiscord is released under the MIT License.
评论 0
登录后参与评分
还没有评论,来抢沙发吧