ItemStackIngredient

Link to itemstackingredient

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

Importing the class

Link to 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.

ZenScript
Copy
import mods.mekanism.api.ingredient.ItemStackIngredient;

Name: createMulti

Combines multiple ItemStackIngredients into a single ItemStackIngredient.

Returns: A single ItemStackIngredient representing all the passed in ingredients.
Return Type: ItemStackIngredient

ZenScript
Copy
ItemStackIngredient.createMulti(ingredients as ItemStackIngredient[]) as ItemStackIngredient
ParameterTypeDescription
Parameter
ingredients
Type
ItemStackIngredient[]
Description
Ingredients to combine

Name: from

Creates a ItemStackIngredient that matches a given ingredient with an amount of one.

Returns: A ItemStackIngredient that matches a given ingredient with an amount of one.
Return Type: ItemStackIngredient

ZenScript
Copy
ItemStackIngredient.from(ingredient as IIngredient) as ItemStackIngredient
ParameterTypeDescription
Parameter
ingredient
Type
IIngredient
Description
Ingredient to match

Name: from

Creates a ItemStackIngredient that matches a given ingredient with amount.

Returns: A ItemStackIngredient that matches a given ingredient with amount.
Return Type: ItemStackIngredient

ZenScript
Copy
ItemStackIngredient.from(ingredient as IIngredientWithAmount) as ItemStackIngredient
ParameterTypeDescription
Parameter
ingredient
Type
IIngredientWithAmount
Description
Ingredient and amount to match

Name: from

Creates a ItemStackIngredient out of all the ingredients in the given IngredientList.

Returns: A ItemStackIngredient made up of all the ingredients in the given IngredientList.
Return Type: ItemStackIngredient

ZenScript
Copy
ItemStackIngredient.from(ingredientList as IngredientList) as ItemStackIngredient
ParameterTypeDescription
Parameter
ingredientList
Type
IngredientList
Description
Ingredients to match

Name: from

Creates a ItemStackIngredient that matches a given item with an amount of one.

Returns: A ItemStackIngredient that matches a given item with an amount of one.
Return Type: ItemStackIngredient

ZenScript
Copy
ItemStackIngredient.from(item as MCItemDefinition) as ItemStackIngredient
ParameterTypeDescription
Parameter
item
Type
MCItemDefinition
Description
Item to match

Name: from

Creates a ItemStackIngredient that matches a given item tag with an amount of one.

Returns: A ItemStackIngredient that matches a given item tag with an amount of one.
Return Type: ItemStackIngredient

ZenScript
Copy
ItemStackIngredient.from(itemTag as MCTag<MCItemDefinition>) as ItemStackIngredient
ParameterTypeDescription
Parameter
itemTag
Type
MCTag<MCItemDefinition>
Description
Tag to match

Name: from

Creates a ItemStackIngredient that matches a given item tag with amount.

Returns: A ItemStackIngredient that matches a given item tag with amount.
Return Type: ItemStackIngredient

ZenScript
Copy
ItemStackIngredient.from(itemTag as MCTagWithAmount<MCItemDefinition>) as ItemStackIngredient
ParameterTypeDescription
Parameter
itemTag
Type
MCTagWithAmount<MCItemDefinition>
Description
Tag and amount to match

Name: from

Creates a ItemStackIngredient that matches a given item stack.

Returns: A ItemStackIngredient that matches a given item stack.
Return Type: ItemStackIngredient

ZenScript
Copy
ItemStackIngredient.from(stack as IItemStack) as ItemStackIngredient
ParameterTypeDescription
Parameter
stack
Type
IItemStack
Description
Item stack to match

Name: from

Creates a ItemStackIngredient that matches a given ingredient and amount.

Returns: A ItemStackIngredient that matches a given ingredient and amount.
Return Type: ItemStackIngredient

ZenScript
Copy
ItemStackIngredient.from(ingredient as IIngredient, amount as int) as ItemStackIngredient
ParameterTypeDescription
Parameter
ingredient
Type
IIngredient
Description
Ingredient to match
Parameter
amount
Type
int
Description
Amount needed

Name: from

Creates a ItemStackIngredient that matches a given item and amount.

Returns: A ItemStackIngredient that matches a given item and amount.
Return Type: ItemStackIngredient

ZenScript
Copy
ItemStackIngredient.from(item as MCItemDefinition, amount as int) as ItemStackIngredient
ParameterTypeDescription
Parameter
item
Type
MCItemDefinition
Description
Item to match
Parameter
amount
Type
int
Description
Amount needed

Name: from

Creates a ItemStackIngredient that matches a given item tag with a given amount.

Returns: A ItemStackIngredient that matches a given item tag with a given amount.
Return Type: ItemStackIngredient

ZenScript
Copy
ItemStackIngredient.from(itemTag as MCTag<MCItemDefinition>, amount as int) as ItemStackIngredient
ParameterTypeDescription
Parameter
itemTag
Type
MCTag<MCItemDefinition>
Description
Tag to match
Parameter
amount
Type
int
Description
Amount needed
Result typeIs Implicit
Result type
IData
Is Implicit
true

Name: asIData

Converts this ItemStackIngredient into JSON (IData).

Returns: ItemStackIngredient as JSON.
Return Type: IData

ZenScript
Copy
// ItemStackIngredient.asIData() as IData

myItemStackIngredient.asIData();

Name: or

OR's this ItemStackIngredient with another ItemStackIngredient to create a multi ItemStackIngredient

Returns: Multi ItemStackIngredient that matches both the source ItemStackIngredient and the OR'd ItemStackIngredient.
Return Type: ItemStackIngredient

ZenScript
Copy
ItemStackIngredient.or(other as ItemStackIngredient) as ItemStackIngredient
ParameterTypeDescription
Parameter
other
Type
ItemStackIngredient
Description
ItemStackIngredient to combine with.

Name: OR

Returns a new ItemStackIngredient using the two ItemStackIngredient as a base.

ZenScript
Copy
(ing1 as ItemStackIngredient) | (ing2 as ItemStackIngredient);