Minecraft – How to make a fake name when I use command blocks

minecraft-commandsminecraft-java-edition

I'm trying to make a mini game but I want it so that when you press a button over a command block it will say "BOB welcome", so 'bob' instead of the @a or @p sign and then followed by the message.
All I know is that I need to use /tellraw.

Best Answer

no, don't use /tellraw, this prints out the raw product rather than running the command inside the quote. If you use /say or /tell then type something like, "welcome @p to my secret lair" it will come out as, "welcome [name of nearest player] to my secret lair". Command is below:

/tell @p "hello there @p, welcome to my lair"