Basics - Yannici/ChatBuilderLib GitHub Wiki
ChatBuilderLib Basics
How to use
The builder is easy to use. You just have to create a new instance and then append new texts, translations, scores or selectors to it. Example:
ChatBuilder builder = new ChatBuilder(); // instance
builder.appendText("This is a text! "); // append text
builder.appendTranslate("multiplayer.player.joined").addWith("Yannici");
builder.appendScore("Yannici", "Kills");
builder.appendSelector("@p");
Formatting
Every new appended text you can easily format and adding colors or events.
ChatBuilder builder = new ChatBuilder();
ChatElement element = builder.appendText("Formatted text");
element.setBold(true); // set text bold
element.setItalic(true); // set text italic
element.setUnderlined(true); // set text underlined
element.setStrikethrough(true); // strikethrough the text
element.setObfuscated(true); // obfuscate the text
element.setColor(ChatColor.RED); // or use string element.setColor("red"); to set color of text