Importing the class

Link to 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.

ZenScript
Copy
import crafttweaker.api.util.text.MCStyle;

No Description Provided

ZenScript
Copy
new MCStyle() as MCStyle
new MCStyle();

Link to g-

Name: applyFormatting

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

ZenScript
Copy
MCStyle.applyFormatting(formatting as TextFormatting) as MCStyle
ParameterTypeDescription
Parameter
formateo
Type
TextFormatting
Description
The formatting to set.

Name: equals

Return Type: boolean

ZenScript
Copy
MCStyle.equals(other as Object) as boolean
ParameterTypeDescription
Parameter
other
Type
Object
Description
No Description Provided

Name: getBold

Return Type: boolean

ZenScript
Copy
// MCStyle.getBold() as boolean

new MCStyle().getBold();

Link to g--3

Name: getColor

Return Type: int

ZenScript
Copy
// MCStyle.getColor() as int

new MCStyle().getColor();

Link to g--4

Name: getFontId

Return Type: MCResourceLocation

ZenScript
Copy
// MCStyle.getFontId() as MCResourceLocation

new MCStyle().getFontId();

Link to g--5

Name: getInsertion

Return Type: string

ZenScript
Copy
// MCStyle.getInsertion() as string

new MCStyle().getInsertion();

Link to g--6

Name: getItalic

Return Type: boolean

ZenScript
Copy
// MCStyle.getItalic() as boolean

new MCStyle().getItalic();

Link to g--7

Name: getObfuscated

Return Type: boolean

ZenScript
Copy
// MCStyle.getObfuscated() as boolean

new MCStyle().getObfuscated();

Link to g--8

Name: getStrikethrough

Return Type: boolean

ZenScript
Copy
// MCStyle.getStrikethrough() as boolean

new MCStyle().getStrikethrough();

Link to g--9

Name: getUnderlined

Return Type: boolean

ZenScript
Copy
// MCStyle.getUnderlined() as boolean

new MCStyle().getUnderlined();

Name: hashCode

Return Type: int

ZenScript
Copy
// MCStyle.hashCode() as int

new MCStyle().hashCode();

Name: isEmpty

Whether or not this style is empty (inherits everything from the parent).

Return Type: boolean

ZenScript
Copy
// MCStyle.isEmpty() as boolean

new MCStyle().isEmpty();

Link to g--12

Name: mergeStyle

Return Type: MCStyle

ZenScript
Copy
MCStyle.mergeStyle(style as MCStyle) as MCStyle
ParameterTypeDescription
Parameter
estilo
Type
Estilo MC
Description
No Description Provided

Name: setBold

Return Type: MCStyle

ZenScript
Copy
MCStyle.setBold(boldIn as bool?) as MCStyle
ParameterTypeDescription
Parameter
boldIn
Type
bool?
Description
No Description Provided

Name: setColor

Return Type: MCStyle

ZenScript
Copy
MCStyle.setColor(colour as int) as MCStyle
ParameterTypeDescription
Parameter
colour
Type
int
Description
No Description Provided

Name: setColor

Return Type: MCStyle

ZenScript
Copy
MCStyle.setColor(formatting as TextFormatting) as MCStyle
ParameterTypeDescription
Parameter
formateo
Type
TextFormatting
Description
No Description Provided

Link to g--16

Name: setFontId

Return Type: MCStyle

ZenScript
Copy
MCStyle.setFontId(location as MCResourceLocation) as MCStyle
ParameterTypeDescription
Parameter
ubicación
Type
Ubicación MCResource
Description
No Description Provided

Link to g--17

Name: setFormatting

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

ZenScript
Copy
MCStyle.setFormatting(formatting as TextFormatting) as MCStyle
ParameterTypeDescription
Parameter
formateo
Type
TextFormatting
Description
The formatting to set.

Link to g--18

Name: setInsertion

Set a text to be inserted into Chat when the component is shift-clicked

Return Type: MCStyle

ZenScript
Copy
MCStyle.setInsertion(insertion as string) as MCStyle
ParameterTypeDescription
Parameter
inserción
Type
string
Description
No Description Provided

Link to g--19

Name: setItalic

Return Type: MCStyle

ZenScript
Copy
MCStyle.setItalic(italic as bool?) as MCStyle
ParameterTypeDescription
Parameter
italic
Type
bool?
Description
No Description Provided

Link to g--20

Name: setObfuscated

Return Type: MCStyle

ZenScript
Copy
MCStyle.setObfuscated(obfuscated as bool?) as MCStyle
ParameterTypeDescription
Parameter
obfuscated
Type
bool?
Description
No Description Provided

Link to g--21

Name: setStrikethrough

Return Type: MCStyle

ZenScript
Copy
MCStyle.setStrikethrough(strikethrough as bool?) as MCStyle
ParameterTypeDescription
Parameter
strikethrough
Type
bool?
Description
No Description Provided

Link to g--22

Name: setUnderlined

Return Type: MCStyle

ZenScript
Copy
MCStyle.setUnderlined(underlined as bool?) as MCStyle
ParameterTypeDescription
Parameter
subrayado
Type
bool?
Description
No Description Provided

Link to g--23

Name: setUnderlined

Return Type: MCStyle

ZenScript
Copy
MCStyle.setUnderlined(underlined as boolean) as MCStyle
ParameterTypeDescription
Parameter
subrayado
Type
boolean
Description
No Description Provided

Name: toString

Return Type: string

ZenScript
Copy
// MCStyle.toString() as string

new MCStyle().toString();