ToolIngredient
Link to toolingredient
An ingredient that matches any item with the given tool type.
This class was added by a mod with mod-id farmersdelight
. 因此,如果要使用此功能,则需要安装此mod。
导入类
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 mods.farmersdelight.ToolIngredient;
已实现的接口
Link to 已实现的接口
ToolIngredient implements the following interfaces. That means all methods defined in these interfaces are also available in ToolIngredient
Static Methods
Link to static-methods
Name: getToolIngredient
Get a tool ingredient from a tool type name.
Returns: The ingredient
Return Type: ToolIngredient
ZenScript Copy<toolingredient:axe>
// ToolIngredient.getToolIngredient(type as string) as ToolIngredient
ToolIngredient.getToolIngredient("axe");
参数 | 类型 | 描述 |
---|---|---|
参数 类型 | 类型 string | 描述 The name of the type |
Name: getToolIngredient
Get a tool ingredient from a tool type.
Returns: The ingredient
Return Type: ToolIngredient
ZenScript Copy// ToolIngredient.getToolIngredient(type as ToolType) as ToolIngredient
ToolIngredient.getToolIngredient(<tooltype:axe>);
参数 | 类型 | 描述 |
---|---|---|
参数 类型 | 类型 ToolType | 描述 The tool type |
Casters
Link to casters
结果类型 | 是否隐藏 |
---|---|
结果类型 IData #数据 | 是否隐藏 true |
结果类型 MapData #地图数据 | 是否隐藏 true |
使用方式
Link to 使用方式
Name: addGlobalAttributeModifier
Return Type: void
ZenScript CopyToolIngredient.addGlobalAttributeModifier(attribute as Attribute, name as string, value as double, operation as AttributeOperation, slotTypes as MCEquipmentSlotType[]) as void
参数 | 类型 | 描述 |
---|---|---|
参数 attribute | 类型 Attribute | 描述 No Description Provided |
参数 name(名称) | 类型 string | 描述 No Description Provided |
参数 value | 类型 double | 描述 No Description Provided |
参数 operation | 类型 AttributeOperation | 描述 No Description Provided |
参数 slotTypes | 类型 MCEquipmentSlotType[] | 描述 No Description Provided |
Name: addGlobalAttributeModifier
Return Type: void
ZenScript CopyToolIngredient.addGlobalAttributeModifier(attribute as Attribute, uuid as string, name as string, value as double, operation as AttributeOperation, slotTypes as MCEquipmentSlotType[]) as void
参数 | 类型 | 描述 |
---|---|---|
参数 attribute | 类型 Attribute | 描述 No Description Provided |
参数 uuid | 类型 string | 描述 No Description Provided |
参数 name(名称) | 类型 string | 描述 No Description Provided |
参数 value | 类型 double | 描述 No Description Provided |
参数 operation | 类型 AttributeOperation | 描述 No Description Provided |
参数 slotTypes | 类型 MCEquipmentSlotType[] | 描述 No Description Provided |
Name: addTooltip
Return Type: void
ZenScript CopyToolIngredient.addTooltip(content as MCTextComponent) as void
参数 | 类型 | 描述 |
---|---|---|
参数 内容 | 类型 MCText组件 | 描述 No Description Provided |
Name: anyDamage
Return Type: MCIngredientConditioned<IIngredient>
ZenScript Copy// ToolIngredient.anyDamage() as MCIngredientConditioned<IIngredient>
myToolIngredient.anyDamage();
Name: clearTooltip
Return Type: void
ZenScript Copy// ToolIngredient.clearTooltip() as void
myToolIngredient.clearTooltip();
Name: contains
Return Type: boolean
ZenScript CopyToolIngredient.contains(ingredient as IIngredient) as boolean
参数 | 类型 | 描述 |
---|---|---|
参数 ingredient | 类型 材料(IIngredient) | 描述 No Description Provided |
Name: getRemainingItem
Return Type: IItemStack
ZenScript CopyToolIngredient.getRemainingItem(stack as IItemStack) as IItemStack
参数 | 类型 | 描述 |
---|---|---|
参数 堆叠 | 类型 IItemstack | 描述 No Description Provided |
Name: matches
Return Type: boolean
ZenScript CopyToolIngredient.matches(stack as IItemStack) as boolean
参数 | 类型 | 描述 |
---|---|---|
参数 堆叠 | 类型 IItemstack | 描述 No Description Provided |
Name: modifyShiftTooltip
Return Type: void
ZenScript CopyToolIngredient.modifyShiftTooltip(arg0 as ITooltipFunction, arg1 as ITooltipFunction) as void
参数 | 类型 | 描述 | 可选 | DefaultValue |
---|---|---|---|---|
参数 arg0 | 类型 ITooltipFunction | 描述 No Description Provided | 可选 false | DefaultValue |
参数 arg1 | 类型 ITooltipFunction | 描述 No Description Provided | 可选 true | DefaultValue |
Name: modifyTooltip
Return Type: void
ZenScript CopyToolIngredient.modifyTooltip(function as ITooltipFunction) as void
参数 | 类型 | 描述 |
---|---|---|
参数 function | 类型 ITooltipFunction | 描述 No Description Provided |
Name: only
Return Type: MCIngredientConditioned<IIngredient>
ZenScript CopyToolIngredient.only(condition as IIngredientCondition<IIngredient>) as MCIngredientConditioned<IIngredient>
参数 | 类型 | 描述 |
---|---|---|
参数 condition | 类型 IIngredientCondition<IIngredient> | 描述 No Description Provided |
Name: onlyDamaged
Return Type: MCIngredientConditioned<IIngredient>
ZenScript Copy// ToolIngredient.onlyDamaged() as MCIngredientConditioned<IIngredient>
myToolIngredient.onlyDamaged();
Name: onlyIf
Return Type: MCIngredientConditioned<IIngredient>
ZenScript CopyToolIngredient.onlyIf(arg0 as string, arg1 as Predicate<IItemStack>) as MCIngredientConditioned<IIngredient>
参数 | 类型 | 描述 | 可选 | DefaultValue |
---|---|---|---|---|
参数 arg0 | 类型 string | 描述 No Description Provided | 可选 false | DefaultValue |
参数 arg1 | 类型 Predicate<IItemStack> | 描述 No Description Provided | 可选 true | DefaultValue |
Name: removeGlobalAttribute
Return Type: void
ZenScript CopyToolIngredient.removeGlobalAttribute(attribute as Attribute, slotTypes as MCEquipmentSlotType[]) as void
参数 | 类型 | 描述 |
---|---|---|
参数 attribute | 类型 Attribute | 描述 No Description Provided |
参数 slotTypes | 类型 MCEquipmentSlotType[] | 描述 No Description Provided |
Name: removeGlobalAttributeModifier
Return Type: void
ZenScript CopyToolIngredient.removeGlobalAttributeModifier(uuid as string, slotTypes as MCEquipmentSlotType[]) as void
参数 | 类型 | 描述 |
---|---|---|
参数 uuid | 类型 string | 描述 No Description Provided |
参数 slotTypes | 类型 MCEquipmentSlotType[] | 描述 No Description Provided |
Name: removeTooltip
Return Type: void
ZenScript CopyToolIngredient.removeTooltip(regex as string) as void
参数 | 类型 | 描述 |
---|---|---|
参数 regex | 类型 string | 描述 No Description Provided |
运算符
Link to 运算符
Name: CONTAINS
ZenScript Copyingredient as IIngredient in myToolIngredient
Name: OR
ZenScript CopymyToolIngredient | other as IIngredient
名称 | 类型 | 可获得 | 可设置 | 描述 |
---|---|---|---|---|
名称 burnTime | 类型 void | 可获得 false | 可设置 true | 描述 No Description Provided |