Cuberite Forum
JSON formatted text - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html)
+--- Thread: JSON formatted text (/thread-2178.html)



JSON formatted text - Zee1234 - 10-25-2015

If I wanted to send a custom formatted JSON text string in the plugin, how would I do that? I'd need more functionality than the cCompositeChat class can handle (I think), like hover text and applying multiple effects to a single string (think a word that is blue, bold, suggests a command, and, on hover, shows the text "Hello World\nThis is FizzBuzz\nPlease say hi to Foo", although preferable with proper JSON formatting, or otherwise formatted and colored). I'd even be willing to construct the packet if it can be done that way, although I'd rather return a string containing the JSON.


RE: JSON formatted text - xoft - 10-26-2015

Everything except for the hover text can already be done with the current cCompositeChat functionality. The format specifier of any part can take multiple formats (color, bold, ...) at once.

I don't think there's a way to send raw json yet, although it was planned.