Formatting in the Minecraft 1.8 action bar

This post is just filler until I find something interesting, but for now...

Unfortunately, Mojang does not support "true" JSON formatting in the action bar. Regular JSON text is accepted (and is expected) but the output will have missing formatting. Luckily, this is fairly easy to solve with Gson.

  1. Translate the text back into legacy text, e.g. by TextComponent.toLegacyText() for the BungeeCord chat API.
  2. Wrap the legacy text in a normal JSON chat message, i.e. {'text': 'ยง7test'}.