I'm adjusting a tellraw command to use with 1.9 and the selector text is showing as green/not bolded, but the rest is displaying correctly. Is there something wrong with my syntax?
/execute @a[tag=!setup] ~ ~ ~ /tellraw @a {"text":"","extra":[{"text":"Welcome ","color":"gold","bold":"true"},{"selector":"@a[tag=!setup]","color":"gray","bold":true},{"text":" to the server!","color":"gold","bold":"true"}]}
Best Answer
This is caused by scoreboard team formatting. The display names obtained from the selector will be stylized separately if the target is in a team. Since the formatting options of the display names are being set at their own depth, it overwrites formatting inherited from the parent, being
color
,bold
,italic
,underlined
,obfuscated
, andstrikethrough
(all defaulting to false without a third-party NBT editor to modify the prefix in the scoreboard.dat file andcolor
is defined by the team option).As well,
insertion
,hoverEvent
, andclickEvent
will be overwritten no matter if the target is in a team or not. However,clickEvent
will only be overwritten for player display names and not non-player display names.You will either have to remove the player from the team before running the command or wait before adding them to the team until after the command runs.