Home Getting Started With Scripts Commands Examples
BracketDumpers BracketHandlers BracketValidators

ChatFormatting

Importing the class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

script.zs
import crafttweaker.api.text.ChatFormatting;

Enum Constants

ChatFormatting is an enum. It has 22 enum constants. They are accessible using the code below.

script.zs
ChatFormatting.BLACK
ChatFormatting.DARK_BLUE
ChatFormatting.DARK_GREEN
ChatFormatting.DARK_AQUA
ChatFormatting.DARK_RED
ChatFormatting.DARK_PURPLE
ChatFormatting.GOLD
ChatFormatting.GRAY
ChatFormatting.DARK_GRAY
ChatFormatting.BLUE
ChatFormatting.GREEN
ChatFormatting.AQUA
ChatFormatting.RED
ChatFormatting.LIGHT_PURPLE
ChatFormatting.YELLOW
ChatFormatting.WHITE
ChatFormatting.OBFUSCATED
ChatFormatting.BOLD
ChatFormatting.STRIKETHROUGH
ChatFormatting.UNDERLINE
ChatFormatting.ITALIC
ChatFormatting.RESET

Casters

Result typeIs Implicit
Result type
string
Is Implicit
true
Result type
Style
Is Implicit
true

Methods

Return Type: Style

script.zs
// ChatFormatting.asStyle() as Style
myChatFormatting.asStyle();

Return Type: char

script.zs
// ChatFormatting.getChar() as char
myChatFormatting.getChar();

Return Type: invalid

script.zs
// ChatFormatting.getColor() as invalid
myChatFormatting.getColor();

Return Type: int

script.zs
// ChatFormatting.getId() as int
myChatFormatting.getId();

Return Type: string

script.zs
// ChatFormatting.getName() as string
myChatFormatting.getName();

Return Type: boolean

script.zs
// ChatFormatting.isColor() as boolean
myChatFormatting.isColor();

Return Type: boolean

script.zs
// ChatFormatting.isFormat() as boolean
myChatFormatting.isFormat();

Return Type: string

script.zs
// ChatFormatting.toString() as string
myChatFormatting.toString();

Properties

NameTypeHas GetterHas SetterDescription
Name
id
Type
int
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
isColor
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
isFormat
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided