The downloadable zip file for this resource contains a compiled plugin which uses the API in several example messages.
- Tested Minecraft Versions:
- 1.7
- 1.8
- 1.9
- 1.10
- 1.11
- 1.12
- 1.13
- 1.14
- 1.15
- 1.16
- Source Code:
- https://gist.github.com/justisr/7a7449adac931a066c51
- Donation Link:
- http://paypal.me/justisr/4000
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:
It's really that simple.Code (Java):new JsonMessage().append(ChatColor.GREEN + "Click me to fly!").setHoverAsTooltip("Seriously, just click!", "Zoom zoom!").setClickAsExecuteCmd("/fly").save().send(player[]);
With this API you can...
Or a combination of clicks and hover events at the same time!
- Create tooltips for when a player hovers over your chat message
- Redirect players to a URL, when a player clicks your chat message
- Suggest a command/message to a player's chat box when they click your chat message
- Force the player to run a command when they click your chat message
https://gyazo.com/141dd341317c1ca5bbd142e24646dc77
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.

JsonMessage API 2.3.0
A single class API enabling full control over json messages to be sent in chat
Recent Updates
- Eliminating NMS Usage for 1.16+ Support Jun 1, 2021
- Respecting Style Codes Feb 22, 2021
- The prodigal son returns Jun 1, 2018