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

Link to g-createstringtextcomponent

Name: createStringTextComponent

Return Type: MCTextComponent

ZenScript
Copy
MCTextComponent.createStringTextComponent(text as string) as MCTextComponent
参数类型描述
参数
文本
类型
string
描述
No Description Provided

Link to g-createtranslationtextcomponent

Name: createTranslationTextComponent

Return Type: MCTextComponent

ZenScript
Copy
MCTextComponent.createTranslationTextComponent(translationKey as string) as MCTextComponent
参数类型描述
参数
translationKey
类型
string
描述
No Description Provided

Link to g-createtranslationtextcomponent-1

Name: createTranslationTextComponent

Return Type: MCTextComponent

ZenScript
Copy
MCTextComponent.createTranslationTextComponent(translationKey as string, args as Object[]) as MCTextComponent
参数类型描述
参数
translationKey
类型
string
描述
No Description Provided
参数
args
类型
Object[]
描述
No Description Provided
结果类型是否隐藏
结果类型
string
是否隐藏
false

Name: appendSibling

Return Type: MCTextComponent

ZenScript
Copy
MCTextComponent.appendSibling(component as MCTextComponent) as MCTextComponent
参数类型描述
参数
component
类型
MCText组件
描述
No Description Provided

Name: appendText

Return Type: MCTextComponent

ZenScript
Copy
MCTextComponent.appendText(text as string) as MCTextComponent
参数类型描述
参数
文本
类型
string
描述
No Description Provided

Name: copyRaw

Return Type: MCTextComponent

ZenScript
Copy
// MCTextComponent.copyRaw() as MCTextComponent

myMCTextComponent.copyRaw();

Name: deepCopy

Return Type: MCTextComponent

ZenScript
Copy
// MCTextComponent.deepCopy() as MCTextComponent

myMCTextComponent.deepCopy();

Name: getString

Return Type: string

ZenScript
Copy
// MCTextComponent.getString() as string

myMCTextComponent.getString();

Name: getStringTruncated

Return Type: string

ZenScript
Copy
MCTextComponent.getStringTruncated(maxLen as int) as string
参数类型描述
参数
maxLen
类型
int
描述
No Description Provided

Name: getStyle

Return Type: MCStyle

ZenScript
Copy
// MCTextComponent.getStyle() as MCStyle

myMCTextComponent.getStyle();

Link to g-getunformattedcomponenttext

Name: getUnformattedComponentText

Return Type: string

ZenScript
Copy
// MCTextComponent.getUnformattedComponentText() as string

myMCTextComponent.getUnformattedComponentText();

Name: setStyle

Return Type: MCTextComponent

ZenScript
Copy
MCTextComponent.setStyle(style as MCStyle) as MCTextComponent
参数类型描述
参数
样式
类型
MC样式
描述
No Description Provided

Name: ADD

ZenScript
Copy
myMCTextComponent + component as MCTextComponent

Name: CAT

ZenScript
Copy
myMCTextComponent ~ component as MCTextComponent

Name: SHL

ZenScript
Copy
myMCTextComponent << component as MCTextComponent
名称类型可获得可设置描述
名称
formattedText
类型
string
可获得
true
可设置
false
描述
No Description Provided
名称
siblings
类型
stdlib.List<MCTextComponent>
可获得
true
可设置
false
描述
No Description Provided
名称
样式
类型
MC样式
可获得
true
可设置
false
描述
No Description Provided
名称
unformattedComponentText
类型
string
可获得
true
可设置
false
描述
No Description Provided