8

JSON text format in Bedrock Edition is very different from that in Java Edition.

The possible elements to go in the {"rawtext":[]} component are:

  • text
  • translate
  • with
  • (args)

As you can see it is a very limited selection. This also means that there is no way to output a scoreboard score or a target selector's result to the chat. Is that right, or is there an alternate way to output these?

0

3 Answers 3

2

As of November 17, 2020, this has been made possible with the 1.16.100 update. This update includes changes to command format, including the addition of selectors and scores to the Bedrock Edition /tellraw command. These act the same as their Java Edition counterparts, meaning the commands that you know and love in Java Edition will be the same when they are added to Bedrock Edition.

Note that you need to change the raw JSON text format to be in BE syntax:

  • tellraw @a {"rawtext":[{"selector":"@p"},{"text":" has won the game!"}]}
    
  • tellraw @a {"rawtext":[{"text":"You have "},{"score":{"name":"*","objective":"lives"}},{"text":"lives left."}]}
    

Remember, while these new JSON features have been added to Bedrock Edition to make it more like Java Edition's ways, they are still not the same. The following items will still be different:

  • Text formatting: Instead of using raw JSON text, use the section sign § with formatting codes. For example:
    {"text":"Test","bold":true}{"text":"§lTest"}
  • No further changes have been made to allow NBT support. So unfortunately, you may not use raw JSON text in NBT tags, like items' custom names and lores, though you can mimic the /give command through a little extra work.
0

what about /tellraw @p {"rawtext":[{"score":{"name":"@s","objective":"obj_name","value":"?"}}]}?

0
-2

if you're still looking

/tellraw @a ["",{"text":"Your score: "},{"score":{"name":"@a","objective":"your score name"}}]
0

You must log in to answer this question.

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