Home Commands Examples Getting Started With Scripts Global Keywords

MutableComponent

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

Implemented Interfaces

MutableComponent implements the following interfaces. That means all methods defined in these interfaces are also available in MutableComponent

Methods

Return Type: MutableComponent

script.zs
MutableComponent.append(component as Component) as MutableComponent
ParameterType
Parameter
component
Type
Component

Return Type: MutableComponent

script.zs
MutableComponent.append(component as MutableComponent) as MutableComponent
ParameterType
Parameter
component
Type
MutableComponent

Return Type: MutableComponent

script.zs
MutableComponent.append(content as string) as MutableComponent
ParameterType
Parameter
content
Type
string

Return Type: MutableComponent

script.zs
MutableComponent.setStyle(style as Style) as MutableComponent
ParameterType
Parameter
style
Type
Style

Return Type: MutableComponent

script.zs
MutableComponent.withStyle(formatting as ChatFormatting[]) as MutableComponent
ParameterType
Parameter
formatting
Type
ChatFormatting[]

Return Type: MutableComponent

script.zs
MutableComponent.withStyle(style as Style) as MutableComponent
ParameterType
Parameter
style
Type
Style

Return Type: MutableComponent

script.zs
MutableComponent.withStyle(styleOperator as Function<Style,Style>) as MutableComponent
ParameterType
Parameter
styleOperator
Type
Function<Style,Style>