public final class TextComponent extends BaseComponent
| Constructor and Description |
|---|
TextComponent()
Creates a TextComponent with blank text.
|
TextComponent(BaseComponent... extras)
Creates a TextComponent with blank text and the extras set to the passed
array
|
TextComponent(TextComponent textComponent)
Creates a TextComponent with formatting and text from the passed
component
|
| Modifier and Type | Method and Description |
|---|---|
TextComponent |
duplicate()
Creates a duplicate of this TextComponent.
|
static BaseComponent[] |
fromLegacyText(String message)
Converts the old formatting system that used
ChatColor.COLOR_CHAR into the new json based
system. |
static BaseComponent[] |
fromLegacyText(String message,
ChatColor defaultColor)
Converts the old formatting system that used
ChatColor.COLOR_CHAR into the new json based
system. |
protected void |
toLegacyText(StringBuilder builder) |
protected void |
toPlainText(StringBuilder builder) |
String |
toString() |
addExtra, addExtra, copyFormatting, copyFormatting, copyFormatting, duplicateWithoutFormatting, getColor, getColorRaw, getFont, getFontRaw, hasFormatting, isBold, isBoldRaw, isItalic, isItalicRaw, isObfuscated, isObfuscatedRaw, isStrikethrough, isStrikethroughRaw, isUnderlined, isUnderlinedRaw, retain, setExtra, toLegacyText, toLegacyText, toPlainText, toPlainTextpublic TextComponent()
public TextComponent(TextComponent textComponent)
textComponent - the component to copy frompublic TextComponent(BaseComponent... extras)
extras - the extras to setpublic static BaseComponent[] fromLegacyText(String message)
ChatColor.COLOR_CHAR into the new json based
system.message - the text to convertpublic static BaseComponent[] fromLegacyText(String message, ChatColor defaultColor)
ChatColor.COLOR_CHAR into the new json based
system.message - the text to convertdefaultColor - color to use when no formatting is to be applied
(i.e. after ChatColor.RESET).public TextComponent duplicate()
duplicate in class BaseComponentprotected void toPlainText(StringBuilder builder)
protected void toLegacyText(StringBuilder builder)
Copyright © 2012–2020 SpigotMC. All rights reserved.