JSON API icon

JSON API -----

Create and send JSON messages easily.




New Javadoc URL: http://javadocs.voidev.info/docs/JsonApi-v3.1.0/index.html

Changelog
  • Added support for Minecraft version 1.17
  • JsonApi will now fail silently for unsupported Minecraft versions and switch to a limited operating mode. In this mode, all messages sent are sent as console messages (using color codes).

Compatibility Note:
This version is backwards-compatible with 3.0.2, as defined by the semantic versioning scheme.
However, it's been years since I've touched this project. If you have any questions or concerns, please contact me.
----------, Jun 25, 2021

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

New Javadoc URL: http://javadocs.coloredcarrot.com/docs/JsonApi-v3.0.1/

Changelog

  • Added support for Minecraft 1.12-pre5
  • Added constructor JsonMsg(JsonMsg... extra)
  • Fixed a bug where invoking style(ChatColor.MAGIC) would change the italic status of the JsonMsg
  • Fixed the javadoc of JsonMsg#extra(List)
----------, May 25, 2017

This is a HUUGE update to JsonApi. It has been completely re-written and features tons of new features, ease-of-use and a better documentation.

Attention developers: You will have to refactor your plugins depending on this API, however it is highly recommend to update as soon as possible as version 2.x will no longer be updated and therefore not support Minecraft 1.11 etc.

To all server owners: From now on, you're going to have to install this API as a plugin. However, it is fair to say that it is going to take the plugins depending on this API a while to update, so you should consider waiting some time before updating.

Changelog:
  • Added support for Minecraft 1.10.x, 1.11.x
  • Class prefix is now "Json" instead of "JSON"
  • Removed JSONComponent(Simple) in favor of only one JsonMsg class
  • Added extras to JsonMsg
  • Added a command "/jsonapi" to display version information
  • Click and hover action construction changed to the format JsonClickEvent#runCommand(String).
----------, Jan 26, 2017

Changelog
  • Added class JSONHoverAction.ShowItemStack written by LordBoos
----------, Jun 30, 2016

Changelog
  • Added compatibility for MC 1.9.x, 1.10
  • Fixed some bugs with the NMS setup code
----------, Jun 30, 2016

Changelog:
- fixed a critical bug
----------, Apr 15, 2016

Changelog:
- removed version dependency, now works with versions 1.8, 1.8.3, 1.8.8, 1.9

Please follow the following steps:
This API used to be version-dependent, but since v2.0, that's fixed.
Compatible versions:
- 1.8.x
- 1.9.x

You need to add the following code into your onEnable() method:
Code (Text):
        NMSSetupResponse nmsSetupResponse = JSON.setup(this);

        if (nmsSetupResponse.isCompatible())
            getLogger().info("[VersionManager] Hooked server version " + nmsSetupResponse.getVersion());
        else
        {
            getLogger().warning("[VersionManager] Your server version (" + (nmsSetupResponse.getVersion() == null ? "UNKNOWN" : nmsSetupResponse.getVersion()) + ") is not compatible with this plugin!");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }
----------, Apr 15, 2016

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