I'm supposed to troll my friend in minecraft with herobrine. I wanted to do that when I press a button, the message: herobrine joined the game. What is the command for this?
Simply / say and the message.
It works best with / tellraw, since it does not contain the sender of the message and you even format the text, e.g. Can dye.
You have to use the command / say but it is important that you use it from the comandblock / serverconsole, otherwise you can see who wrote it.
You can also see that with a command block because it says [@]
But then stands in front of it [] is there another type?
As Chaos53925 said, / tellraw @a {"text": "Your message here"}
Then only the text is displayed.
It is best to use / tellraw as Chaos53925 has already written. A good tool for this https://minecraft.tools/de/. It is very easy to use. Here is still the command:
/ tellraw @a {"text": "Herobrine joined the game", "color": "yellow"}