2

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.

3
  • 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? Oct 13, 2019 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 Oct 14, 2019 at 1:22
  • 1
    Wait never mind, turns out some of the command blocks were @a, i'm dumb lol Oct 14, 2019 at 4:54

1 Answer 1

-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!”}.
3
  • 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 Oct 14, 2019 at 3:39
  • Wait never mind, turns out some of the command blocks were @a, i'm dumb lol Oct 14, 2019 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. Oct 14, 2019 at 11:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .