When using the /say command to say the name of an entity, e.g.
"/say @a"
It is always the case, that the name(s) said are in the colour of the team they are assigned to.
When using the "/tellraw" command however, e.g.
"/tellraw @s [{"selector":"@a"}]"
The team colors are only applied if the selector returns more than one entity. This is problematic when using team colors as a way to format parts of a longer /tellraw command.
Follow these steps to reproduce:
1 Create a new world in the 1.13 snapshot
2 Run this command: "/summon armor_stand ~ ~ ~ {Tags:["Tag1","Tag3"]}"
3 Run this command: "/summon armor_stand ~ ~ ~ {Tags:["Tag2","Tag3"]}"
4 Run this command: "/team add Test1"
5 Run this command: "/team add Test2"
6 Run this command: "/team option Test1 color red"
7 Run this command: "/team option Test2 color blue"
8 Run this command: "/team join Test1 @e[tag=Tag1]"
9 Run this command: "/team join Test2 @e[tag=Tag2]"
10 Run the commands "/say @e[tag=Tag1]" and "/say @e[tag=Tag2]". You will note, that the
team color is properly displayed on the names.
11 Run the commands "/tellraw @s [{"selector":"@e[tag=Tag1]"}]" and "/tellraw @s
[{"selector":"@e[tag=Tag2]"}]". You will note, that the team color is not displayed on the
names. The team color will however display if the selector returns more than one entity.
This can be observed by running the command: "/tellraw @s [{"selector":"@e[tag=Tag3]"}]".
/say also works this way, which is as expected: "/say @e[tag=Tag3]"The results of the commands can be seen on the attached images.
Doesn't only affect team color, all components except plain text seems to be affected. See comments for more info.
Linked issues
relates to 2
Attachments
Comments 7
Doesn't only affect team color, all components except plain text seems to be affected:
summon minecraft:area_effect_cloud ~ ~ ~ {CustomName: "{\"bold\": true, \"color\": \"blue\", \"text\": \"hi\"}", Tags: ["temp"]}
tellraw @s ["", {"selector":"@e[tag=temp]"}]
say @e[tag=temp]-> the tellraw command show plain white text
-> the say command has the right formatting
Seems related to MC-123813
summon minecraft:area_effect_cloud ~ ~ ~ {CustomName: "{\"translate\": \"%s\", \"with\": [{\"bold\": true, \"color\": \"blue\", \"text\": \"hi\"}]}", Tags: ["temp"]}
tellraw @s ["", {"selector":"@e[tag=temp]"}]eventhough it only finds 1 entity, the formatting works when it's translating text and inserting elements from the "with" list
Please do not mark unreleased versions as affected.
You don't have access to them yet.