Background
This issue is known to have persisted since 1.8.0.8 Beta.
I have tested for this issue in the following versions:
26.30.29 Preview on Windows 11
26.21 Hotfix on Windows 11
It is likely also present in the following Mobile exclusive versions:
26.23 Hotfix
26.30.31 Preview
Relates to MCPE-38136
Issue Description
Killing a custom tameable entity in an addon results in it’s name being translated from entity.unknown.name instead of it’s actual translation key unless they have been named using a name tag.
Steps to Reproduce (assuming you already have an addon with a custom tameable entity)
Summon or spawn the custom tameable entity.
Tame it. Do not name it with a name tag.
Kill it. See Results below.
Results
Expected Result (en_US)
(insert custom tameable entity name here) was slain by (insert attacker name here)
Actual Result (en_US)
Unknown was slain by (insert attacker name here)
Conducted Tests
Some Files (these are examples)
// test_entity.se.json
{
"format_version": 1.26.30,
"minecraft:entity": {
"description": {
"identifier": "this:entity",
"is_experimental": false,
"is_spawnable": true,
"is_summonable": true
},
"components": {
"minecraft:tameable": {
"probability": 1,
"tame_items": ["minecraft:sugar"],
"tame_event": {
"event": "this:on_tame",
"target": "self"
}
},
"minecraft:nameable": {},
"minecraft:health": {
"value": 10,
"max": 10
},
"minecraft:collision_box": {
"height": 1,
"width": 1
},
"minecraft:type_family":{"family":["mob"]},
"minecraft:pushable_by_block": {},
"minecraft:pushable_by_entity": {}
},
"component_groups": {"this:tame":{"minecraft:is_tamed":{}}}
}
}### en_US.lang
entity.this:entity.name=Test EntityRegardless of whether the entity is experimental or not, it still translates entity.unknown.name as a result of not finding it’s actual translation key.
Results
Dev: Player
Tameable Entity: Name from a name tag
Entity was not named with a name tag and was the victim.
Unknown was slain by Dev
Entity was not named with a name tag and was the attacker.
Dev was slain by Test Entity
Entity was named with a name tag and was the victim.
Tameable Entity was slain by Dev
Entity was named with a name tag and was the attacker.
Dev was slain by Tameable Entity
A wolf was not named with a name tag and was the victim.
Wolf was slain by Dev
Additional Notes
MCPE-38136 has been around since somewhere around the beginning of addons, I think. I generally wanted to raise attention to this because while it’s a small thing, it’s rather annoying.
Files Used
In case I am asked to provide an addon where this bug occurs, I threw together a test addon with a single entity affected by the aforementioned bug. It is tamed instantly with sugar, I only tested if it functioned properly on 26.21, but it’s very generic that it should work regardless of whether it’s used in a preview or mainstream release. I have also provided a screenshot with some results in case those are also requested.
Thank you for helping us improve Minecraft! We saved your files: