0.0.1 ldk-chat
Closed this issue · 0 comments
lgou2w commented
Introduction
The ChatComponent is a JSON format chat message in Minecraft. This module allows you to quickly parse strings or JSON into chat components.
Example
- JSON -> ChatComponent
val json = "{\"text\":\"HelloWorld!\",\"color\":\"green\",\"bold\":true}"
val component = ChatSerializer.fromJson(json)
println(component)
println(component.toJson())
- Raw -> ChatComponent
Raw is a plain text string containing color characters
val raw = "&a&lHelloWorld!"
val component = ChatSerializer.fromRaw(raw)
println(component)
println(component.toJson())