Home Migration Guide Getting Started With Scripts Commands Examples
BracketHandlers

NamePlateResult

Importing the class

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.

script.zs
import crafttweaker.api.entity.NamePlateResult;

Methods

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

Returns: The current nameplate content.
Return Type: MCTextComponent

script.zs
// NamePlateResult.getContent() as MCTextComponent
myNamePlateResult.getContent();

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

Returns: The original nameplate content.
Return Type: MCTextComponent

script.zs
// NamePlateResult.getOriginalContent() as MCTextComponent
myNamePlateResult.getOriginalContent();

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

Return Type: void

script.zs
// NamePlateResult.setAllow() as void
myNamePlateResult.setAllow();

Sets the new content of the nameplate.

Return Type: void

script.zs
NamePlateResult.setContent(content as MCTextComponent) as void
ParameterTypeDescription
Parameter
content
Type
MCTextComponent
Description
The new nameplate contents.

Sets the default vanilla behaviour of rendering nameplates.

Return Type: void

script.zs
// NamePlateResult.setDefault() as void
myNamePlateResult.setDefault();

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

Return Type: void

script.zs
// NamePlateResult.setDeny() as void
myNamePlateResult.setDeny();

Properties

NameTypeHas GetterHas SetterDescription
Name
content
Type
MCTextComponent
Has Getter
true
Has Setter
true
Description
Gets the current content of the nameplate.
This can be changed by mods.
Name
originalContent
Type
MCTextComponent
Has Getter
true
Has Setter
false
Description
Gets the original content of the nameplate.
This can not be changed by mods.