Home Commands Examples Getting Started With Scripts Global Keywords
Generic Recipe Manipulation

ToolActionIngredient

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.ToolActionIngredient;

Implemented Interfaces

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

Casters

Result TypeIs Implicit
Result Type
IData
Is Implicit
true
Result Type
IIngredientWithAmount
Is Implicit
true
Result Type
MapData
Is Implicit
true

Methods

script.zs
ToolActionIngredient.addGlobalAttributeModifier(attribute as Attribute, name as string, value as double, operation as AttributeOperation, slotTypes as EquipmentSlot[])
ParameterType
Parameter
attribute
Type
Attribute
Parameter
name
Type
string
Parameter
value
Type
double
Parameter
operation
Type
AttributeOperation
Parameter
slotTypes
Type
EquipmentSlot[]
script.zs
ToolActionIngredient.addGlobalAttributeModifier(attribute as Attribute, uuid as invalid, name as string, value as double, operation as AttributeOperation, slotTypes as EquipmentSlot[])
ParameterType
Parameter
attribute
Type
Attribute
Parameter
uuid
Type
invalid
Parameter
name
Type
string
Parameter
value
Type
double
Parameter
operation
Type
AttributeOperation
Parameter
slotTypes
Type
EquipmentSlot[]
script.zs
ToolActionIngredient.addGlobalAttributeModifier(attribute as Attribute, uuid as string, name as string, value as double, operation as AttributeOperation, slotTypes as EquipmentSlot[])
ParameterType
Parameter
attribute
Type
Attribute
Parameter
uuid
Type
string
Parameter
name
Type
string
Parameter
value
Type
double
Parameter
operation
Type
AttributeOperation
Parameter
slotTypes
Type
EquipmentSlot[]
script.zs
ToolActionIngredient.addShiftTooltip(content as Component, showMessage as Component)
ParameterTypeOptional
Parameter
content
Type
Component
Optional
false
Parameter
showMessage
Type
Component
Optional
true
script.zs
ToolActionIngredient.addTooltip(content as Component)
ParameterType
Parameter
content
Type
Component

Return Type: IngredientConditioned<IIngredient>

script.zs
// ToolActionIngredient.anyDamage() as IngredientConditioned<IIngredient>
myToolActionIngredient.anyDamage();

Return Type: IIngredientWithAmount

script.zs
// ToolActionIngredient.asIIngredientWithAmount() as IIngredientWithAmount
myToolActionIngredient.asIIngredientWithAmount();
script.zs
ToolActionIngredient.clearTooltip(leaveName as boolean)
ParameterTypeOptionalDefault Value
Parameter
leaveName
Type
boolean
Optional
true
Default Value
false

Return Type: boolean

script.zs
ToolActionIngredient.contains(ingredient as IIngredient) as boolean
ParameterType
Parameter
ingredient
Type
IIngredient

Return Type: IItemStack

script.zs
ToolActionIngredient.getRemainingItem(stack as IItemStack) as IItemStack
ParameterType
Parameter
stack
Type
IItemStack

Return Type: boolean

script.zs
// ToolActionIngredient.isEmpty() as boolean
myToolActionIngredient.isEmpty();

Return Type: boolean

script.zs
ToolActionIngredient.matches(stack as IItemStack) as boolean
ParameterType
Parameter
stack
Type
IItemStack
script.zs
ToolActionIngredient.modifyShiftTooltip(shiftedFunction as ITooltipFunction, unshiftedFunction as ITooltipFunction)
ParameterTypeOptional
Parameter
shiftedFunction
Type
ITooltipFunction
Optional
false
Parameter
unshiftedFunction
Type
ITooltipFunction
Optional
true
script.zs
ToolActionIngredient.modifyTooltip(function as ITooltipFunction)
ParameterType
Parameter
function
Type
ITooltipFunction

Return Type: IIngredientWithAmount

script.zs
ToolActionIngredient.mul(amount as int) as IIngredientWithAmount
ParameterType
Parameter
amount
Type
int

Return Type: IngredientConditioned<IIngredient>

script.zs
ToolActionIngredient.only(condition as IIngredientCondition<IIngredient>) as IngredientConditioned<IIngredient>
ParameterType
Parameter
condition
Type
IIngredientCondition<IIngredient>

Return Type: IngredientConditioned<IIngredient>

script.zs
// ToolActionIngredient.onlyDamaged() as IngredientConditioned<IIngredient>
myToolActionIngredient.onlyDamaged();

Return Type: IngredientConditioned<IIngredient>

script.zs
ToolActionIngredient.onlyDamagedAtLeast(minDamage as int) as IngredientConditioned<IIngredient>
ParameterType
Parameter
minDamage
Type
int

Return Type: IngredientConditioned<IIngredient>

script.zs
ToolActionIngredient.onlyDamagedAtMost(maxDamage as int) as IngredientConditioned<IIngredient>
ParameterType
Parameter
maxDamage
Type
int

Return Type: IngredientConditioned<IIngredient>

script.zs
ToolActionIngredient.onlyIf(uid as string, function as Predicate<IItemStack>) as IngredientConditioned<IIngredient>
ParameterTypeOptional
Parameter
uid
Type
string
Optional
false
Parameter
function
Type
Predicate<IItemStack>
Optional
true
script.zs
ToolActionIngredient.removeGlobalAttribute(attribute as Attribute, slotTypes as EquipmentSlot[])
ParameterType
Parameter
attribute
Type
Attribute
Parameter
slotTypes
Type
EquipmentSlot[]
script.zs
ToolActionIngredient.removeGlobalAttributeModifier(uuid as invalid, slotTypes as EquipmentSlot[])
ParameterType
Parameter
uuid
Type
invalid
Parameter
slotTypes
Type
EquipmentSlot[]
script.zs
ToolActionIngredient.removeGlobalAttributeModifier(uuid as string, slotTypes as EquipmentSlot[])
ParameterType
Parameter
uuid
Type
string
Parameter
slotTypes
Type
EquipmentSlot[]
script.zs
ToolActionIngredient.removeTooltip(regex as string)
ParameterType
Parameter
regex
Type
string

Return Type: IIngredientTransformed<IIngredient>

script.zs
// ToolActionIngredient.reuse() as IIngredientTransformed<IIngredient>
myToolActionIngredient.reuse();
script.zs
ToolActionIngredient.setBurnTime(time as int)
ParameterType
Parameter
time
Type
int

Return Type: IIngredientTransformed<IIngredient>

script.zs
ToolActionIngredient.transform(transformer as IIngredientTransformer<IIngredient>) as IIngredientTransformed<IIngredient>
ParameterType
Parameter
transformer
Type
IIngredientTransformer<IIngredient>

Return Type: IIngredientTransformed<IIngredient>

script.zs
ToolActionIngredient.transformCustom(uid as string, function as Function<IItemStack,IItemStack>) as IIngredientTransformed<IIngredient>
ParameterTypeOptional
Parameter
uid
Type
string
Optional
false
Parameter
function
Type
Function<IItemStack,IItemStack>
Optional
true

Return Type: IIngredientTransformed<IIngredient>

script.zs
ToolActionIngredient.transformDamage(amount as int) as IIngredientTransformed<IIngredient>
ParameterTypeOptionalDefault Value
Parameter
amount
Type
int
Optional
true
Default Value
1

Return Type: IIngredientTransformed<IIngredient>

script.zs
ToolActionIngredient.transformReplace(replaceWith as IItemStack) as IIngredientTransformed<IIngredient>
ParameterType
Parameter
replaceWith
Type
IItemStack

Operators

script.zs
ingredient as IIngredient in myToolActionIngredient
script.zs
myToolActionIngredient * amount as int
script.zs
myToolActionIngredient | other as IIngredient

Properties

NameTypeHas GetterHas Setter
Name
burnTime
Type
void
Has Getter
false
Has Setter
true
Name
empty
Type
boolean
Has Getter
true
Has Setter
false