Bedrock Edition raw JSON text format

= Bedrock Raw JSON Text =

Usage
Raw text is a way to add modifications to text that is displayed, this can be color, commands to run when clicked, or even displaying localized text based on the locale of the user.

Currently in Bedrock, Raw JSON Text is supported in chat with /tellraw, in titles with /titleraw, in book texts (not title or author yet), and on signs.

Raw Text Format
The current format of raw JSON text in Bedrock is a JSON Object which supports the following (mostly optional) elements:
 * The base chat component Object
 * : A string representing raw text to display directly in chat. Note that selectors such as "@a" and "@p" are not translated into player names; "\n" is newline (enter). The string entered for text will not be displayed if translate is specified.
 * : The translation identifier of text to be displayed using the player's selected language. This identifier is the same as the identifiers found in lang files from assets or resource packs.
 * : A list of chat component arguments and/or string arguments to be used by translate.
 * The arguments are text corresponding to the arguments used by the translation string in the current language, in order (for example, the first list element corresponds to "%1$s" in a translation string).

Basic Raw Text Example:

This will tell all players "Hello World". However this will only be in English, see the Translate action to see how to send localized texts.

Appending
Raw text takes in an array of text objects. Each object in the list will be added to the previous object. For example:

This outputs the same "Hello World" as the first example. Appending text can be useful if you want to combine 2 different localized texts, or apply different colors to each word etc.

Translate
The translate object allows you to provide localized text to users. If translate is specified along with text, translate will override the text object. The string you want to provide to translate is the name of the string in the language files. For example in Vanilla Minecraft "commands.op.success" is the string that displays when you /op another person.

This will output "Opped %s" to all players. Note that because of text being ignored with translate specified, the following example will output the same text:

With
In the translate example above, it outputs "Opped %s". If you want to have a name or other text show up instead of %s you'll need to use "with". Note that "with" only works with "translate" and also requires an array [] instead of curly brackets {}.

%%s
You can use "translate" and "%s" without putting a string in the localization files. For example:

This outputs "Hello Steve" to all players.

Multiple %s
You can use multiple %%s 's. They will be filled in, in the order you specified

Outputs: "Hello Steve and Alex"

Ordering with %%#
You can change the order you want to be filled in with by instead specifying it with %%#, replacing # with an actual number. For example to swap the position of Steve and Alex in the above example, instead run the following:

Outputs: "Hello Alex and Steve"