Sueta

[API] DynamicJson

1.3.0

Json messaging API

·Plugin

DynamicJson is a simple API for creating json messages

Compacts Json

Why is this good? Well, Minecraft has a max message length of 32767 and it can get overloaded pretty quickly, DynamicJson makes the json small, so you can send more data that you actually want to send, and not a bunch of bulk that isn't required (as shown in the image above, Spigot vs DynamicJson)

Color Carrying

Why? Because it's how it should work if you use default CommandSender#sendMessage

The GradientBuilder


(call "finish" to return to DynamicJText)

Reset text

You might ask "What use could I have for this?"
Well, it could add small efficiencies when writing code, say you want a colored link, but don't want previous colors to end, just call "addReset" (I find it useful when building messages from player/config input)


CColor

CColor is pretty neat, it's made so you could just copy the class right into your project, it has a lot of cool methods, like getting a color from a Name/Hex/Translated text. It can translate Gradients, Commons(like shown above, default prefixes for color codes &/#)
You can register a color code to use with it

Replace

What could I use this for? Well, with this you would only have to create 1 DynamicJText instance and be able to send it to all players and simply replace a placeholder!

Parse Text


Parser Keys: [gradient, command, chat, suggest, url, insert, hover]
Parser Key Usage: <key="data use \"to have quotes in the data\"">text to display</key>

Where might you use this feature? I would use it for Configuration Files

Install

<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>

<dependency>
    <groupId>com.github.PerryPlaysMC</groupId>
    <artifactId>DynamicJson</artifactId>
    <version><!-- Version here --></version>
</dependency>

Versions

Similar projects

Plugin →