A Tooltype is used to identify what kind of blocks a tool can mine, or inversely, what kind of tool is required to mine a given block.

This class was added by a mod with mod-id contenttweaker. 因此,如果要使用此功能,则需要安装此mod。

如果遇到任何问题(例如强制转换数组),则可能需要导入软件包,因此,最好的方式就是导入包支持。

ZenScript
Copy
mods.contenttweaker.item.MCToolType

已实现的接口

Link to 已实现的接口

MCToolType implements the following interfaces. 这意味着对这个接口可用的任何方法也可以在此类上使用。

Constructor #构造函数

Link to constructor-构造函数

Constructs a ToolType object. If one with the given name already exists, they will internally point to the same toolType. Otherwise, a new one with the name is created (The same holds true for Brackets as well!)

ZenScript
Copy
new mods.contenttweaker.item.MCToolType(name as String);
new mods.contenttweaker.item.MCToolType("pickaxe");
参数类型描述
参数
name(名称)
类型
字符串[string]
描述
The name to be used

Gets the name of this toolType. The name is what is used in the Bracket expression after the <tooltype:

Return type: String

ZenScript
Copy
<tooltype:pickaxe>.getName();

Returns the object's hash code

Return type: int

ZenScript
Copy
<tooltype:pickaxe>.hashCode();

Get the string representation of this type. Is different from commandString!

Return type: String

ZenScript
Copy
<tooltype:pickaxe>.toString();
名称类型可获得可设置
名称
commandString #命令字符串
类型
字符串[string]
可获得
true
可设置
false
名称
name(名称)
类型
字符串[string]
可获得
true
可设置
false

Compares if two given MCToolType objects are equal

ZenScript
Copy
<tooltype:pickaxe> == o as Object
<tooltype:pickaxe> == new MCToolType("pickaxe")
参数类型描述
参数
o
类型
Object
描述
The other object
结果类型是否隐藏
结果类型
字符串[string]
是否隐藏
false