How do i add names in /tellraw [duplicate]
I'm working on a server and when a player joins i want it to say their name. I'm pretty good with commands so you don't have to give me a full command. just in case here is command:
/tellraw @p[count=1,y=~1,x=~,z=~,rm=1,r=2] ["",{"text":"[","color":"dark_blue"},{"text":"~","color":"blue"},{"text":"] ","color":"dark_blue"},{"text":"Welcome ","color":"green"},{"text":"[PlayerNameHere]","color":"red"},{"text":", To [Undecided]!","color":"aqua"},{"text":"\n"},{"text":"[","color":"dark_blue"},{"text":"~","color":"blue"},{"text":"] ","color":"dark_blue"},{"text":"[PlayerNameHere] ","color":"red"},{"text":"You must be new! ","color":"aqua"},{"text":"*Click Here*","color":"aqua","clickEvent":{"action":"run_command","value":"/tellraw @a {\"text\":\"Signed In As: {PlayerNameHere} Password:[Random], Do not forget\"}"}},{"text":" To sign Up!","color":"aqua"}]
You should use the selector
component. For example:
/tellraw @a [{"text":"Welcome, "},{"selector":"@p"}]
Replace @p
with the selector you want to use.