Diese Klasse importieren

Link to diese-klasse-importieren

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.entity.NameTagResult;

Name: alwaysRender

Forces the name tag to be visible even when it would otherwise not be.

ZenScript
Copy
// NameTagResult.alwaysRender()

myNameTagResult.alwaysRender();

Name: getContent

Gets the current content of the name tag. This can be changed by mods.

Returns: The current name tag content.
Return Type: Component

ZenScript
Copy
// NameTagResult.getContent() as Component

myNameTagResult.getContent();

Link to getOriginalContent

Name: getOriginalContent

Gets the original content of the name tag. This can not be changed by mods.

Returns: The original name tag content.
Return Type: Component

ZenScript
Copy
// NameTagResult.getOriginalContent() as Component

myNameTagResult.getOriginalContent();

Name: noRender

Forces the display name to not render even when it should.

ZenScript
Copy
// NameTagResult.noRender()

myNameTagResult.noRender();

Name: setContent

Sets the new content of the name tag.

ZenScript
Copy
NameTagResult.setContent(content as Component)
ParameterTypeBeschreibung
Parameter
inhalt
Type
Component
Beschreibung
The new name tag contents.

Name: setDefault

Sets the default vanilla behaviour of rendering name tags.

ZenScript
Copy
// NameTagResult.setDefault()

myNameTagResult.setDefault();
NameTypeHas GetterHas SetterBeschreibung
Name
inhalt
Type
Component
Has Getter
true
Has Setter
true
Beschreibung
Gets the current content of the name tag.
This can be changed by mods.
Name
originalContent
Type
Component
Has Getter
true
Has Setter
false
Beschreibung
Gets the original content of the name tag.
This can not be changed by mods.