mojira.dev
MC-201185

"name" selector argument interprets translate components literally

Custom entity names with translated components are not handled correctly in command selector arguments. It appears that the name selector argument checks if the entity in question has a resolved name equal to the parameter value, which doesn't make sense for translate components as this means commands may differently depending on client language.

To reproduce (singleplayer):

1. Set your language to "English (US)"
2. Run the following commands in a new superflat world free of entities:

/summon minecraft:armor_stand ~ ~ ~ {CustomName:'{"translate":"entity.minecraft.armor_stand"}'}
/execute if entity @e[name="Armor Stand"]

The output should indicate that the test passed.

3. Now, change your language to "English (Canada)" and again run

/execute if entity @e[name="Armor Stand"]

The output should indicate that the test failed.

I would expect that commands would have the same execution results regardless of client language. On multiplayer servers, commands run as if the language is "English (US)" regardless of client language.

Comments 6

This issue is cool for map creators that wants to translate something without an hard work

They can already translate their maps with resource packs

Can confirm in 1.18.1

That version is already marked as affected

Can confirm as of 22w03a

For some reason in 1.19.3 "Armor Stand" does not properly get translated to "Armour Stand" in Canadian or British English. Try "Pirate Speak" in this version to reproduce

Ely G

(Unassigned)

Community Consensus

Commands

1.16.3, 1.16.4 Pre-release 1, 1.16.4 Pre-release 2, 1.16.4 Release Candidate 1, 1.16.4, ..., 1.18.2, 1.19, 1.19.1, 1.19.3, 1.19.4

Retrieved