I'm making a 2 player adventure map. Throughout the map there are places where both players will enter at the same time. The question I have is this: is there a way to have a command block say something to both players that only they can see (like a secret that the other one can't see)

This is going to be a big part of the game as it's a team work/PvP mystery game, so any help would be much appreciated


Yes! There are two ways:

You can either /tellraw or you could /msg. Syntax:

/tellraw [selector] [json string]
/msg [selector] [message]

Both have arguments that allow you to specify who to send said message to.
Just have them filterable in some way, for example: Assigning teams.

Alternatively, this really complicated and botched method also works (though I wouldn't recommend it, at all, because you would need one set per concurrent player and does not support people switching in/out).

/scoreboard objectives add PlayerID PlayerID dummy
<insert my linked crude contraption>
/tellraw @a[score_PlayerID_min=0,score_PlayerID=0] {text:"You are player 0"}
/msg @a[score_PlayerID_min=1,score_PlayerID=1] You are player 1.
  • 1
    Further explanation about this: Wiki link to how the easiest solution works: minecraft.gamepedia.com/Commands/tell So to for example tell the nearest player "Start now!", the command is just "/tell @p Start now!", alternatively you can also use /w or /msg, they work the same. To tell the player called "Horst" the message "This is a text", it also works as expected: "/tell Horst This is a text". The part that we can't help you with is the selector. Either you want the nearest player, a player with a certain name, a player with a certain tag or score or something else, that depends on your map. – Fabian Röling Jul 18 '17 at 12:28
  • I should have specified, it would be 2 people I wouldn't know the name of? – Danny yeti Jul 18 '17 at 12:31
  • The idea is that; throughout the game the players are told different things whilst working together, and one ends up trying to kill the other player, so it needs to be like a secret message – Danny yeti Jul 18 '17 at 12:37
  • @Fabian By "further explanation", you mean "spell out the commands so that one can copy-paste without thinking ", right? Because I already started ways you can differentiate the players. Also, I don't see a minecraft-commands tag. – aytimothy Jul 18 '17 at 13:21
  • @aytimothy You gave the command structure and I thought it would be helpful to have examples, so I wrote them. Nothing more, nothing less. – Fabian Röling Jul 18 '17 at 14:18

Create the visible area somewhere and clone it as invisible bedrock area and set the visible area 100 blocks bottom the invisible area (on the example).

Then place 7 blocks as a string somewhere; set 3 slow redstone repeaters on blocks 2, 4 and 6, and place impulse command blocks on blocks 3, 5 and 7. Program Impulse command block on block 3 by the command:/execute <player name> ~ ~ ~ teleport @p ~ ~-100 ~

Program the command block on the 5th block to: /execute <player name> ~ ~ ~ teleport @p ~ ~+100 ~

Program the command block on 7th block by: /setblock <cordinates of the top of the first block> air

Type to a repeating command block /clear <player name> gold_nugget 0 1

And then connect it to a conditional chaincommand block with command: /setblock <cordinates of the top of the first block> redstone_block

Set 3rd conditional chaincommand block on the chaincommand block on the repeating command block with command: give <player name> gold_nugget 1 0

(And remember to give yourself the gold nugget, or it will not work for you, you need to do 2 of that command block creations to allow the trick for your friend too!) (This example is from minecraft PE, I don't know, what version do you have, but I did what I can.)

  • Errr.. What are you trying to answer? – aytimothy Jul 27 '17 at 10:13

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.