MCTag

这个类由mod-id为crafttweaker的模组添加. 因此,如果要使用此功能,则需要安装此mod。

导入相关包

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

crafttweaker.api.tag.MCTag

已实现的接口

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

方法

addBlocks

myMCTag.addBlocks(blocks as crafttweaker.api.block.MCBlock[]);
参数类型描述
blockscrafttweaker.api.block.MCBlock[]No description provided

addEntityTypes

myMCTag.addEntityTypes(entities as crafttweaker.api.entity.MCEntityType[]);
参数类型描述
entitiescrafttweaker.api.entity.MCEntityType[]No description provided

addItems

myMCTag.addItems(items as crafttweaker.api.item.IItemStack[]);
参数类型描述
itemscrafttweaker.api.item.IItemStack[]No description provided

createBlockTag

Returns crafttweaker.api.tag.MCTag

myMCTag.createBlockTag();

createEntityTypeTag

Returns crafttweaker.api.tag.MCTag

myMCTag.createEntityTypeTag();

createItemTag

Returns crafttweaker.api.tag.MCTag

myMCTag.createItemTag();

getRemainingItem

When this ingredient stack is crafted, what will remain in the grid? Does not check if the stack matches though! Used e.g. in CrT's net.minecraft.item.crafting.ICraftingRecipe

Returns crafttweaker.api.item.IItemStack

myMCTag.getRemainingItem(stack as crafttweaker.api.item.IItemStack);
myMCTag.getRemainingItem(<item:minecraft:iron_ingot>);
参数类型描述
stackcrafttweaker.api.item.IItemStackThe stack to provide for this ingredient.

matches

Does the given stack match the ingredient?

返回为布尔值

myMCTag.matches(stack as crafttweaker.api.item.IItemStack);
myMCTag.matches(<item:minecraft:iron_ingot>);
参数类型描述
stackcrafttweaker.api.item.IItemStackThe stack to check

removeBlocks

myMCTag.removeBlocks(blocks as crafttweaker.api.block.MCBlock[]);
参数类型描述
blockscrafttweaker.api.block.MCBlock[]No description provided

removeEntityTypes

myMCTag.removeEntityTypes(entities as crafttweaker.api.entity.MCEntityType[]);
参数类型描述
entitiescrafttweaker.api.entity.MCEntityType[]No description provided

removeItems

myMCTag.removeItems(items as crafttweaker.api.item.IItemStack[]);
参数类型描述
itemscrafttweaker.api.item.IItemStack[]No description provided

参数

名称类型可获得可设置
blockscrafttweaker.api.block.MCBlock[]truefalse
commandStringStringtruefalse
entityTypescrafttweaker.api.entity.MCEntityType[]truefalse
itemscrafttweaker.api.item.IItemStack[]truefalse

Casters