I've looked through basically every post about this, and each of them is like 2-3 years old and do not work with Bedrock edition.

Here's the code I have, It displayed Test x= y= z= but does not give any actual values. The Minecraft documentation and wiki didn't have examples for these parts either.

execute @a ~ ~ ~ tellraw @a {"rawtext":[{"text": "Test", "extra":[{"selector":"@s"}]},{"text":" §ax="},{"score":{"name":"@s","objective":"Coords-X"}},{"text":" §ey="},{"score":{"name":"@s","objective":"Coords-Y"}},{"text":" §cz="},{"score":{"name":"@s","objective":"Coords-Z"}}]}

I am fairly certain that the selector is messing up in both the scores and as a selector, but I am unsure on how I would get it to work.

Any ideas on how to fix this, or do it differently?

  • I had the same question, but unfortunately, it's not possible. For now. See this question: How do I output a scoreboard value or a selector to chat in Bedrock Edition? Oct 9 '20 at 23:08
  • @ExpertCoder14 I see now, the wiki says upcoming. Well, I hope 16.1 comes out soon, thanks Oct 9 '20 at 23:45
  • PS. Be careful, Bedrock Edition version numbers change when you add/remove trailing zeros. So 1.16.1 is different from 1.16.100. Numbers after each dot follow integer rules, not decimal rules. Oct 9 '20 at 23:55
  • Also, you now have enough reputation to upvote posts you find helpful. If you found the linked question/answer helpful, please consider heading to the question/answer and upvoting it, to tell the community that it helped you find a solution. Oct 10 '20 at 0:04

Update: This only works in Java edition, not Bedrock, as OP's ask is impossible in the current Bedrock edition. (Hopefully this is still useful as a guide for doing it in Java edition.)

According to the Commands/tellraw wiki page, any text you send using the /tellraw command must be a raw JSON text. On that page, the wiki says you can store scoreboard values in JSON text like this:

Scoreboard Value (requires resolution)

  • score: Displays a score holder's current score in an objective. Displays nothing if the given score holder or the given objective do not exist, or if the score holder is not tracked in the objective.
  • name: The name of the score holder whose score should be displayed. This can be a selector like @p or an explicit name. If the text is a selector, the selector must be guaranteed to never select more than one entity, possibly by adding limit=1. If the text is "", it shows the reader's own score (for example, /tellraw @a {"score":{"name":"","objective":"obj"}} shows every online player their own score in the "obj" objective).[4]
  • objective: The internal name of the objective to display the player's score in.
  • value: Optional. If present, this value is used regardless of what the score would have been.

Now let's look at your code. I'm going to break it up a bit and format it like a JSON file for ease of reading.

execute @a ~ ~ ~ tellraw @a {
    {"text": "Test", "extra":[{"selector":"@s"}]},

    {"text":" §ax="},

    {"text":" §ey="},

    {"text":" §cz="},

So first, you are defining objectives. According to some Reddit posts I found, this is an example of how to do that:


Which means you are doing that correctly, so that's not the issue.

Next, I asked myself if "Coords-X", "Coords-Y" and "Coords-Z" are valid objectives. So I looked it up. It turns out you have to add these as objectives before you can use them. Did you possibly run these commands to add the coordinates as objectives?

/scoreboard objectives add Coords-X dummy

/scoreboard objectives add Coords-Y dummy

/scoreboard objectives add Coords-Z dummy

Finally, it seems like you are trying to use @s to target the entity that runs the command. So you're probably trying to display the coordinates of the person who calls this command. Thus, after you define these objectives, you may need to set up command blocks, one each for X, Y and Z, and set them with this command:

/execute as @a store result score @s Coords-X run data get entity @s Pos[0] 1

Which will keep track of the coordinates so that they can be displayed.

I have no idea if this is helpful but I hope one of these things solves your problem!

  • What version of Minecraft is this answer for? Oct 9 '20 at 23:06
  • @ExpertCoder14 I just noticed your comment on the question that proves this is impossible in OP's version of Minecraft, so I guess my answer is not really helpful. I apologize for not realizing.
    – Sciborg
    Oct 9 '20 at 23:15
  • @ExpertCoder14 This is for Badrock edition (PE; Bedrock) unfortunately. I already have all of the objectives set with values, but the selectors, in general, are not working for me in tellraw commands. The execute command Sciborg provided is for Java Edition, as Badrock has a different format for Execute commands. Also with the @s part, it works does not work with any selector, and the @s is part of a execute for the target, which applies to the limit =1 requirement. I am not able to use the tellraw with a specific target, even if I provide its actual name, in any of the parts Oct 9 '20 at 23:36
  • @EletroMagneticInterference I realized that unfortunately after Expert told me. I apologize for providing a wrong answer as I had assumed Java commands worked in Bedrock. That's my bad.
    – Sciborg
    Oct 9 '20 at 23:37
  • Expert also added a comment, this is currently not possible, I missed the part in the wiki that said "upcoming", but @Sciborg Thanks! Oct 9 '20 at 23:49

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