MCIngredientTransformed<T : IIngredient>
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.item.MCIngredientTransformed;Implemented Interfaces
MCIngredientTransformed implements the following interfaces. That means all methods defined in these interfaces are also available in MCIngredientTransformed
Casters
| Result type | Is Implicit | 
|---|---|
| Result typeIData | 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
// MCIngredientTransformed.addGlobalAttributeModifier(attribute as Attribute, name as string, value as double, operation as AttributeOperation, slotTypes as MCEquipmentSlotType[]) as void
myMCIngredientTransformed.addGlobalAttributeModifier(<attribute:minecraft:generic.attack_damage>, "Extra Power", 10, AttributeOperation.ADDITION, [<equipmentslottype: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 | TypeMCEquipmentSlotType[] | 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
// MCIngredientTransformed.addGlobalAttributeModifier(attribute as Attribute, uuid as string, name as string, value as double, operation as AttributeOperation, slotTypes as MCEquipmentSlotType[]) as void
myMCIngredientTransformed.addGlobalAttributeModifier(<attribute:minecraft:generic.attack_damage>, "8c1b5535-9f79-448b-87ae-52d81480aaa3", "Extra Power", 10, AttributeOperation.ADDITION, [<equipmentslottype: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 | TypeMCEquipmentSlotType[] | DescriptionWhat slots the modifier is valid for. | 
Return Type: void
MCIngredientTransformed.addShiftTooltip(content as MCTextComponent, showMessage as MCTextComponent) as void| Parameter | Type | Description | Optional | DefaultValue | 
|---|---|---|---|---|
| Parametercontent | TypeMCTextComponent | DescriptionNo Description Provided | Optionalfalse | DefaultValue | 
| ParametershowMessage | TypeMCTextComponent | DescriptionNo Description Provided | Optionaltrue | DefaultValue | 
Return Type: void
MCIngredientTransformed.addTooltip(content as MCTextComponent) as void| Parameter | Type | Description | 
|---|---|---|
| Parametercontent | TypeMCTextComponent | DescriptionNo Description Provided | 
Return Type: MCIngredientConditioned<IIngredient>
// MCIngredientTransformed.anyDamage() as MCIngredientConditioned<IIngredient>
myMCIngredientTransformed.anyDamage();Return Type: void
// MCIngredientTransformed.clearTooltip() as void
myMCIngredientTransformed.clearTooltip();Does the ingredient contain the given ingredient?
Return Type: boolean
// MCIngredientTransformed.contains(ingredient as IIngredient) as boolean
myMCIngredientTransformed.contains((<item:minecraft:iron_ingot> | <item:minecraft:gold_ingot>));| Parameter | Type | Description | 
|---|---|---|
| Parameteringredient | TypeIIngredient | DescriptionThe ingredient to check | 
Does the given stack match the ingredient?
Return Type: boolean
// MCIngredientTransformed.matches(stack as IItemStack) as boolean
myMCIngredientTransformed.matches(<item:minecraft:iron_ingot>);| Parameter | Type | Description | 
|---|---|---|
| Parameterstack | TypeIItemStack | DescriptionThe stack to check | 
Return Type: boolean
MCIngredientTransformed.matches(stack as IItemStack, ignoreDamage as boolean) as boolean| Parameter | Type | Description | 
|---|---|---|
| Parameterstack | TypeIItemStack | DescriptionNo Description Provided | 
| ParameterignoreDamage | Typeboolean | DescriptionNo Description Provided | 
Return Type: void
MCIngredientTransformed.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
MCIngredientTransformed.modifyTooltip(function as ITooltipFunction) as void| Parameter | Type | Description | 
|---|---|---|
| Parameterfunction | TypeITooltipFunction | DescriptionNo Description Provided | 
Use this if you already have the condition from another ingredient
Return Type: MCIngredientConditioned<IIngredient>
MCIngredientTransformed.only(condition as IIngredientCondition<IIngredient>) as MCIngredientConditioned<IIngredient>| Parameter | Type | Description | 
|---|---|---|
| Parametercondition | TypeIIngredientCondition<IIngredient> | DescriptionNo Description Provided | 
Return Type: MCIngredientConditioned<IIngredient>
// MCIngredientTransformed.onlyDamaged() as MCIngredientConditioned<IIngredient>
myMCIngredientTransformed.onlyDamaged();Return Type: MCIngredientConditioned<IIngredient>
MCIngredientTransformed.onlyDamagedAtLeast(minDamage as int) as MCIngredientConditioned<IIngredient>| Parameter | Type | Description | 
|---|---|---|
| ParameterminDamage | Typeint | DescriptionNo Description Provided | 
Return Type: MCIngredientConditioned<IIngredient>
MCIngredientTransformed.onlyDamagedAtMost(maxDamage as int) as MCIngredientConditioned<IIngredient>| Parameter | Type | Description | 
|---|---|---|
| ParametermaxDamage | Typeint | DescriptionNo Description Provided | 
Return Type: MCIngredientConditioned<IIngredient>
MCIngredientTransformed.onlyIf(uid as string, function as Predicate<IItemStack>) as MCIngredientConditioned<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
// MCIngredientTransformed.removeGlobalAttribute(attribute as Attribute, slotTypes as MCEquipmentSlotType[]) as void
myMCIngredientTransformed.removeGlobalAttribute(<attribute:minecraft:generic.attack_damage>, [<equipmentslottype:chest>]);| Parameter | Type | Description | 
|---|---|---|
| Parameterattribute | TypeAttribute | DescriptionThe attribute to remove. | 
| ParameterslotTypes | TypeMCEquipmentSlotType[] | 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
// MCIngredientTransformed.removeGlobalAttributeModifier(uuid as string, slotTypes as MCEquipmentSlotType[]) as void
myMCIngredientTransformed.removeGlobalAttributeModifier("8c1b5535-9f79-448b-87ae-52d81480aaa3", [<equipmentslottype:chest>]);| Parameter | Type | Description | 
|---|---|---|
| Parameteruuid | Typestring | DescriptionThe unique id of the AttributeModifier to remove. | 
| ParameterslotTypes | TypeMCEquipmentSlotType[] | DescriptionThe slot types to remove it from. | 
Return Type: void
MCIngredientTransformed.removeTooltip(regex as string) as void| Parameter | Type | Description | 
|---|---|---|
| Parameterregex | Typestring | DescriptionNo Description Provided | 
Operators
Does the ingredient contain the given ingredient?
ingredient as IIngredient in myMCIngredientTransformed(<item:minecraft:iron_ingot> | <item:minecraft:gold_ingot>) in myMCIngredientTransformedmyMCIngredientTransformed | other as IIngredientProperties
| Name | Type | Has Getter | Has Setter | Description | 
|---|---|---|---|---|
| NamebaseIngredient | TypeT | Has Gettertrue | Has Setterfalse | DescriptionNo Description Provided | 
| NameburnTime | Typevoid | Has Getterfalse | Has Settertrue | DescriptionSets the burn time of this ingredient, for use in the furnace and other machines | 
| Nameitems | TypeIItemStack[] | Has Gettertrue | Has Setterfalse | DescriptionNo Description Provided | 
| Nametransformer | TypeIIngredientTransformer<T> | Has Gettertrue | Has Setterfalse | DescriptionNo Description Provided |