MCTextComponent
Link to mctextcomponent
Importare la Classe
Link to importare-la-classe
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 Copyimport crafttweaker.api.util.text.MCTextComponent;
Static Methods
Link to static-methods
Name: createStringTextComponent
Return Type: MCTextComponent
ZenScript CopyMCTextComponent.createStringTextComponent(text as string) as MCTextComponent
Parametro | Tipo | Descrizione |
---|---|---|
Parametro testo | Tipo string | Descrizione No Description Provided |
Name: createTranslationTextComponent
Return Type: MCTextComponent
ZenScript CopyMCTextComponent.createTranslationTextComponent(translationKey as string) as MCTextComponent
Parametro | Tipo | Descrizione |
---|---|---|
Parametro translationKey | Tipo string | Descrizione No Description Provided |
Name: createTranslationTextComponent
Return Type: MCTextComponent
ZenScript CopyMCTextComponent.createTranslationTextComponent(translationKey as string, args as Object[]) as MCTextComponent
Parametro | Tipo | Descrizione |
---|---|---|
Parametro translationKey | Tipo string | Descrizione No Description Provided |
Parametro args | Tipo Object[] | Descrizione No Description Provided |
Caster
Link to caster
Tipo Risultato | Implicito |
---|---|
Tipo Risultato string | Implicito no |
Metodi
Link to metodi
Name: appendSibling
Return Type: MCTextComponent
ZenScript CopyMCTextComponent.appendSibling(component as MCTextComponent) as MCTextComponent
Parametro | Tipo | Descrizione |
---|---|---|
Parametro component | Tipo MCTextComponent | Descrizione No Description Provided |
Name: appendText
Return Type: MCTextComponent
ZenScript CopyMCTextComponent.appendText(text as string) as MCTextComponent
Parametro | Tipo | Descrizione |
---|---|---|
Parametro testo | Tipo string | Descrizione No Description Provided |
Name: copyRaw
Return Type: MCTextComponent
ZenScript Copy// MCTextComponent.copyRaw() as MCTextComponent
MCTextComponent.createStringTextComponent("Hello World!").copyRaw();
Name: deepCopy
Return Type: MCTextComponent
ZenScript Copy// MCTextComponent.deepCopy() as MCTextComponent
MCTextComponent.createStringTextComponent("Hello World!").deepCopy();
Name: getString
Return Type: string
ZenScript Copy// MCTextComponent.getString() as string
MCTextComponent.createStringTextComponent("Hello World!").getString();
Name: getStringTruncated
Return Type: string
ZenScript CopyMCTextComponent.getStringTruncated(maxLen as int) as string
Parametro | Tipo | Descrizione |
---|---|---|
Parametro maxLen | Tipo int | Descrizione No Description Provided |
Name: getStyle
Return Type: MCStyle
ZenScript Copy// MCTextComponent.getStyle() as MCStyle
MCTextComponent.createStringTextComponent("Hello World!").getStyle();
Name: getTranslationKey
If this is a Translation Text Component, return the actual translation key used for localization. If this is not a Translation Text Component, returns an empty string.
Returns: the translation key or an empty string.
Return Type: string
ZenScript Copy// MCTextComponent.getTranslationKey() as string
MCTextComponent.createStringTextComponent("Hello World!").getTranslationKey();
Name: getUnformattedComponentText
Return Type: string
ZenScript Copy// MCTextComponent.getUnformattedComponentText() as string
MCTextComponent.createStringTextComponent("Hello World!").getUnformattedComponentText();
Name: setStyle
Return Type: MCTextComponent
ZenScript CopyMCTextComponent.setStyle(style as MCStyle) as MCTextComponent
Parametro | Tipo | Descrizione |
---|---|---|
Parametro stile | Tipo MCStyle | Descrizione No Description Provided |
Operators
Link to operators
Name: ADD
ZenScript CopymyMCTextComponent + component as MCTextComponent
Name: CAT
ZenScript CopymyMCTextComponent ~ component as MCTextComponent
Name: SHL
ZenScript CopymyMCTextComponent << component as MCTextComponent
Proprietà
Link to proprietà
Nome | Tipo | Ha Getter | Ha Setter | Descrizione |
---|---|---|---|---|
Nome formattedText | Tipo string | Ha Getter sì | Ha Setter no | Descrizione No Description Provided |
Nome siblings | Tipo stdlib.List<MCTextComponent> | Ha Getter sì | Ha Setter no | Descrizione No Description Provided |
Nome stile | Tipo MCStyle | Ha Getter sì | Ha Setter no | Descrizione No Description Provided |
Nome translationKey | Tipo string | Ha Getter sì | Ha Setter no | Descrizione If this is a Translation Text Component, return the actual translation key used for localization. If this is not a Translation Text Component, returns an empty string. |
Nome unformattedComponentText | Tipo string | Ha Getter sì | Ha Setter no | Descrizione No Description Provided |