NameTagResult
Link to nametagresult
导入类
Link to 导入类
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.entity.NameTagResult;
使用方式
Link to 使用方式
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();
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 CopyNameTagResult.setContent(content as Component)
参数 | 类型 | 描述 |
---|---|---|
参数 内容 | 类型 Component | 描述 The new name tag contents. |
Name: setDefault
Sets the default vanilla behaviour of rendering name tags.
ZenScript Copy// NameTagResult.setDefault()
myNameTagResult.setDefault();
名称 | 类型 | 可获得 | 可设置 | 描述 |
---|---|---|---|---|
名称 内容 | 类型 Component | 可获得 true | 可设置 true | 描述 Gets the current content of the name tag. This can be changed by mods. |
名称 originalContent | 类型 Component | 可获得 true | 可设置 false | 描述 Gets the original content of the name tag. This can not be changed by mods. |