Home Commands Examples Getting Started With Scripts Global Keywords

Style

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.Style;

Static Methods

Return Type: Style

script.zs
// Style.empty() as Style
Style.empty();

Methods

Return Type: Style

script.zs
Style.applyFormat(format as ChatFormatting) as Style
ParameterType
Parameter
format
Type
ChatFormatting

Return Type: Style

script.zs
Style.applyFormats(formattings as ChatFormatting[]) as Style
ParameterType
Parameter
formattings
Type
ChatFormatting[]

Return Type: Style

script.zs
Style.applyLegacyFormat(format as ChatFormatting) as Style
ParameterType
Parameter
format
Type
ChatFormatting

Return Type: Style

script.zs
Style.applyTo(style as Style) as Style
ParameterType
Parameter
style
Type
Style

Return Type: TextColor?

script.zs
// Style.getColor() as TextColor?
myStyle.getColor();

Return Type: ResourceLocation

script.zs
// Style.getFont() as ResourceLocation
myStyle.getFont();

Return Type: string?

script.zs
// Style.getInsertion() as string?
myStyle.getInsertion();

Return Type: boolean

script.zs
// Style.isBold() as boolean
myStyle.isBold();

Return Type: boolean

script.zs
// Style.isEmpty() as boolean
myStyle.isEmpty();

Return Type: boolean

script.zs
// Style.isItalic() as boolean
myStyle.isItalic();

Return Type: boolean

script.zs
// Style.isObfuscated() as boolean
myStyle.isObfuscated();

Return Type: boolean

script.zs
// Style.isStrikethrough() as boolean
myStyle.isStrikethrough();

Return Type: boolean

script.zs
// Style.isUnderlined() as boolean
myStyle.isUnderlined();

Return Type: Style

script.zs
// Style.setBold() as Style
myStyle.setBold();

Return Type: Style

script.zs
// Style.setItalic() as Style
myStyle.setItalic();

Return Type: Style

script.zs
// Style.setObfuscated() as Style
myStyle.setObfuscated();

Return Type: Style

script.zs
// Style.setStrikethrough() as Style
myStyle.setStrikethrough();

Return Type: Style

script.zs
// Style.setUnderlined() as Style
myStyle.setUnderlined();

Return Type: Style

script.zs
Style.withBold(value as bool?) as Style
ParameterType
Parameter
value
Type
bool?

Return Type: Style

script.zs
Style.withColor(color as int) as Style
ParameterType
Parameter
color
Type
int

Return Type: Style

script.zs
Style.withColor(formatting as ChatFormatting?) as Style
ParameterType
Parameter
formatting
Type
ChatFormatting?

Return Type: Style

script.zs
Style.withColor(textColor as TextColor?) as Style
ParameterType
Parameter
textColor
Type
TextColor?

Return Type: Style

script.zs
Style.withFont(fontId as ResourceLocation?) as Style
ParameterType
Parameter
fontId
Type
ResourceLocation?

Return Type: Style

script.zs
Style.withInsertion(content as string?) as Style
ParameterType
Parameter
content
Type
string?

Return Type: Style

script.zs
Style.withItalic(value as bool?) as Style
ParameterType
Parameter
value
Type
bool?

Return Type: Style

script.zs
Style.withObfuscated(value as bool?) as Style
ParameterType
Parameter
value
Type
bool?

Return Type: Style

script.zs
Style.withStrikethrough(value as bool?) as Style
ParameterType
Parameter
value
Type
bool?

Return Type: Style

script.zs
Style.withUnderlined(value as bool?) as Style
ParameterType
Parameter
value
Type
bool?

Properties

NameTypeHas GetterHas Setter
Name
bold
Type
boolean
Has Getter
true
Has Setter
false
Name
color
Type
TextColor?
Has Getter
true
Has Setter
false
Name
empty
Type
boolean
Has Getter
true
Has Setter
false
Name
font
Type
ResourceLocation
Has Getter
true
Has Setter
false
Name
insertion
Type
string?
Has Getter
true
Has Setter
false
Name
italic
Type
boolean
Has Getter
true
Has Setter
false
Name
obfucated
Type
boolean
Has Getter
true
Has Setter
false
Name
strikethrough
Type
boolean
Has Getter
true
Has Setter
false
Name
underlined
Type
boolean
Has Getter
true
Has Setter
false