Home Commands Examples Getting Started With Scripts Global Keywords

NameTagResult

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

Members

alwaysRender()
Forces the name tag to be visible even when it would otherwise not be.
script.zs
// NameTagResult.alwaysRender();
myNameTagResult.alwaysRender();
Getter
Gets the current content of the name tag. This can be changed by mods.
script.zs
// NameTagResult.content as Component
myNameTagResult.content

Return Type: Component

Setter
Sets the new content of the name tag.
script.zs
// NameTagResult.content = (content as Component);
myNameTagResult.content = myComponent;

Parameters:

content Type: Component - The new name tag contents.
content() as Component
Gets the current content of the name tag. This can be changed by mods.

Returns: The current name tag content.

script.zs
// NameTagResult.content() as Component;
myNameTagResult.content();

Return Type: Component

content(content as Component)
Sets the new content of the name tag.
script.zs
// NameTagResult.content(content as Component);
myNameTagResult.content(myComponent);

Parameters:

content Type: Component - The new name tag contents.
noRender()
Forces the display name to not render even when it should.
script.zs
// NameTagResult.noRender();
myNameTagResult.noRender();
Getter
Gets the original content of the name tag. This can not be changed by mods.
script.zs
// NameTagResult.originalContent as Component
myNameTagResult.originalContent

Return Type: Component

originalContent() as Component
Gets the original content of the name tag. This can not be changed by mods.

Returns: The original name tag content.

script.zs
// NameTagResult.originalContent() as Component;
myNameTagResult.originalContent();

Return Type: Component

setDefault()
Sets the default vanilla behaviour of rendering name tags.
script.zs
// NameTagResult.setDefault();
myNameTagResult.setDefault();