JsonMessage API icon

JsonMessage API -----

A single class API enabling full control over json messages to be sent in chat




For the sake of ensuring compatibility across all future NMS code changes, I’ve eliminated the usage of NMS entirely and switched to internally calling the tellraw command.

Since the tellraw command was only added in 1.7.2, version support for prior Minecraft versions has been dropped, but it’s a small price to pay, considering how few servers still run at such old versions.
----------, Jun 1, 2021

In previous versions, style codes (bold, italic, underline, magic, strikethrough, reset) weren’t properly respected.

This version will convert these codes into their respective JSON settings without interfering with colors.

Apologies that this patch was so delayed. Admittedly, I do very little plugin development these days, and so I do rely on receiving messages from my library users if there’s a potential issue.

Stay warm and healthy.
----------, Feb 22, 2021

Anyone who's ever worked with Json Messages in Minecraft will know that a long time ago, Mojang's good work broke Json chat message colors when the client splits the message into a new line on their screen for longer messages.
It's about time I made an update to JsonMessage that removes chat color codes from the raw text, and utilizes the "color" attribute as Mojang wants.
However, fear not. The methods for creating colorized Json chat messages has not changed. Input the chat messages as you would for any normal messages and JsonMessage will take care of the rest for you! No more broken colors, ever!

Unfortunately 1.12 removed achievements. They're being fazed out by Mojang in favor of "Advancements". I'll add support for these again once Mojang figures out what it is they're doing.

I've also added a static utility command for sending raw json as a message to a player.

Someone did a benchmark with JsonMessage against Fanciful and reported that JsonMessage was more than 100% faster on average, though of course, messages are very diverse, so if anyone would like to assist in the determination of true average speed advantages, feel free. I'd appreciate it.
----------, Jun 1, 2018

- nvm- apparently, you cannot switch download links once the resource has been created.
----------, Nov 12, 2016

Fixed version incompatibilities.
Now tested for 1.6, 1.7, 1.8, 1.9, and 1.10

Refactored and simplified unaccessed areas of the source.
----------, Oct 28, 2016

The previous update of this API utilized apache's StringEscapeUtils for escaping unescaped json strings inputted by the user.
The spigot hack is missing a lot of imports, including this one.

This current version uses the JsonObject class, which is available in the spigot hack's imports, and will therefore work for both.
----------, Dec 30, 2015

We all make mistakes.
This update will help to catch yours, if you ever find yourself having inputted some unescaped text into the json builder.
----------, Dec 28, 2015

Resource Information
Author:
----------
Total Downloads: 1,083
First Release: Dec 27, 2015
Last Update: Jun 1, 2021
Category: ---------------
All-Time Rating:
3 ratings
Find more info at gist.github.com...
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings