Home Commands Examples Getting Started With Scripts Global Keywords
BracketDumpers BracketHandlers BracketValidators ResourceLocationBracketHandler

MutableComponent

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

script.zs
import crafttweaker.api.text.MutableComponent;

Implements

MutableComponent implements the following interfaces:

Component,Message,FormattedText

Operators

+(content as Component) as MutableComponent
script.zs
// (MutableComponent + (content as Component)) as MutableComponent
myMutableComponent + myComponent

Parameters:

content Type: Component

Return Type: MutableComponent

+(content as MutableComponent) as MutableComponent
script.zs
// (MutableComponent + (content as MutableComponent)) as MutableComponent
myMutableComponent + myMutableComponent

Parameters:

Return Type: MutableComponent

+(content as string) as MutableComponent
script.zs
// (MutableComponent + (content as string)) as MutableComponent
myMutableComponent + myString

Parameters:

content Type: string

Return Type: MutableComponent

~(content as Component) as MutableComponent
script.zs
// (MutableComponent ~ (content as Component)) as MutableComponent
myMutableComponent ~ myComponent

Parameters:

content Type: Component

Return Type: MutableComponent

~(content as MutableComponent) as MutableComponent
script.zs
// (MutableComponent ~ (content as MutableComponent)) as MutableComponent
myMutableComponent ~ myMutableComponent

Parameters:

Return Type: MutableComponent

~(content as string) as MutableComponent
script.zs
// (MutableComponent ~ (content as string)) as MutableComponent
myMutableComponent ~ myString

Parameters:

content Type: string

Return Type: MutableComponent

<<(content as Component) as MutableComponent
script.zs
// (MutableComponent << (content as Component)) as MutableComponent
myMutableComponent << myComponent

Parameters:

content Type: Component

Return Type: MutableComponent

<<(content as MutableComponent) as MutableComponent
script.zs
// (MutableComponent << (content as MutableComponent)) as MutableComponent
myMutableComponent << myMutableComponent

Parameters:

Return Type: MutableComponent

<<(content as string) as MutableComponent
script.zs
// (MutableComponent << (content as string)) as MutableComponent
myMutableComponent << myString

Parameters:

content Type: string

Return Type: MutableComponent

Members

append(content as string) as MutableComponent
script.zs
// MutableComponent.append(content as string) as MutableComponent;
myMutableComponent.append(myString);

Parameters:

content Type: string

Return Type: MutableComponent

append(component as Component) as MutableComponent
script.zs
// MutableComponent.append(component as Component) as MutableComponent;
myMutableComponent.append(myComponent);

Parameters:

component Type: Component

Return Type: MutableComponent

append(component as MutableComponent) as MutableComponent
script.zs
// MutableComponent.append(component as MutableComponent) as MutableComponent;
myMutableComponent.append(myMutableComponent);

Parameters:

Return Type: MutableComponent

Getter
script.zs
// MutableComponent.contents as ComponentContents
myMutableComponent.contents

Return Type: ComponentContents

contents() as ComponentContents
script.zs
// MutableComponent.contents() as ComponentContents;
myMutableComponent.contents();

Return Type: ComponentContents

copy() as MutableComponent
script.zs
// MutableComponent.copy() as MutableComponent;
myMutableComponent.copy();

Return Type: MutableComponent

static empty() as MutableComponent
script.zs
// MutableComponent.empty() as MutableComponent;
MutableComponent.empty();

Return Type: MutableComponent

getString(maxLength as int) as string
script.zs
// MutableComponent.getString(maxLength as int) as string;
myMutableComponent.getString(myInt);

Parameters:

maxLength Type: int

Return Type: string

getString() as string
script.zs
// MutableComponent.getString() as string;
myMutableComponent.getString();

Return Type: string

implicit as string
script.zs
// MutableComponent as string
myMutableComponent as string

Return Type: string

static keybind(name as string) as MutableComponent
script.zs
// MutableComponent.keybind(name as string) as MutableComponent;
MutableComponent.keybind(myString);

Parameters:

name Type: string

Return Type: MutableComponent

static literal(content as string) as MutableComponent
script.zs
// MutableComponent.literal(content as string) as MutableComponent;
MutableComponent.literal(myString);

Parameters:

content Type: string

Return Type: MutableComponent

static nullToEmpty(content as string) as Component
script.zs
// MutableComponent.nullToEmpty(content as string) as Component;
MutableComponent.nullToEmpty(myString);

Parameters:

content Type: string

Return Type: Component

plainCopy() as MutableComponent
script.zs
// MutableComponent.plainCopy() as MutableComponent;
myMutableComponent.plainCopy();

Return Type: MutableComponent

static score(name as string, objective as string) as MutableComponent
script.zs
// MutableComponent.score(name as string, objective as string) as MutableComponent;
MutableComponent.score(myString, myString);

Parameters:

name Type: string
objective Type: string

Return Type: MutableComponent

static selector(pattern as string, separator as Component = null) as MutableComponent
script.zs
// MutableComponent.selector(pattern as string, separator as Component = null) as MutableComponent;
MutableComponent.selector(myString, myComponent);

Parameters:

pattern Type: string
separator (optional) Type: Component

Default Value: null

Return Type: MutableComponent

setStyle(style as Style) as MutableComponent
script.zs
// MutableComponent.setStyle(style as Style) as MutableComponent;
myMutableComponent.setStyle(myStyle);

Parameters:

style Type: Style

Return Type: MutableComponent

Getter
script.zs
// MutableComponent.siblings as List<Component>
myMutableComponent.siblings

Return Type: List<Component>

siblings() as List<Component>
script.zs
// MutableComponent.siblings() as List<Component>;
myMutableComponent.siblings();

Return Type: List<Component>

Getter
script.zs
// MutableComponent.style as Style
myMutableComponent.style

Return Type: Style

style() as Style
script.zs
// MutableComponent.style() as Style;
myMutableComponent.style();

Return Type: Style

static translatable(content as string, args as string[]) as MutableComponent
script.zs
// MutableComponent.translatable(content as string, args as string[]) as MutableComponent;
MutableComponent.translatable(myString, myString[]);

Parameters:

content Type: string
args Type: string[]

Return Type: MutableComponent

static translatable(content as string, args as Component[]) as MutableComponent
script.zs
// MutableComponent.translatable(content as string, args as Component[]) as MutableComponent;
MutableComponent.translatable(myString, myComponent[]);

Parameters:

content Type: string
args Type: Component[]

Return Type: MutableComponent

withStyle(styleOperator as function(r as Style) as Style) as MutableComponent
script.zs
// MutableComponent.withStyle(styleOperator as function(r as Style) as Style) as MutableComponent;
myMutableComponent.withStyle(myFunction);

Parameters:

styleOperator Type: function(r as Style) as Style

Return Type: MutableComponent

withStyle(style as Style) as MutableComponent
script.zs
// MutableComponent.withStyle(style as Style) as MutableComponent;
myMutableComponent.withStyle(myStyle);

Parameters:

style Type: Style

Return Type: MutableComponent

withStyle(formatting as ChatFormatting[]) as MutableComponent
script.zs
// MutableComponent.withStyle(formatting as ChatFormatting[]) as MutableComponent;
myMutableComponent.withStyle(myChatFormatting[]);

Parameters:

formatting Type: ChatFormatting[]

Return Type: MutableComponent