Minecraft – tellraw command with selector command doesnt’ work

minecraft-commandsminecraft-java-edition

Can someone help me by adding a selector into this command? I want @p[score_quits_min=1] to be added into this:

/execute @a[score_quits_min=1] ~ ~ ~ tellraw @a [{"text":"WELCOME", "color":"gold"} *added right here* {"text":"TO THE REALM", "color":"gold"}]

I have the command connected to a clock and another command block with this command connected into the /execute command:

/scoreboard players set @a[score_quits_min=1] quits 0

I have been searching for an answer for a long time but never found one.

Best Answer

The selector string holds a selector to be parsed. It is exclusive with the the text, translate, and score tags, so it must not be mixed with them. Small example:

/tellraw @a ["Closest player to command block: ",{"selector":"@p"}]

Inserting into your command:

/execute @a[score_quits_min=1] ~ ~ ~ tellraw @a [{"text":"WELCOME", "color":"gold"},{"selector":"@p[score_quits_min=1]"},{"text":"TO THE REALM", "color":"gold"}]