HomeJavaModsJsonMessage API
JsonMessage API
The downloadable zip file for this resource contains a compiled plugin which uses the API in several example messages.
It also contains the .java file containing the API with documentation.
I wanted to ensure it was as easy to add to your project as it is to use, so it's all contained within a single class.

To use the API, all you have to do is:
Code (Java):
new JsonMessage ( ). append (ChatColor. GREEN + "Click me to fly!" ). setHoverAsTooltip ( "Seriously, just click!", "Zoom zoom!" ). setClickAsExecuteCmd ( "/fly" ). save ( ). send (player [ ] ) ;
It's really that simple.

With this API you can...
Or a combination of clicks and hover events at the same time!
https://gyazo.com/141dd341317c1ca5bbd142e24646dc77

This API utilizes reflection in order to work on all server/plugin versions without the need for new imports, provided the class path files don't change.
(I have accounted for the IChatBaseComponent path change)
If class paths do change in future updates, be sure to notify me and I'll make an update.

The plugin version of this resource demonstrates the API with the commands:
/jsonchat
/jsonchat example

Spigot does already come with a huge library for parsing json messages.
There are other massive libraries out there, as well.
Each of them using a lot of different classes, and a lot of unnecessary formatting methods (.color(Color).bold(true)).
BaseComponent TextComponent TranslateComponent ComponentBuilder....... All for a single message!
It becomes confusing, redundant, and tedious...

I aim to be able to replicate all of the neccesary functionality from these large libraries and keeping it contained in a single class file.
So only one class name ever needs to remembered.
JsonMessage.
No components, and NO ridiculous "color" or "bold" or "stylize" methods!

The builder is hidden in a static inner class.
The users of this API never have to deal with it.
Simply string what you want from the message, save and send.
On top of that, it supports all ChatColor formats straight from within the text, so you don't have to append a whole bunch of different strings and reset all the settings just get a new color on your character.

One class.
Simplified API.
ChatColors directly supported without breaking on new lines.
Since I deal with the raw Json strings directly, speed is drastically increased.
For most users, including myself... This is perfect.
(That's the aim, at least)

This API is free for use provided the license is not removed, and I intend to keep it updated constantly.
Though, donations are always welcome. I don't make much.
http://paypal.me/justisr

All suggestions/feedback appreciated.
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

JsonMessage API is a free Minecraft Java mod. Compatible with Minecraft 1.7, 1.8, 1.9, 1.10 and newer. Downloaded 1,104 times (via Spigot). Download it and open it directly in the game.

Explore more