MCItemDefinition

Link to mcitemdefinition

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.item.MCItemDefinition;
结果类型是否隐藏
结果类型
IItemstack
是否隐藏
true

Link to getDefaultInstance

Name: getDefaultInstance

Return Type: IItemStack

ZenScript
Copy
// MCItemDefinition.getDefaultInstance() as IItemStack

myMCItemDefinition.getDefaultInstance();

Name: getTags

Gets the tags that contain this item.

Returns: a list of tags that contain this item.
Return Type: stdlib.List<MCTag<MCItemDefinition>>

ZenScript
Copy
// MCItemDefinition.getTags() as stdlib.List<MCTag<MCItemDefinition>>

myMCItemDefinition.getTags();

Name: isIn

Checks if this item is in the given tag.

Returns: True if the tag contains this item.
Return Type: boolean

ZenScript
Copy
// MCItemDefinition.isIn(tag as MCTag<MCItemDefinition>) as boolean

myMCItemDefinition.isIn(<tag:items:minecraft:wool>);
参数类型描述
参数
tag #标签
类型
MCTag<MCItemDefinition>
描述
The tag to check against.
名称类型可获得可设置描述
名称
commandString #命令字符串
类型
string
可获得
true
可设置
false
描述
No Description Provided
名称
defaultInstance
类型
IItemstack
可获得
true
可设置
false
描述
No Description Provided