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.
import crafttweaker.api.text.Style;Static Methods
Return Type: Style
// Style.empty() as Style
Style.empty();Methods
Return Type: Style
Style.applyFormat(format as ChatFormatting) as Style| Parameter | Type |
|---|---|
Parameter format | Type ChatFormatting |
Return Type: Style
Style.applyFormats(formattings as ChatFormatting[]) as Style| Parameter | Type |
|---|---|
Parameter formattings | Type ChatFormatting[] |
Return Type: Style
Style.applyLegacyFormat(format as ChatFormatting) as Style| Parameter | Type |
|---|---|
Parameter format | Type ChatFormatting |
Return Type: TextColor?
// Style.getColor() as TextColor?
myStyle.getColor();Return Type: ResourceLocation
// Style.getFont() as ResourceLocation
myStyle.getFont();Return Type: string?
// Style.getInsertion() as string?
myStyle.getInsertion();Return Type: boolean
// Style.isBold() as boolean
myStyle.isBold();Return Type: boolean
// Style.isEmpty() as boolean
myStyle.isEmpty();Return Type: boolean
// Style.isItalic() as boolean
myStyle.isItalic();Return Type: boolean
// Style.isObfuscated() as boolean
myStyle.isObfuscated();Return Type: boolean
// Style.isStrikethrough() as boolean
myStyle.isStrikethrough();Return Type: boolean
// Style.isUnderlined() as boolean
myStyle.isUnderlined();Return Type: Style
// Style.setBold() as Style
myStyle.setBold();Return Type: Style
// Style.setItalic() as Style
myStyle.setItalic();Return Type: Style
// Style.setObfuscated() as Style
myStyle.setObfuscated();Return Type: Style
// Style.setStrikethrough() as Style
myStyle.setStrikethrough();Return Type: Style
// Style.setUnderlined() as Style
myStyle.setUnderlined();Return Type: Style
Style.withBold(value as bool?) as Style| Parameter | Type |
|---|---|
Parameter value | Type bool? |
Return Type: Style
Style.withColor(color as int) as Style| Parameter | Type |
|---|---|
Parameter color | Type int |
Return Type: Style
Style.withColor(formatting as ChatFormatting?) as Style| Parameter | Type |
|---|---|
Parameter formatting | Type ChatFormatting? |
Return Type: Style
Style.withFont(fontId as ResourceLocation?) as Style| Parameter | Type |
|---|---|
Parameter fontId | Type ResourceLocation? |
Return Type: Style
Style.withInsertion(content as string?) as Style| Parameter | Type |
|---|---|
Parameter content | Type string? |
Return Type: Style
Style.withItalic(value as bool?) as Style| Parameter | Type |
|---|---|
Parameter value | Type bool? |
Return Type: Style
Style.withObfuscated(value as bool?) as Style| Parameter | Type |
|---|---|
Parameter value | Type bool? |
Return Type: Style
Style.withStrikethrough(value as bool?) as Style| Parameter | Type |
|---|---|
Parameter value | Type bool? |
Return Type: Style
Style.withUnderlined(value as bool?) as Style| Parameter | Type |
|---|---|
Parameter value | Type bool? |
Properties
| Name | Type | Has Getter | Has 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 |