TransWikia.com

How do I output a scoreboard value or a selector to chat in Bedrock Edition?

Arqade Asked on January 11, 2021

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?

2 Answers

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.

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

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.

Correct answer by ExpertCoder14 on January 11, 2021

if you're still looking

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

Answered by Tom Tom on January 11, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP