JSON API icon

JSON API -----

Create and send JSON messages easily.



Update 3.0.2: Converting between color-coded and JSON messages
New Javadoc URL: http://javadocs.coloredcarrot.com/docs/JsonApi-v3.0.2/index.html
Or as a compressed .jar: http://javadocs.coloredcarrot.com/docs/JsonApi-v3.0.2-javadoc.jar

Changelog

You can convert any color-code based message to a JsonMsg using the constructor JsonMsg(String text, boolean allowStyleFallthrough).
The allowStyleFallthrough parameter specifies whether the styles should be reset at every new "segment" of the text, where the segments are separated by a continuous set of color codes.
Example:
Code (Java):
JsonMsg msg = new JsonMsg ( "§aHello, §o§lworld!", true ) ;
// The §a (green color) carries over to "§o§lworld!",
// since it does not specify a color itself and allowStyleFallthrough is true
To convert a JsonMsg back to a color-coded message, use the method JsonMsg.toConsoleMessage(boolean insertResetCodes). The insertResetCodes parameter specifies whether the message and each extra message should be prefixed with a reset code (§r).
Example:
Code (Java):
String codeBased = msg. toConsoleMessage ( true ) ;
// codeBased is now "§r§r§aHello, §r§a§l§oworld!"
----------, Aug 1, 2017
Resource Information
Author:
----------
Total Downloads: 14,376
First Release: Apr 1, 2016
Last Update: Jun 25, 2021
Category: ---------------
All-Time Rating:
6 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings