IIngredientAny
An IIngredient which matches all items
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.
import crafttweaker.api.ingredient.type.IIngredientAny;Implemented Interfaces
IIngredientAny implements the following interfaces. That means all methods defined in these interfaces are also available in IIngredientAny
Enum Constants
IIngredientAny is an enum. It has 1 enum constants. They are accessible using the code below.
IIngredientAny.INSTANCEStatic Methods
Return Type: IIngredientAny
// IIngredientAny.getInstance() as IIngredientAny
IIngredientAny.getInstance();Casters
| Result type | Is Implicit | 
|---|---|
| Result typeIData | Is Implicittrue | 
| Result typeIIngredientWithAmount | Is Implicittrue | 
| Result typeMapData | Is Implicittrue | 
Methods
Adds an AttributeModifier to this IIngredient.
Attributes added with this method appear on all ItemStacks that match this IIngredient, regardless of how or when the ItemStack was made, if you want to have the attribute on a single specific ItemStack (such as a specific Diamond Sword made in a recipe), then you should use IItemStack#withAttributeModifier
Return Type: void
// IIngredientAny.addGlobalAttributeModifier(attribute as Attribute, name as string, value as double, operation as AttributeOperation, slotTypes as EquipmentSlot[]) as void
IIngredientAny.getInstance().addGlobalAttributeModifier(<attribute:minecraft:generic.attack_damage>, "Extra Power", 10, AttributeOperation.ADDITION, [<equipmentslot:chest>]);| Parameter | Type | Description | 
|---|---|---|
| Parameterattribute | TypeAttribute | DescriptionThe Attribute of the modifier. | 
| Parametername | Typestring | DescriptionThe name of the modifier. | 
| Parametervalue | Typedouble | DescriptionThe value of the modifier. | 
| Parameteroperation | TypeAttributeOperation | DescriptionThe operation of the modifier. | 
| ParameterslotTypes | TypeEquipmentSlot[] | DescriptionWhat slots the modifier is valid for. | 
Adds an AttributeModifier to this IIngredient using a specific UUID.
The UUID can be used to override an existing attribute on an ItemStack with this new modifier.
You can use /ct hand attributes to get the UUID of the attributes on an ItemStack.
Attributes added with this method appear on all ItemStacks that match this IIngredient, regardless of how or when the ItemStack was made, if you want to have the attribute on a single specific ItemStack (such as a specific Diamond Sword made in a recipe), then you should use IItemStack#withAttributeModifier
Return Type: void
// IIngredientAny.addGlobalAttributeModifier(attribute as Attribute, uuid as string, name as string, value as double, operation as AttributeOperation, slotTypes as EquipmentSlot[]) as void
IIngredientAny.getInstance().addGlobalAttributeModifier(<attribute:minecraft:generic.attack_damage>, "8c1b5535-9f79-448b-87ae-52d81480aaa3", "Extra Power", 10, AttributeOperation.ADDITION, [<equipmentslot:chest>]);| Parameter | Type | Description | 
|---|---|---|
| Parameterattribute | TypeAttribute | DescriptionThe Attribute of the modifier. | 
| Parameteruuid | Typestring | DescriptionThe unique identifier of the modifier to replace. | 
| Parametername | Typestring | DescriptionThe name of the modifier. | 
| Parametervalue | Typedouble | DescriptionThe value of the modifier. | 
| Parameteroperation | TypeAttributeOperation | DescriptionThe operation of the modifier. | 
| ParameterslotTypes | TypeEquipmentSlot[] | DescriptionWhat slots the modifier is valid for. | 
Return Type: void
IIngredientAny.addShiftTooltip(content as Component, showMessage as Component) as void| Parameter | Type | Description | Optional | DefaultValue | 
|---|---|---|---|---|
| Parametercontent | TypeComponent | DescriptionNo Description Provided | Optionalfalse | DefaultValue | 
| ParametershowMessage | TypeComponent | DescriptionNo Description Provided | Optionaltrue | DefaultValue | 
Return Type: void
IIngredientAny.addTooltip(content as Component) as void| Parameter | Type | Description | 
|---|---|---|
| Parametercontent | TypeComponent | DescriptionNo Description Provided | 
Return Type: IngredientConditioned<IIngredient>
// IIngredientAny.anyDamage() as IngredientConditioned<IIngredient>
IIngredientAny.getInstance().anyDamage();Used implicitly when a machine can accept more than one item but you only provide one.
Return Type: IIngredientWithAmount
// IIngredientAny.asIIngredientWithAmount() as IIngredientWithAmount
IIngredientAny.getInstance().asIIngredientWithAmount();Return Type: void
// IIngredientAny.clearTooltip() as void
IIngredientAny.getInstance().clearTooltip();Does the ingredient contain the given ingredient?
Return Type: boolean
// IIngredientAny.contains(ingredient as IIngredient) as boolean
IIngredientAny.getInstance().contains((<item:minecraft:iron_ingot> | <item:minecraft:gold_ingot>));| Parameter | Type | Description | 
|---|---|---|
| Parameteringredient | TypeIIngredient | DescriptionThe ingredient to check | 
When this ingredient stack is crafted, what will remain in the grid? Does not check if the stack matches though! Used e.g. in Crafting Table recipes.
Return Type: IItemStack
// IIngredientAny.getRemainingItem(stack as IItemStack) as IItemStack
IIngredientAny.getInstance().getRemainingItem(<item:minecraft:iron_ingot>);| Parameter | Type | Description | 
|---|---|---|
| Parameterstack | TypeIItemStack | DescriptionThe stack to provide for this ingredient. | 
Does the given stack match the ingredient?
Return Type: boolean
// IIngredientAny.matches(stack as IItemStack) as boolean
IIngredientAny.getInstance().matches(<item:minecraft:iron_ingot>);| Parameter | Type | Description | 
|---|---|---|
| Parameterstack | TypeIItemStack | DescriptionThe stack to check | 
Return Type: void
IIngredientAny.modifyShiftTooltip(shiftedFunction as ITooltipFunction, unshiftedFunction as ITooltipFunction) as void| Parameter | Type | Description | Optional | DefaultValue | 
|---|---|---|---|---|
| ParametershiftedFunction | TypeITooltipFunction | DescriptionNo Description Provided | Optionalfalse | DefaultValue | 
| ParameterunshiftedFunction | TypeITooltipFunction | DescriptionNo Description Provided | Optionaltrue | DefaultValue | 
Return Type: void
IIngredientAny.modifyTooltip(function as ITooltipFunction) as void| Parameter | Type | Description | 
|---|---|---|
| Parameterfunction | TypeITooltipFunction | DescriptionNo Description Provided | 
Use this in contexts where machines accept more than one item to state that fact.
Return Type: IIngredientWithAmount
IIngredientAny.mul(amount as int) as IIngredientWithAmount| Parameter | Type | Description | 
|---|---|---|
| Parameteramount | Typeint | DescriptionNo Description Provided | 
Use this if you already have the condition from another ingredient
Return Type: IngredientConditioned<IIngredient>
IIngredientAny.only(condition as IIngredientCondition<IIngredient>) as IngredientConditioned<IIngredient>| Parameter | Type | Description | 
|---|---|---|
| Parametercondition | TypeIIngredientCondition<IIngredient> | DescriptionNo Description Provided | 
Return Type: IngredientConditioned<IIngredient>
// IIngredientAny.onlyDamaged() as IngredientConditioned<IIngredient>
IIngredientAny.getInstance().onlyDamaged();Return Type: IngredientConditioned<IIngredient>
IIngredientAny.onlyDamagedAtLeast(minDamage as int) as IngredientConditioned<IIngredient>| Parameter | Type | Description | 
|---|---|---|
| ParameterminDamage | Typeint | DescriptionNo Description Provided | 
Return Type: IngredientConditioned<IIngredient>
IIngredientAny.onlyDamagedAtMost(maxDamage as int) as IngredientConditioned<IIngredient>| Parameter | Type | Description | 
|---|---|---|
| ParametermaxDamage | Typeint | DescriptionNo Description Provided | 
Return Type: IngredientConditioned<IIngredient>
IIngredientAny.onlyIf(uid as string, function as Predicate<IItemStack>) as IngredientConditioned<IIngredient>| Parameter | Type | Description | Optional | DefaultValue | 
|---|---|---|---|---|
| Parameteruid | Typestring | DescriptionNo Description Provided | Optionalfalse | DefaultValue | 
| Parameterfunction | TypePredicate<IItemStack> | DescriptionNo Description Provided | Optionaltrue | DefaultValue | 
Removes all AttributeModifiers that use the given Attribute from this IIngredient.
Attributes removed with this method are removed from ItemStacks that match this IIngredient, regardless of how or when the ItemStack was made, if you want to remove the attribute on a single specific ItemStack (such as a specific Diamond Sword made in a recipe), then you should use IItemStack#withoutAttribute.
This method can only remove default Attributes from an ItemStack, it is still possible that an ItemStack can override it.
Return Type: void
// IIngredientAny.removeGlobalAttribute(attribute as Attribute, slotTypes as EquipmentSlot[]) as void
IIngredientAny.getInstance().removeGlobalAttribute(<attribute:minecraft:generic.attack_damage>, [<equipmentslot:chest>]);| Parameter | Type | Description | 
|---|---|---|
| Parameterattribute | TypeAttribute | DescriptionThe attribute to remove. | 
| ParameterslotTypes | TypeEquipmentSlot[] | DescriptionThe slot types to remove it from. | 
Removes all AttributeModifiers who’s ID is the same as the given uuid from this IIngredient.
Return Type: void
// IIngredientAny.removeGlobalAttributeModifier(uuid as string, slotTypes as EquipmentSlot[]) as void
IIngredientAny.getInstance().removeGlobalAttributeModifier("8c1b5535-9f79-448b-87ae-52d81480aaa3", [<equipmentslot:chest>]);| Parameter | Type | Description | 
|---|---|---|
| Parameteruuid | Typestring | DescriptionThe unique id of the AttributeModifier to remove. | 
| ParameterslotTypes | TypeEquipmentSlot[] | DescriptionThe slot types to remove it from. | 
Return Type: void
IIngredientAny.removeTooltip(regex as string) as void| Parameter | Type | Description | 
|---|---|---|
| Parameterregex | Typestring | DescriptionNo Description Provided | 
Return Type: IIngredientTransformed<IIngredient>
// IIngredientAny.reuse() as IIngredientTransformed<IIngredient>
IIngredientAny.getInstance().reuse();Use this if you already have the transformer from another ingredient
Return Type: IIngredientTransformed<IIngredient>
IIngredientAny.transform(transformer as IIngredientTransformer<IIngredient>) as IIngredientTransformed<IIngredient>| Parameter | Type | Description | 
|---|---|---|
| Parametertransformer | TypeIIngredientTransformer<IIngredient> | DescriptionNo Description Provided | 
Return Type: IIngredientTransformed<IIngredient>
IIngredientAny.transformCustom(uid as string, function as Function<IItemStack,IItemStack>) as IIngredientTransformed<IIngredient>| Parameter | Type | Description | Optional | DefaultValue | 
|---|---|---|---|---|
| Parameteruid | Typestring | DescriptionNo Description Provided | Optionalfalse | DefaultValue | 
| Parameterfunction | TypeFunction<IItemStack,IItemStack> | DescriptionNo Description Provided | Optionaltrue | DefaultValue | 
Return Type: IIngredientTransformed<IIngredient>
IIngredientAny.transformDamage(amount as int) as IIngredientTransformed<IIngredient>| Parameter | Type | Description | Optional | DefaultValue | 
|---|---|---|---|---|
| Parameteramount | Typeint | DescriptionNo Description Provided | Optionaltrue | DefaultValue1 | 
Return Type: IIngredientTransformed<IIngredient>
IIngredientAny.transformReplace(replaceWith as IItemStack) as IIngredientTransformed<IIngredient>| Parameter | Type | Description | 
|---|---|---|
| ParameterreplaceWith | TypeIItemStack | DescriptionNo Description Provided | 
Operators
Does the ingredient contain the given ingredient?
ingredient as IIngredient in myIIngredientAny(<item:minecraft:iron_ingot> | <item:minecraft:gold_ingot>) in IIngredientAny.getInstance()Use this in contexts where machines accept more than one item to state that fact.
myIIngredientAny * amount as intmyIIngredientAny | other as IIngredientProperties
| Name | Type | Has Getter | Has Setter | Description | 
|---|---|---|---|---|
| NameburnTime | Typevoid | Has Getterfalse | Has Settertrue | DescriptionSets the burn time of this ingredient, for use in the furnace and other machines |