死亡消息
为 Minecraft 服务器提供自定义的死亡、加入、离开和击杀消息 —— 支持 Fabric 和 NeoForge。
Death Messages 是一款面向 Fabric 和 NeoForge 的服务端 Minecraft 模组。它允许你替换任何生物或伤害类型的原版死亡消息,并在玩家加入、离开、击杀怪物或击杀其他玩家时添加你自己的消息或命令。无需安装客户端模组。
功能
- 每个生物的自定义死亡消息 —— 你的 Minecraft 版本中注册的每种实体类型都有对应的条目,模组添加的实体类型也可以通过其注册 ID 正常工作。
- 每种伤害类型的自定义消息 —— 坠落、熔岩、溺水、仙人掌、冻结、魔法、爆炸等。
- 加入、离开、击杀怪物和击杀玩家的动作 —— 每条都可以是聊天消息或命令。
- 回退至原版 —— 将条目留空即可使用正常的死亡消息。
- 颜色与格式 —— 使用
& 或 § 代码,就像其他服务器模组一样。
- Fabric 和 NeoForge —— 两个加载器共用相同的配置文件和命令。
- 仅服务端 —— 无需客户端模组,无需资源包。
安装
- 在你的 Minecraft 服务器上安装 Fabric Loader 或 NeoForge。
- 从 Modrinth 或 GitHub Releases 下载对应你 Minecraft 版本的 jar 文件。
- 将 jar 文件放入服务器的
mods/ 文件夹中。
- 在 Fabric 上,还需安装 Fabric API。
- 启动服务器。配置文件将在
config/death-messages.json 处生成。
- 编辑配置文件并运行
/deathmessages reload,或者重启服务器。
这是一个服务端模组。玩家不需要安装任何东西。
支持的版本
| 加载器 |
Minecraft 版本 |
| Fabric |
1.21.1, 1.21.11, 26.1–26.1.2, 26.2–26.3 |
| NeoForge |
1.21.1, 1.21.11, 26.1.2, 26.2–26.3 |
请使用与你 Minecraft 版本匹配的 jar 文件。26.2–26.3 的 jar 基于 26.3 构建并声明了一个范围;26.1 的 jar 基于 26.1.2 构建。NeoForge 发布的是 26.1.2,而不是 26.1 或 26.1.1。
这些版本覆盖了大约 80% 的公共 Minecraft 服务器。旧版本未包含在首次发布中。
配置
配置文件为 config/death-messages.json。首次启动时,它会根据你 Minecraft 版本的注册表生成,因此每种实体类型和每种原版伤害类型都已存在:
{
"configVersion": 1,
"enabled": true,
"death": {
"broadcast_to_everyone": true,
"default_no_entity": "",
"default_yes_entity": "",
"no_entity": {
"minecraft:cactus": "${player} was pricked to death",
"minecraft:drown": "${player} drowned",
"minecraft:fall": "",
"minecraft:lava": "${player} tried to swim in lava"
},
"yes_entity": {
"minecraft:bee": "${player} was stung to death",
"minecraft:creeper": "${player} was blown up by a creeper",
"minecraft:player": "",
"minecraft:zombie": ""
}
},
"join": {
"actions": ["Welcome ${player}!"],
"broadcast_to_everyone": true
},
"leave": {
"actions": ["Goodbye ${player}!"],
"broadcast_to_everyone": true
},
"kill_entity": {
"actions": ["${player} killed ${killedEntity}"],
"broadcast_to_everyone": true
},
"kill_player": {
"actions": ["${player} killed ${killedPlayer}"],
"broadcast_to_everyone": true
}
}
实际生成的文件会更长,因为它列出了所有实体类型,包括动物、怪物、Boss、投射物和载具。你只需要编辑你关心的条目。
| 键 |
描述 |
enabled |
开启或关闭整个模组。 |
death.broadcast_to_everyone |
true 向所有人显示自定义死亡消息;false 仅向死亡的玩家显示。原版死亡消息保持其正常的队伍可见性。 |
death.default_no_entity |
当没有直接伤害玩家的实体且没有匹配的伤害类型条目时的回退消息。留空表示使用原版。 |
death.default_yes_entity |
当由生物或投射物导致死亡且没有匹配的实体条目时的回退消息。留空表示使用原版。 |
death.no_entity |
按伤害类型 ID 索引的消息,用于没有攻击者的情况。 |
death.yes_entity |
按实体类型 ID 索引的消息,用于由生物或投射物导致死亡的情况。 |
*.actions |
一个或多个聊天消息或命令。 |
*.broadcast_to_everyone |
true 发送给整个服务器;false 仅发送给触发该动作的玩家。 |
空消息("")意味着使用原版死亡消息。删除条目或将其留空以保留该生物或伤害类型的正常消息。
生物和伤害类型键
yes_entity 的键是实体类型 ID:
"minecraft:zombie": "${player} was eaten by a zombie",
"minecraft:warden": "${player} was slain by a warden",
"minecraft:ender_dragon": "${player} was slain by the Ender Dragon"
no_entity 的键是伤害类型 ID:
"minecraft:fall": "${player} fell from a high place",
"minecraft:freeze": "${player} froze to death",
"minecraft:sweet_berry_bush": "${player} was poked to death by a sweet berry bush"
由于消息是按注册表 ID 查找的,任何生物都适用,包括你的生成文件中不存在的模组生物。使用该模组或数据包使用的相同 namespace:path ID。
占位符
| 占位符 |
死亡消息 |
加入 / 离开 |
击杀生物 |
击杀玩家 |
${player} |
已死亡玩家 |
玩家 |
击杀者 |
击杀者 |
${killedEntity} |
攻击者名称 |
— |
被杀生物名称 |
被杀玩家名称 |
${killedPlayer} |
— |
— |
— |
被杀玩家 |
${damageType} |
伤害类型 ID |
— |
伤害类型 ID |
伤害类型 ID |
占位符是纯文本,因此它们既可以在命令中使用,也可以在聊天消息中使用。
动作
join、leave、kill_entity 和 kill_player 各自包含一个动作列表。一个动作可以是:
- 一条聊天消息 —— 任何不以
/ 开头的内容。它作为系统消息发送。
- 一条命令 —— 任何以
/ 开头的内容。它从服务器控制台运行,因此你不需要是操作员,也不会检查任何玩家权限。
示例:
"join": {
"actions": [
"&e欢迎 ${player}!",
"/give ${player} minecraft:bread 4"
],
"broadcast_to_everyone": true
}
"kill_player": {
"actions": [
"&c${player} &7击杀了 &c${killedPlayer}",
"&7${killedPlayer} 将很快重生。"
],
"broadcast_to_everyone": true
}
要禁用某个动作组,请将 "actions" 设置为 []。
格式化
在代码前使用 & 或 §。例如,&cRed text 和 §cRed text 是相同的。
0 黑色 8 深灰色
1 深蓝色 9 蓝色
2 深绿色 a 绿色
3 深青色 b 青色
4 深红色 c 红色
5 深紫色 d 浅紫色
6 金色 e 黄色
7 灰色 f 白色
k 混淆 l 粗体 m 删除线
n 下划线 o 斜体 r 重置
命令
| 命令 |
适用对象 |
描述 |
/deathmessages reload |
操作员 |
重新加载 config/death-messages.json。 |
/deathmessages status |
操作员 |
显示模组是否启用以及加载了多少个键。 |
工作原理
Death Messages 钩入了原版死亡消息的查找机制,因此它可以与每种伤害来源和每种生物配合工作,无需特殊处理。当存在配置的消息时,它会替换原版的消息;否则,原版的消息保持不变。加入、离开和击杀动作使用标准的服务器事件。
由于配置文件是从注册表生成的,因此当前版本中存在的每种实体类型都有一个条目。Minecraft 更新添加的新生物在服务器运行时即得到支持,即使它们的键不在旧配置文件中。
常见问题
玩家需要安装该模组吗?
不需要。它是仅服务端模组。在 Fabric 上,服务器需要 Fabric API。
为什么死亡消息仍然是原版的?
匹配的条目为空或缺失。为生物填写 yes_entity,为伤害类型填写 no_entity。空值表示“使用原版”。
为什么我会看到死亡消息和击杀消息?
它们是独立的功能。death 替换正常的死亡消息;kill_entity 和 kill_player 添加自己的公告。如果你只想要其中一个,请将它们的 actions 设置为 []。
模组生物能用吗?
可以。在 yes_entity 中使用生物的注册 ID,例如 mymod:my_monster。
我可以使用命令而不是聊天消息吗?
可以。任何以 / 开头的动作都会从服务器控制台运行。
它与队伍兼容吗?
原版死亡消息保持其正常的队伍可见性。自定义死亡消息遵循 death.broadcast_to_everyone:当为 true 时对所有人广播,当为 false 时仅对已死亡玩家显示。
编辑配置后必须重启吗?
不需要,操作员可以运行 /deathmessages reload。重启也可以。
链接
许可证
MIT。详见 LICENSE。
Death Messages
Custom death, join, leave, and kill messages for Minecraft servers — on Fabric and NeoForge.
Death Messages is a server-side Minecraft mod for Fabric and NeoForge. It lets you replace
the vanilla death message for any creature or damage type, and add your own messages or commands
when players join, leave, kill a mob, or kill another player. No client mod is required.
Features
- Custom death messages for every creature — every entity type registered in your Minecraft
version has an entry, and modded entity types work by their registry id too.
- Custom messages for every damage type — falling, lava, drowning, cactus, freezing, magic,
explosions, and the rest.
- Join, leave, kill-mob, and kill-player actions — each can be a chat message or a command.
- Vanilla fallback — leave an entry empty and the normal death message is used.
- Colors and formatting — use
& or § codes, just like other server mods.
- Fabric and NeoForge — the same config file and commands on both loaders.
- Server-side only — no client mod, no resource pack.
Installation
- Install Fabric Loader or NeoForge on your Minecraft server.
- Download the jar for your Minecraft version from Modrinth
or GitHub Releases.
- Put the jar in your server's
mods/ folder.
- On Fabric, also install Fabric API.
- Start the server. The config is created at
config/death-messages.json.
- Edit the config and run
/deathmessages reload, or restart the server.
This is a server-side mod. Players do not need to install anything.
Supported versions
| Loader |
Minecraft versions |
| Fabric |
1.21.1, 1.21.11, 26.1–26.1.2, 26.2–26.3 |
| NeoForge |
1.21.1, 1.21.11, 26.1.2, 26.2–26.3 |
Use the jar that matches your Minecraft version. The 26.2–26.3 jars are built from 26.3 and
declare a range; the 26.1 jars are built from 26.1.2. NeoForge publishes 26.1.2, not 26.1 or
26.1.1.
These versions cover roughly 80% of public Minecraft servers. Older versions are not included in
the first release.
Configuration
The config file is config/death-messages.json. On first start it is generated from the
registries of your Minecraft version, so every entity type and every vanilla damage type is
already present:
{
"configVersion": 1,
"enabled": true,
"death": {
"broadcast_to_everyone": true,
"default_no_entity": "",
"default_yes_entity": "",
"no_entity": {
"minecraft:cactus": "${player} was pricked to death",
"minecraft:drown": "${player} drowned",
"minecraft:fall": "",
"minecraft:lava": "${player} tried to swim in lava"
},
"yes_entity": {
"minecraft:bee": "${player} was stung to death",
"minecraft:creeper": "${player} was blown up by a creeper",
"minecraft:player": "",
"minecraft:zombie": ""
}
},
"join": {
"actions": ["Welcome ${player}!"],
"broadcast_to_everyone": true
},
"leave": {
"actions": ["Goodbye ${player}!"],
"broadcast_to_everyone": true
},
"kill_entity": {
"actions": ["${player} killed ${killedEntity}"],
"broadcast_to_everyone": true
},
"kill_player": {
"actions": ["${player} killed ${killedPlayer}"],
"broadcast_to_everyone": true
}
}
The real generated file is longer because it lists every entity type, including animals, monsters,
bosses, projectiles, and vehicles. You only need to edit the entries you care about.
| Key |
Description |
enabled |
Turns the whole mod on or off. |
death.broadcast_to_everyone |
true shows custom death messages to everyone; false shows them only to the dead player. Vanilla death messages keep their normal team visibility. |
death.default_no_entity |
Fallback message when nothing damaged the player directly and no damage-type entry matched. Empty means vanilla. |
death.default_yes_entity |
Fallback message when a creature or projectile caused the death and no entity entry matched. Empty means vanilla. |
death.no_entity |
Messages keyed by damage type id, used when there is no attacker. |
death.yes_entity |
Messages keyed by entity type id, used when a creature or projectile caused the death. |
*.actions |
One or more chat messages or commands. |
*.broadcast_to_everyone |
true sends to the whole server; false sends only to the player who triggered the action. |
An empty message ("") means use the vanilla death message. Delete an entry or leave it empty
to keep the normal message for that creature or damage type.
Creature and damage type keys
yes_entity keys are entity type ids:
"minecraft:zombie": "${player} was eaten by a zombie",
"minecraft:warden": "${player} was slain by a warden",
"minecraft:ender_dragon": "${player} was slain by the Ender Dragon"
no_entity keys are damage type ids:
"minecraft:fall": "${player} fell from a high place",
"minecraft:freeze": "${player} froze to death",
"minecraft:sweet_berry_bush": "${player} was poked to death by a sweet berry bush"
Because messages are looked up by registry id, any creature works, including modded mobs that
are not in your generated file. Use the same namespace:path id that the mod or data pack uses.
Placeholders
| Placeholder |
Death messages |
Join / leave |
Kill mob |
Kill player |
${player} |
Dead player |
Player |
Killer |
Killer |
${killedEntity} |
Attacker name |
— |
Dead mob name |
Dead player name |
${killedPlayer} |
— |
— |
— |
Dead player |
${damageType} |
Damage type id |
— |
Damage type id |
Damage type id |
Placeholders are plain text, so they work in commands as well as chat messages.
Actions
join, leave, kill_entity, and kill_player each contain a list of actions. An action is
either:
- A chat message — anything that does not start with
/. It is sent as a system message.
- A command — anything that starts with
/. It runs from the server console, so you do not
need to be an operator and no player permission is checked.
Examples:
"join": {
"actions": [
"&eWelcome ${player}!",
"/give ${player} minecraft:bread 4"
],
"broadcast_to_everyone": true
}
"kill_player": {
"actions": [
"&c${player} &7killed &c${killedPlayer}",
"&7${killedPlayer} will respawn shortly."
],
"broadcast_to_everyone": true
}
To disable an action group, set "actions": [].
Formatting
Use & or § before a code. For example, &cRed text and §cRed text are the same.
0 black 8 dark gray
1 dark blue 9 blue
2 dark green a green
3 dark aqua b aqua
4 dark red c red
5 dark purple d light purple
6 gold e yellow
7 gray f white
k obfuscated l bold m strikethrough
n underline o italic r reset
Commands
| Command |
Who |
Description |
/deathmessages reload |
Operators |
Reloads config/death-messages.json. |
/deathmessages status |
Operators |
Shows whether the mod is enabled and how many keys are loaded. |
How it works
Death Messages hooks the vanilla death-message lookup, so it works with every damage source and
every mob without special cases. When a configured message exists it replaces the vanilla message;
otherwise the vanilla message is left untouched. Join, leave, and kill actions use the standard
server events.
Because the config is generated from the registry, an entry exists for every entity type in the
running version. New mobs added by Minecraft updates are supported as soon as the server runs,
even if their key is not in an older config file.
FAQ
Do players need the mod installed?
No. It is server-side only. On Fabric the server needs Fabric API.
Why is a death message still the vanilla one?
The matching entry is empty or missing. Fill in yes_entity for a mob or no_entity for a damage
type. Empty means "use vanilla".
Why do I see a death message and a kill message?
They are separate features. death replaces the normal death message; kill_entity and
kill_player add their own announcements. Set their actions to [] if you only want one.
Do modded mobs work?
Yes. Use the mob's registry id, for example mymod:my_monster, in yes_entity.
Can I use commands instead of chat messages?
Yes. Any action that starts with / runs from the server console.
Does it work with teams?
Vanilla death messages keep their normal team visibility. A custom death message follows
death.broadcast_to_everyone: everyone when true, only the dead player when false.
Do I have to restart after editing the config?
No, operators can run /deathmessages reload. A restart also works.
Links
License
MIT. See LICENSE.
评论 0
登录后参与评分
还没有评论,来抢沙发吧