From ca19ff79600b081e3291c29cd74bf3afa2e45c12 Mon Sep 17 00:00:00 2001
From: wed150 <110138748+wed150@users.noreply.github.com>
Date: Sun, 21 Jun 2026 20:29:14 +0800
Subject: [PATCH 1/2] chore:Enhance README with death messages translation info
Added section on death messages translation and customization options.
---
README.md | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/README.md b/README.md
index f94893b..914e929 100644
--- a/README.md
+++ b/README.md
@@ -17,6 +17,24 @@ Better Death Messages on MCBE
Loading *ModAPI* enables client-side translation.
That allows players to freely switch languages on their own.
+## Death Messages Translation
+
+By default, this plugin uses resource packs for translation to ensure perfect compatibility with various addons.
`This requires ModAPI to be enabled.`
+
(The plugin automatically builds the resource pack and sends it to players upon joining. Using resource pack-based translation is recommended.)
+
+If you prefer not to use resource packs, you can enable server-side translation in the configuration file.
This way, all translations are handled entirely on the server without requiring any client-side resource packs.
+
+#### For issues, please report them via GitHub Issues!!!
+#### Pull Requests are also welcome!
+
+You can also customize death messages by editing the language files.
+(The resource pack will be generated in the ./plugins/DeathMessages/log directory; feel free to modify it as needed.)
+
`This requires ModAPI to be enabled.`
+
+High performance: Implemented using native functions with no additional data storage, resulting in minimal performance overhead.
+Uses native death message broadcasting, preserving the vanilla showdeathmessages game rule behavior.
+Currently restores approximately 95% of Java Edition death messages.
+
# 开源许可
## 源代码可用性
- 您可以自由地获取、使用和修改本插件的源代码,无论是个人使用还是商业目的。
From dc41e33a6049e9dfd8b8c5f96b3e335716eea045 Mon Sep 17 00:00:00 2001
From: wed150
Date: Mon, 22 Jun 2026 01:50:42 +0800
Subject: [PATCH 2/2] fix: fix missing message
---
src/DeathMessage.cpp | 6 +-
src/Language.h | 292 ++-----------------------------------------
2 files changed, 15 insertions(+), 283 deletions(-)
diff --git a/src/DeathMessage.cpp b/src/DeathMessage.cpp
index 7791ca9..f16ec67 100644
--- a/src/DeathMessage.cpp
+++ b/src/DeathMessage.cpp
@@ -34,12 +34,10 @@ Actor* getDamagingEntity(ActorDamageSource* ads) {
std::string getResourcePackKey(std::string const& name, Actor* ac) {
if (ac->hasCategory(ActorCategory::Player)){return name;}
- auto type = ac->getTypeName();
- ll::utils::string_utils::replaceAll(type, "minecraft:", "");
- std::string res = "%entity." + type + ".name";
+ auto type = ac->getEntityLocNameString();
+ std::string res = "%" + type;
return res;
}
-
// 构造死亡信息输出
DeathMessageResult makeDeathMessage(
int cause,
diff --git a/src/Language.h b/src/Language.h
index 4c1bbeb..c09aa78 100644
--- a/src/Language.h
+++ b/src/Language.h
@@ -6,8 +6,10 @@ death.attack.anvil=%1$s was squashed by a falling anvil
death.attack.anvil.player=%1$s was squashed by a falling anvil during a fight with %2$s
death.attack.anvil.item=%1$s was squashed by a falling anvil while fighting %2$s holding %3$s
death.attack.arrow=%1$s was shot by %2$s
+death.attack.arrow.player=%1$s was shot by %2$s
death.attack.arrow.item=%1$s was shot by %2$s using %3$s
death.attack.bullet=%1$s was sniped by %2$s
+death.attack.bullet.player=%1$s was sniped by %2$s
death.attack.cactus=%1$s was pricked to death
death.attack.cactus.player=%1$s collided with a cactus while trying to escape %2$s
death.attack.cactus.item=%1$s collided with a cactus while trying to escape %2$s holding %3$s
@@ -25,6 +27,7 @@ death.attack.fallingBlock=%1$s was squashed by a falling block
death.attack.fallingBlock.player=%1$s was squashed by a falling block during a fight with %2$s
death.attack.fallingBlock.item=%1$s was squashed by a falling block while fighting %2$s holding %3$s
death.attack.fireball=%1$s was incinerated by %2$s fireball
+death.attack.fireball.player=%1$s was incinerated by %2$s fireball
death.attack.fireball.item=%1$s was incinerated by %2$s fireball launched using %3$s
death.attack.fireworks=%1$s vanished with a bang
death.attack.fireworks.player=%1$s vanished with a bang while fighting %2$s
@@ -56,6 +59,7 @@ death.attack.hotFloor.item=%1$s stepped into danger due to %2$s holding %3$s
death.attack.mob=%1$s was killed by %2$s
death.attack.mob.item=%1$s was killed by %2$s using %3$s
death.attack.sting=%1$s was stung to death by %2$s
+death.attack.sting.player=%1$s was stung to death by %2$s
death.attack.sting.item=%1$s was stung to death by %2$s using %3$s
death.attack.onFire=%1$s was burned to death
death.attack.onFire.player=%1$s was crispy fried while fighting %2$s
@@ -79,6 +83,7 @@ death.attack.thrown=%1$s was pummeled by %2$s
death.attack.thrown.player=%1$s was pummeled by %2$s
death.attack.thrown.item=%1$s was pummeled by %2$s using %3$s
death.attack.trident=%1$s was impaled by %2$s
+death.attack.trident.player=%1$s was impaled by %2$s
death.attack.trident.item=%1$s was impaled by %2$s using %3$s
death.attack.wither=%1$s withered away
death.attack.wither.player=%1$s withered away while fighting %2$s
@@ -96,6 +101,7 @@ death.attack.stalagmite=%1$s was impaled by a stalagmite
death.attack.stalagmite.player=%1$s was impaled by a stalagmite while battling %2$s
death.attack.stalagmite.item=%1$s was impaled by a stalagmite while battling %2$s holding %3$s
death.attack.witherSkull=%1$s was shot and killed by a wither skull launched by %2$s
+death.attack.witherSkull.player=%1$s was shot and killed by a wither skull launched by %2$s
death.attack.witherSkull.item=%1$s was shot and killed by a wither skull launched by %2$s using %3$s
death.attack.even_more_magic=%1$s was killed by unknown magic
death.attack.genericKill=%1$s was slain
@@ -114,145 +120,6 @@ death.fell.finish=%1$s fell too far and was finished by %2$s
death.fell.finish.player=%1$s fell too far and was finished by %2$s
death.fell.finish.item=%1$s fell too far and was finished by %2$s using %3$s
death.fell.killer=%1$s was doomed to fall
-entity.area_effect_cloud.name=Area Effect Cloud
-entity.armor_stand.name=Armor Stand
-entity.arrow.name=Arrow
-entity.bat.name=Bat
-entity.bee.name=Bee
-entity.blaze.name=Blaze
-entity.boat.name=Boat
-entity.cat.name=Cat
-entity.cave_spider.name=Cave Spider
-entity.chicken.name=Chicken
-entity.cow.name=Cow
-entity.creeper.name=Creeper
-entity.dolphin.name=Dolphin
-entity.goat.name=Goat
-entity.panda.name=Panda
-entity.donkey.name=Donkey
-entity.dragon_fireball.name=Dragon Fireball
-entity.drowned.name=Drowned
-entity.egg.name=Egg
-entity.elder_guardian.name=Elder Guardian
-entity.ender_crystal.name=Ender Crystal
-entity.ender_dragon.name=Ender Dragon
-entity.enderman.name=Enderman
-entity.endermite.name=Endermite
-entity.ender_pearl.name=Ender Pearl
-entity.evocation_illager.name=Evoker
-entity.evocation_fang.name=Evoker Fang
-entity.eye_of_ender_signal.name=Eye of Ender
-entity.falling_block.name=Falling Block
-entity.fireball.name=Fireball
-entity.fireworks_rocket.name=Firework Rocket
-entity.fishing_hook.name=Fishing Hook
-entity.fish.clownfish.name=Clownfish
-entity.fox.name=Fox
-entity.cod.name=Cod
-entity.pufferfish.name=Pufferfish
-entity.salmon.name=Salmon
-entity.tropicalfish.name=Tropical Fish
-entity.axolotl.name=Axolotl
-entity.ghast.name=Ghast
-entity.glow_squid.name=Glow Squid
-entity.piglin_brute.name=Piglin Brute
-entity.guardian.name=Guardian
-entity.hoglin.name=Hoglin
-entity.horse.name=Horse
-entity.husk.name=Husk
-entity.ravager.name=Ravager
-entity.iron_golem.name=Iron Golem
-entity.item.name=Item
-entity.leash_knot.name=Leash Knot
-entity.lightning_bolt.name=Lightning Bolt
-entity.lingering_potion.name=Lingering Potion
-entity.llama.name=Llama
-entity.trader_llama.name=Trader Llama
-entity.llama_spit.name=Llama Spit
-entity.magma_cube.name=Magma Cube
-entity.minecart.name=Minecart
-entity.chest_minecart.name=Minecart with Chest
-entity.command_block_minecart.name=Minecart with Command Block
-entity.furnace_minecart.name=Minecart with Furnace
-entity.hopper_minecart.name=Minecart with Hopper
-entity.tnt_minecart.name=Minecart with TNT
-entity.mule.name=Mule
-entity.mooshroom.name=Mooshroom
-entity.moving_block.name=Moving Block
-entity.ocelot.name=Ocelot
-entity.painting.name=Painting
-entity.parrot.name=Parrot
-entity.phantom.name=Phantom
-entity.pig.name=Pig
-entity.piglin.name=Piglin
-entity.pillager.name=Pillager
-entity.polar_bear.name=Polar Bear
-entity.rabbit.name=Rabbit
-entity.sheep.name=Sheep
-entity.shulker.name=Shulker
-entity.shulker_bullet.name=Shulker Bullet
-entity.silverfish.name=Silverfish
-entity.skeleton.name=Skeleton
-entity.skeleton_horse.name=Skeleton Horse
-entity.stray.name=Stray
-entity.slime.name=Slime
-entity.small_fireball.name=Small Fireball
-entity.sniffer.name=Sniffer
-entity.snowball.name=Snowball
-entity.snow_golem.name=Snow Golem
-entity.spider.name=Spider
-entity.splash_potion.name=Potion
-entity.squid.name=Squid
-entity.strider.name=Strider
-entity.tnt.name=Block of TNT
-entity.thrown_trident.name=Trident
-entity.tripod_camera.name=Tripod Camera
-entity.turtle.name=Turtle
-entity.unknown.name=Unknown
-entity.vex.name=Vex
-entity.villager.name=Villager
-entity.villager.armor=Armorer
-entity.villager.butcher=Butcher
-entity.villager.cartographer=Cartographer
-entity.villager.cleric=Cleric
-entity.villager.farmer=Farmer
-entity.villager.fisherman=Fisherman
-entity.villager.fletcher=Fletcher
-entity.villager.leather=Leatherworker
-entity.villager.librarian=Librarian
-entity.villager.shepherd=Shepherd
-entity.villager.tool=Tool Smith
-entity.villager.weapon=Weapon Smith
-entity.villager.mason=Stone Mason
-entity.villager.unskilled=Unskilled Villager
-entity.villager_v2.name=Villager
-entity.vindicator.name=Vindicator
-entity.wandering_trader.name=Wandering Trader
-entity.witch.name=Witch
-entity.wither.name=Wither
-entity.wither_skeleton.name=Wither Skeleton
-entity.wither_skull.name=Wither Skull
-entity.wither_skull_dangerous.name=Wither Skull
-entity.wolf.name=Wolf
-entity.xp_orb.name=Experience Orb
-entity.xp_bottle.name=Bottle o' Enchanting
-entity.zoglin.name=Zoglin
-entity.zombie.name=Zombie
-entity.zombie_horse.name=Zombie Horse
-entity.zombie_pigman.name=Zombified Piglin
-entity.zombie_villager.name=Zombie Villager
-entity.zombie_villager_v2.name=Zombie Villager
-entity.frog.name=Frog
-entity.tadpole.name=Tadpole
-entity.warden.name=Warden
-entity.allay.name=Allay
-entity.camel.name=Camel
-entity.chest_raft.name=Raft with Chest
-entity.bogged.name=Bogged
-entity.wind_charge_projectile.name=Wind Charge
-entity.breeze_wind_charge_projectile.name=Wind Charge
-entity.breeze.name=Breeze
-entity.creaking.name=Creaking
multiplayer.player.joined=%s joined the game
multiplayer.player.left=%s left the game
plugin.deathmessages.modapi.warn=The optional Dependency plugin ModAPI is not loaded, so client-side translation is unavailable. Only server-side translation can be used.
@@ -263,8 +130,10 @@ death.attack.anvil=%1$s 被坠落的铁砧压扁了
death.attack.anvil.player=%1$s 在与 %2$s 战斗时被坠落的铁砧压扁了
death.attack.anvil.item=%1$s 在与持有 %3$s 的 %2$s 战斗时被坠落的铁砧压扁了
death.attack.arrow=%1$s被 %2$s 射杀
+death.attack.arrow.player=%1$s被 %2$s 射杀
death.attack.arrow.item=%1$s 被 %2$s 用 %3$s 射杀
death.attack.bullet=%1$s被 %2$s 狙击了
+death.attack.bullet.player=%1$s被 %2$s 狙击了
death.attack.cactus=%1$s 被戳死了
death.attack.cactus.player=%1$s 在试图逃离 %2$s 时撞上了仙人掌
death.attack.cactus.item=%1$s 在试图逃离持有 %3$s 的 %2$s 时撞上了仙人掌
@@ -282,6 +151,7 @@ death.attack.fallingBlock=%1$s 被坠落的方块压扁了
death.attack.fallingBlock.player=%1$s 在与 %2$s 战斗时被坠落的方块压扁了
death.attack.fallingBlock.item=%1$s 在与持有 %3$s 的 %2$s 战斗时被坠落的方块压扁了
death.attack.fireball=%1$s被 %2$s 用火球烧死了
+death.attack.fireball.player=%1$s被 %2$s 用火球烧死了
death.attack.fireball.item=%1$s被 %2$s 用 %3$s 发射的火球烧死了
death.attack.fireworks=%1$s 随着一声巨响消失了
death.attack.fireworks.player=%1$s 在与 %2$s 战斗时随着一声巨响消失了
@@ -314,6 +184,7 @@ death.attack.mob=%1$s 被 %2$s 杀死了
death.attack.mob.player=%1$s 被 %2$s 杀死了
death.attack.mob.item=%1$s 被 %2$s 用 %3$s 杀死了
death.attack.sting=%1$s 被 %2$s 蛰死了
+death.attack.sting.player=%1$s 被 %2$s 蛰死了
death.attack.sting.item=%1$s 被 %2$s 用 %3$s 蛰死了
death.attack.onFire=%1$s 被烧死了
death.attack.onFire.player=%1$s 在与 %2$s 战斗时被烤的酥脆
@@ -337,6 +208,7 @@ death.attack.thrown=%1$s 被 %2$s 给砸死了
death.attack.thrown.player=%1$s 被 %2$s 给砸死了
death.attack.thrown.item=%1$s 被 %2$s 用 %3$s 给砸死了
death.attack.trident=%1$s 被 %2$s 刺穿了
+death.attack.trident.player=%1$s 被 %2$s 刺穿了
death.attack.trident.item=%1$s 被 %2$s 使用 %3$s 刺穿了
death.attack.wither=%1$s 凋零了
death.attack.wither.player=%1$s 在与 %2$s 战斗时凋零了
@@ -354,6 +226,7 @@ death.attack.stalagmite=%1$s 被石笋刺穿了
death.attack.stalagmite.player=%1$s 在与 %2$s 战斗时被石笋刺穿了
death.attack.stalagmite.item=%1$s 在与持有 %3$s 的 %2$s 战斗时被石笋刺穿了
death.attack.witherSkull=%1$s 被 %2$s 发射的头颅射杀
+death.attack.witherSkull.player=%1$s 被 %2$s 发射的头颅射杀
death.attack.witherSkull.item=%1$s 被 %2$s 用 %3$s 发射的头颅射杀
death.attack.even_more_magic=%1$s 被不为人知的魔法杀死了
death.attack.genericKill=%1$s 被杀死了
@@ -373,146 +246,7 @@ death.fell.finish.player=%1$s 摔伤得太重并被 %2$s 完结了生命
death.fell.finish.item=%1$s 摔伤得太重并被 %2$s 用 %3$s 完结了生命
death.fell.killer=%1$s 注定要摔死
-entity.area_effect_cloud.name=区域效果云
-entity.armor_stand.name=盔甲架
-entity.arrow.name=箭
-entity.bat.name=蝙蝠
-entity.bee.name=蜜蜂
-entity.blaze.name=烈焰人
-entity.boat.name=船
-entity.cat.name=猫
-entity.cave_spider.name=洞穴蜘蛛
-entity.chicken.name=鸡
-entity.cow.name=牛
-entity.creeper.name=苦力怕
-entity.dolphin.name=海豚
-entity.goat.name=山羊
-entity.panda.name=熊猫
-entity.donkey.name=驴
-entity.dragon_fireball.name=末影龙火球
-entity.drowned.name=溺尸
-entity.egg.name=鸡蛋
-entity.elder_guardian.name=远古守卫者
-entity.ender_crystal.name=末地水晶
-entity.ender_dragon.name=末影龙
-entity.enderman.name=末影人
-entity.endermite.name=末影螨
-entity.ender_pearl.name=末影珍珠
-entity.evocation_illager.name=唤魔者
-entity.evocation_fang.name=唤魔者尖牙
-entity.eye_of_ender_signal.name=末影之眼
-entity.falling_block.name=下落的方块
-entity.fireball.name=火球
-entity.fireworks_rocket.name=烟花火箭
-entity.fishing_hook.name=鱼钩
-entity.fish.clownfish.name=小丑鱼
-entity.fox.name=狐狸
-entity.cod.name=鳕鱼
-entity.pufferfish.name=河豚
-entity.salmon.name=鲑鱼
-entity.tropicalfish.name=热带鱼
-entity.axolotl.name=美西螈
-entity.ghast.name=恶魂
-entity.glow_squid.name=发光鱿鱼
-entity.piglin_brute.name=猪灵蛮兵
-entity.guardian.name=守卫者
-entity.hoglin.name=疣猪兽
-entity.horse.name=马
-entity.husk.name=尸壳
-entity.ravager.name=劫掠兽
-entity.iron_golem.name=铁傀儡
-entity.item.name=物品
-entity.leash_knot.name=拴绳结
-entity.lightning_bolt.name=闪电束
-entity.lingering_potion.name=滞留药水
-entity.llama.name=羊驼
-entity.trader_llama.name=行商羊驼
-entity.llama_spit.name=羊驼唾沫
-entity.magma_cube.name=岩浆怪
-entity.minecart.name=矿车
-entity.chest_minecart.name=运输矿车
-entity.command_block_minecart.name=命令方块矿车
-entity.furnace_minecart.name=动力矿车
-entity.hopper_minecart.name=漏斗矿车
-entity.tnt_minecart.name=TNT矿车
-entity.mule.name=骡
-entity.mooshroom.name=哞菇
-entity.moving_block.name=移动中的方块
-entity.ocelot.name=豹猫
-entity.painting.name=画
-entity.parrot.name=鹦鹉
-entity.phantom.name=幻翼
-entity.pig.name=猪
-entity.piglin.name=猪灵
-entity.pillager.name=掠夺者
-entity.polar_bear.name=北极熊
-entity.rabbit.name=兔子
-entity.sheep.name=绵羊
-entity.shulker.name=潜影贝
-entity.shulker_bullet.name=潜影弹
-entity.silverfish.name=蠹虫
-entity.skeleton.name=骷髅
-entity.skeleton_horse.name=骷髅马
-entity.stray.name=流浪者
-entity.slime.name=史莱姆
-entity.small_fireball.name=小火球
-entity.sniffer.name=嗅探兽
-entity.snowball.name=雪球
-entity.snow_golem.name=雪傀儡
-entity.spider.name=蜘蛛
-entity.splash_potion.name=药水
-entity.squid.name=鱿鱼
-entity.strider.name=炽足兽
-entity.tnt.name=TNT
-entity.thrown_trident.name=三叉戟
-entity.tripod_camera.name=相机
-entity.turtle.name=海龟
-entity.unknown.name=未知
-entity.vex.name=恼鬼
-entity.villager.name=村民
-entity.villager.armor=盔甲匠
-entity.villager.butcher=屠夫
-entity.villager.cartographer=制图师
-entity.villager.cleric=牧师
-entity.villager.farmer=农民
-entity.villager.fisherman=渔夫
-entity.villager.fletcher=制箭师
-entity.villager.leather=皮匠
-entity.villager.librarian=图书管理员
-entity.villager.shepherd=牧羊人
-entity.villager.tool=工具匠
-entity.villager.weapon=武器匠
-entity.villager.mason=石匠
-entity.villager.unskilled=傻子
-entity.villager_v2.name=村民
-entity.vindicator.name=卫道士
-entity.wandering_trader.name=流浪商人
-entity.witch.name=女巫
-entity.wither.name=凋灵
-entity.wither_skeleton.name=凋灵骷髅
-entity.wither_skull.name=凋灵之首
-entity.wither_skull_dangerous.name=凋灵之首
-entity.wolf.name=狼
-entity.xp_orb.name=经验球
-entity.xp_bottle.name=附魔之瓶
-entity.zoglin.name=僵尸疣猪兽
-entity.zombie.name=僵尸
-entity.zombie_horse.name=僵尸马
-entity.zombie_pigman.name=僵尸猪灵
-entity.zombie_villager.name=僵尸村民
-entity.zombie_villager_v2.name=僵尸村民
-entity.sniffer.name=嗅探兽
-entity.frog.name=青蛙
-entity.tadpole.name=蝌蚪
-entity.warden.name=监守者
-entity.allay.name=悦灵
-entity.camel.name=骆驼
-entity.chest_raft.name=带宝箱的的竹筏
-entity.bogged.name=沼骸
-entity.wind_charge_projectile.name=风弹
-entity.breeze_wind_charge_projectile.name=风弹
-entity.breeze.name=旋风人
-entity.creaking.name=嘎枝
+
multiplayer.player.joined=%s 加入了游戏
multiplayer.player.left=%s 退出了游戏
plugin.deathmessages.modapi.warn=可选依赖ModAPI没有被加载,所以客户端侧翻译无法使用,正在启用服务端侧翻译