0

I'm trying to get a command block to write in the chat, and it is working, but it is displaying it to all players in the server. I only want the chat to appear to the player that steps on the pressure plate. Ive tried everything from @p and @s.

example of text I try is below

/tellraw @p {"text":"Hello World!"}

but that tells it to every player. I've tried

/tellraw @p[distance=3] {"text":"Hello World!"}

but that doesn't work either.

  • 1
    No, a command that starts with /tellraw @p does not do anything for every player. How did you test this? And in what version are you playing? – Fabian Röling Oct 13 at 10:57
  • I tested this at a spawn in a public server and I'm playing 1.14.4 Other players are saying they are receiving the chat message far away from spawn. I'm not sure why this is happening – Trick Thaweeshti Oct 14 at 1:22
  • Wait never mind, turns out some of the command blocks were @a, i'm dumb lol – Trick Thaweeshti Oct 14 at 4:54
-1

Well, “distance” isn’t a tag, use r instead.

Also, @p would only do one player, so use @a. This would make

/tellraw @a[r=3] {“text”:”Hello World!”}.
  • I have a pressure plate that's on top of the command block so I'm trying to make it is for whoever steps on the plate. And I've tried r=3 too and it still doesn't work – Trick Thaweeshti Oct 14 at 3:39
  • Wait never mind, turns out some of the command blocks were @a, i'm dumb lol – Trick Thaweeshti Oct 14 at 4:54
  • distance is the "new" variant of r, which allows for multiple new features. I put "new" in quotation marks, because this was changed almost two years ago. If you haven't played the game for this long, please don't answer without checking what you're saying. And your @p vs. @a advice is exactly the opposite of what the asker wanted. – Fabian Röling Oct 14 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.