Home Migration Guide Getting Started With Scripts Commands Examples
Generic JSON Recipes

ToolIngredient

An ingredient that matches any item with the given tool type.

This class was added by a mod with mod-id farmersdelight. So you need to have this mod installed if you want to use this feature.

Importing the class

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.

script.zs
import mods.farmersdelight.ToolIngredient;

Implemented Interfaces

ToolIngredient implements the following interfaces. That means all methods defined in these interfaces are also available in ToolIngredient

Static Methods

Get a tool ingredient from a tool type name.

Returns: The ingredient
Return Type: ToolIngredient

script.zs
<toolingredient:axe>
// ToolIngredient.getToolIngredient(type as string) as ToolIngredient
ToolIngredient.getToolIngredient("axe");
ParameterTypeDescription
Parameter
type
Type
string
Description
The name of the type

Get a tool ingredient from a tool type.

Returns: The ingredient
Return Type: ToolIngredient

script.zs
// ToolIngredient.getToolIngredient(type as ToolType) as ToolIngredient
ToolIngredient.getToolIngredient(<tooltype:axe>);
ParameterTypeDescription
Parameter
type
Type
ToolType
Description
The tool type

Casters

Result typeIs Implicit
Result type
IData
Is Implicit
true
Result type
MapData
Is Implicit
true

Methods

Return Type: void

script.zs
ToolIngredient.addGlobalAttributeModifier(attribute as Attribute, name as string, value as double, operation as AttributeOperation, slotTypes as MCEquipmentSlotType[]) as void
ParameterTypeDescription
Parameter
attribute
Type
Attribute
Description
No Description Provided
Parameter
name
Type
string
Description
No Description Provided
Parameter
value
Type
double
Description
No Description Provided
Parameter
operation
Type
AttributeOperation
Description
No Description Provided
Parameter
slotTypes
Type
MCEquipmentSlotType[]
Description
No Description Provided

Return Type: void

script.zs
ToolIngredient.addGlobalAttributeModifier(attribute as Attribute, uuid as string, name as string, value as double, operation as AttributeOperation, slotTypes as MCEquipmentSlotType[]) as void
ParameterTypeDescription
Parameter
attribute
Type
Attribute
Description
No Description Provided
Parameter
uuid
Type
string
Description
No Description Provided
Parameter
name
Type
string
Description
No Description Provided
Parameter
value
Type
double
Description
No Description Provided
Parameter
operation
Type
AttributeOperation
Description
No Description Provided
Parameter
slotTypes
Type
MCEquipmentSlotType[]
Description
No Description Provided

Return Type: void

script.zs
ToolIngredient.addShiftTooltip(arg0 as MCTextComponent, arg1 as MCTextComponent) as void
ParameterTypeDescriptionOptionalDefaultValue
Parameter
arg0
Type
MCTextComponent
Description
No Description Provided
Optional
false
DefaultValue
Parameter
arg1
Type
MCTextComponent
Description
No Description Provided
Optional
true
DefaultValue

Return Type: void

script.zs
ToolIngredient.addTooltip(content as MCTextComponent) as void
ParameterTypeDescription
Parameter
content
Type
MCTextComponent
Description
No Description Provided

Return Type: MCIngredientConditioned<IIngredient>

script.zs
// ToolIngredient.anyDamage() as MCIngredientConditioned<IIngredient>
myToolIngredient.anyDamage();

Return Type: void

script.zs
// ToolIngredient.clearTooltip() as void
myToolIngredient.clearTooltip();

Return Type: boolean

script.zs
ToolIngredient.contains(ingredient as IIngredient) as boolean
ParameterTypeDescription
Parameter
ingredient
Type
IIngredient
Description
No Description Provided

Return Type: IItemStack

script.zs
ToolIngredient.getRemainingItem(stack as IItemStack) as IItemStack
ParameterTypeDescription
Parameter
stack
Type
IItemStack
Description
No Description Provided

Return Type: boolean

script.zs
ToolIngredient.matches(stack as IItemStack) as boolean
ParameterTypeDescription
Parameter
stack
Type
IItemStack
Description
No Description Provided

Return Type: void

script.zs
ToolIngredient.modifyShiftTooltip(arg0 as ITooltipFunction, arg1 as ITooltipFunction) as void
ParameterTypeDescriptionOptionalDefaultValue
Parameter
arg0
Type
ITooltipFunction
Description
No Description Provided
Optional
false
DefaultValue
Parameter
arg1
Type
ITooltipFunction
Description
No Description Provided
Optional
true
DefaultValue

Return Type: void

script.zs
ToolIngredient.modifyTooltip(function as ITooltipFunction) as void
ParameterTypeDescription
Parameter
function
Type
ITooltipFunction
Description
No Description Provided

Return Type: MCIngredientConditioned<IIngredient>

script.zs
ToolIngredient.only(condition as IIngredientCondition<IIngredient>) as MCIngredientConditioned<IIngredient>
ParameterTypeDescription
Parameter
condition
Type
IIngredientCondition<IIngredient>
Description
No Description Provided

Return Type: MCIngredientConditioned<IIngredient>

script.zs
// ToolIngredient.onlyDamaged() as MCIngredientConditioned<IIngredient>
myToolIngredient.onlyDamaged();

Return Type: MCIngredientConditioned<IIngredient>

script.zs
ToolIngredient.onlyIf(arg0 as string, arg1 as Predicate<IItemStack>) as MCIngredientConditioned<IIngredient>
ParameterTypeDescriptionOptionalDefaultValue
Parameter
arg0
Type
string
Description
No Description Provided
Optional
false
DefaultValue
Parameter
arg1
Type
Predicate<IItemStack>
Description
No Description Provided
Optional
true
DefaultValue

Return Type: void

script.zs
ToolIngredient.removeGlobalAttribute(attribute as Attribute, slotTypes as MCEquipmentSlotType[]) as void
ParameterTypeDescription
Parameter
attribute
Type
Attribute
Description
No Description Provided
Parameter
slotTypes
Type
MCEquipmentSlotType[]
Description
No Description Provided

Return Type: void

script.zs
ToolIngredient.removeGlobalAttributeModifier(uuid as string, slotTypes as MCEquipmentSlotType[]) as void
ParameterTypeDescription
Parameter
uuid
Type
string
Description
No Description Provided
Parameter
slotTypes
Type
MCEquipmentSlotType[]
Description
No Description Provided

Return Type: void

script.zs
ToolIngredient.removeTooltip(regex as string) as void
ParameterTypeDescription
Parameter
regex
Type
string
Description
No Description Provided

Operators

script.zs
ingredient as IIngredient in myToolIngredient
script.zs
myToolIngredient | other as IIngredient

Properties

NameTypeHas GetterHas SetterDescription
Name
burnTime
Type
void
Has Getter
false
Has Setter
true
Description
No Description Provided