MCStyle
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.util.text.MCStyle;Constructors
No Description Provided
new MCStyle() as MCStylenew MCStyle();Methods
Applies the formatting characteristics (Bold, Italic, Obfucated, etc) of the given MCTExtFormatting as well as the colour of the formatting.
Returns: A new MCStyle with the given Formatting.
Return Type: MCStyle
MCStyle.applyFormatting(formatting as TextFormatting) as MCStyle| Parameter | Type | Description | 
|---|---|---|
| Parameterformatting | TypeTextFormatting | DescriptionThe formatting to set. | 
Return Type: boolean
MCStyle.equals(other as Object) as boolean| Parameter | Type | Description | 
|---|---|---|
| Parameterother | TypeObject | DescriptionNo Description Provided | 
Return Type: boolean
// MCStyle.getBold() as boolean
new MCStyle().getBold();Return Type: int
// MCStyle.getColor() as int
new MCStyle().getColor();Return Type: MCResourceLocation
// MCStyle.getFontId() as MCResourceLocation
new MCStyle().getFontId();Return Type: string
// MCStyle.getInsertion() as string
new MCStyle().getInsertion();Return Type: boolean
// MCStyle.getItalic() as boolean
new MCStyle().getItalic();Return Type: boolean
// MCStyle.getObfuscated() as boolean
new MCStyle().getObfuscated();Return Type: boolean
// MCStyle.getStrikethrough() as boolean
new MCStyle().getStrikethrough();Return Type: boolean
// MCStyle.getUnderlined() as boolean
new MCStyle().getUnderlined();Return Type: int
// MCStyle.hashCode() as int
new MCStyle().hashCode();Whether or not this style is empty (inherits everything from the parent).
Return Type: boolean
// MCStyle.isEmpty() as boolean
new MCStyle().isEmpty();Return Type: MCStyle
MCStyle.setBold(boldIn as bool?) as MCStyle| Parameter | Type | Description | 
|---|---|---|
| ParameterboldIn | Typebool? | DescriptionNo Description Provided | 
Return Type: MCStyle
MCStyle.setColor(colour as int) as MCStyle| Parameter | Type | Description | 
|---|---|---|
| Parametercolour | Typeint | DescriptionNo Description Provided | 
Return Type: MCStyle
MCStyle.setColor(formatting as TextFormatting) as MCStyle| Parameter | Type | Description | 
|---|---|---|
| Parameterformatting | TypeTextFormatting | DescriptionNo Description Provided | 
Return Type: MCStyle
MCStyle.setFontId(location as MCResourceLocation) as MCStyle| Parameter | Type | Description | 
|---|---|---|
| Parameterlocation | TypeMCResourceLocation | DescriptionNo Description Provided | 
Sets the formatting of the style.
This will only take the colour of the text formatting, so using <formatting:obfuscated> would not do anything as it does not have a colour.
If you want to take the actual characteristics of the MCTextFormatting, use MCStyle#applyFormatting(MCTextFormatting)
Returns: A new MCStyle with the given Formatting.
Return Type: MCStyle
MCStyle.setFormatting(formatting as TextFormatting) as MCStyle| Parameter | Type | Description | 
|---|---|---|
| Parameterformatting | TypeTextFormatting | DescriptionThe formatting to set. | 
Set a text to be inserted into Chat when the component is shift-clicked
Return Type: MCStyle
MCStyle.setInsertion(insertion as string) as MCStyle| Parameter | Type | Description | 
|---|---|---|
| Parameterinsertion | Typestring | DescriptionNo Description Provided | 
Return Type: MCStyle
MCStyle.setItalic(italic as bool?) as MCStyle| Parameter | Type | Description | 
|---|---|---|
| Parameteritalic | Typebool? | DescriptionNo Description Provided | 
Return Type: MCStyle
MCStyle.setObfuscated(obfuscated as bool?) as MCStyle| Parameter | Type | Description | 
|---|---|---|
| Parameterobfuscated | Typebool? | DescriptionNo Description Provided | 
Return Type: MCStyle
MCStyle.setStrikethrough(strikethrough as bool?) as MCStyle| Parameter | Type | Description | 
|---|---|---|
| Parameterstrikethrough | Typebool? | DescriptionNo Description Provided | 
Return Type: MCStyle
MCStyle.setUnderlined(underlined as bool?) as MCStyle| Parameter | Type | Description | 
|---|---|---|
| Parameterunderlined | Typebool? | DescriptionNo Description Provided | 
Return Type: MCStyle
MCStyle.setUnderlined(underlined as boolean) as MCStyle| Parameter | Type | Description | 
|---|---|---|
| Parameterunderlined | Typeboolean | DescriptionNo Description Provided | 
Return Type: string
// MCStyle.toString() as string
new MCStyle().toString();