IIngredientTransformed
Importing the class
If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.
import crafttweaker.api.ingredient.type.IIngredientTransformed;
Implements
IIngredientTransformed<IIngredient>
implements the following interfaces:
IIngredient
,CommandStringDisplayable
Operators
myIIngredient in myIIngredientTransformed
Parameters:
Return Type:
bool
myIIngredientTransformed * myInt
Parameters:
amount: int
Type: int
Return Type:
IIngredientWithAmount
myIIngredientTransformed | myIIngredient
Parameters:
other: IIngredient
Type: IIngredient
Return Type:
IIngredientList
Members
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
// IIngredientTransformed<T : IIngredient>.addGlobalAttributeModifier(attribute as Attribute, name as string, value as double, operation as AttributeOperation, slotTypes as EquipmentSlot[]);myIIngredientTransformed.addGlobalAttributeModifier(<attribute:minecraft:generic.attack_damage>, "Extra Power", 10, AttributeOperation.ADDITION, [<constant:minecraft:equipmentslot:chest>]);
Parameters:
name: string
Type: string
- The name of the modifier. value: double
Type: double
- The value of the modifier. 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
// IIngredientTransformed<T : IIngredient>.addGlobalAttributeModifier(attribute as Attribute, uuid as string, name as string, value as double, operation as AttributeOperation, slotTypes as EquipmentSlot[]);myIIngredientTransformed.addGlobalAttributeModifier(<attribute:minecraft:generic.attack_damage>, "8c1b5535-9f79-448b-87ae-52d81480aaa3", "Extra Power", 10, AttributeOperation.ADDITION, [<constant:minecraft:equipmentslot:chest>]);
Parameters:
uuid: string
Type: string
- The unique identifier of the modifier to replace. name: string
Type: string
- The name of the modifier. value: double
Type: double
- The value of the modifier. 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
// IIngredientTransformed<T : IIngredient>.addGlobalAttributeModifier(attribute as Attribute, uuid as UUID, name as string, value as double, operation as AttributeOperation, slotTypes as EquipmentSlot[]);myIIngredientTransformed.addGlobalAttributeModifier(<attribute:minecraft:generic.attack_damage>, IItemStack.BASE_ATTACK_DAMAGE_UUID, "Extra Power", 10, AttributeOperation.ADDITION, [<constant:minecraft:equipmentslot:chest>]);
Parameters:
uuid: UUID
Type: UUID
- The unique identifier of the modifier to replace. name: string
Type: string
- The name of the modifier. value: double
Type: double
- The value of the modifier. // IIngredientTransformed<T : IIngredient>.addShiftTooltip(content as Component, showMessage as Component = null);myIIngredientTransformed.addShiftTooltip(myComponent, myComponent);
myIIngredientTransformed.addTooltip(myComponent);
myIIngredientTransformed as IData
Return Type:
IData
myIIngredientTransformed.asIIngredientWithAmount();
Return Type:
IIngredientWithAmount
myIIngredientTransformed as IIngredientWithAmount
Return Type:
IIngredientWithAmount
myIIngredientTransformed as MapData
Return Type:
MapData
myIIngredientTransformed.baseIngredient
Return Type:
IIngredient
myIIngredientTransformed.burnTime = myInt;
Parameters:
time: int
Type: int
- the new burn time myIIngredientTransformed.burnTime(500);
Parameters:
time: int
Type: int
- the new burn time myIIngredientTransformed.clearTooltip(myBool);
Parameters:
leaveName: bool
(optional) Type: bool
Default Value: false
myIIngredientTransformed.contains((<item:minecraft:iron_ingot> | <item:minecraft:gold_ingot>));
Parameters:
Return Type:
bool
myIIngredientTransformed.empty
Return Type:
bool
Returns: true if empty, false otherwise
myIIngredientTransformed.empty();
Return Type:
bool
myIIngredientTransformed.items
Return Type:
IItemStack[]
// IIngredientTransformed<T : IIngredient>.matches(stack as IItemStack, ignoreDamage as bool) as bool;myIIngredientTransformed.matches(myIItemStack, myBool);
Parameters:
stack: IItemStack
Type: IItemStack
ignoreDamage: bool
Type: bool
Return Type:
bool
myIIngredientTransformed.matches(<item:minecraft:iron_ingot>);
Parameters:
Return Type:
bool
// IIngredientTransformed<T : IIngredient>.modifyShiftTooltip(shiftedFunction as ITooltipFunction, unshiftedFunction as ITooltipFunction = null);myIIngredientTransformed.modifyShiftTooltip(myITooltipFunction, myITooltipFunction);
Parameters:
shiftedFunction: ITooltipFunction
Type: ITooltipFunction
myIIngredientTransformed.modifyTooltip(myITooltipFunction);
Parameters:
function: ITooltipFunction
Type: ITooltipFunction
myIIngredientTransformed.mul(myInt);
Parameters:
amount: int
Type: int
Return Type:
IIngredientWithAmount
// IIngredientTransformed<T : IIngredient>.only(condition as IIngredientCondition<IIngredient>) as IngredientConditioned<IIngredient>;myIIngredientTransformed.only(myIIngredientCondition);
Parameters:
condition: IIngredientCondition<IIngredient>
Type: IIngredientCondition<IIngredient>
Return Type:
IngredientConditioned<IIngredient>
// IIngredientTransformed<T : IIngredient>.onlyDamagedAtLeast(minDamage as int) as IngredientConditioned<IIngredient>;myIIngredientTransformed.onlyDamagedAtLeast(myInt);
Parameters:
minDamage: int
Type: int
Return Type:
IngredientConditioned<IIngredient>
// IIngredientTransformed<T : IIngredient>.onlyDamagedAtMost(maxDamage as int) as IngredientConditioned<IIngredient>;myIIngredientTransformed.onlyDamagedAtMost(myInt);
Parameters:
maxDamage: int
Type: int
Return Type:
IngredientConditioned<IIngredient>
// IIngredientTransformed<T : IIngredient>.onlyIf(uid as string, function as function(t as IItemStack) as bool = null) as IngredientConditioned<IIngredient>;myIIngredientTransformed.onlyIf(myString, myPredicate);
Parameters:
uid: string
Type: string
function: function(t as IItemStack) as bool
(optional) Type: function(t as IItemStack) as bool
Default Value: null
Return Type:
IngredientConditioned<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.
// IIngredientTransformed<T : IIngredient>.removeGlobalAttribute(attribute as Attribute, slotTypes as EquipmentSlot[]);myIIngredientTransformed.removeGlobalAttribute(<attribute:minecraft:generic.attack_damage>, [<constant:minecraft:equipmentslot:chest>]);
Parameters:
// IIngredientTransformed<T : IIngredient>.removeGlobalAttributeModifier(uuid as string, slotTypes as EquipmentSlot[]);myIIngredientTransformed.removeGlobalAttributeModifier("8c1b5535-9f79-448b-87ae-52d81480aaa3", [<constant:minecraft:equipmentslot:chest>]);
Parameters:
uuid: string
Type: string
- The unique id of the AttributeModifier to remove. // IIngredientTransformed<T : IIngredient>.removeGlobalAttributeModifier(uuid as UUID, slotTypes as EquipmentSlot[]);myIIngredientTransformed.removeGlobalAttributeModifier(IItemStack.BASE_ATTACK_DAMAGE_UUID, [<constant:minecraft:equipmentslot:chest>]);
Parameters:
uuid: UUID
Type: UUID
- The unique id of the AttributeModifier to remove. myIIngredientTransformed.removeTooltip(myString);
Parameters:
regex: string
Type: string
// IIngredientTransformed<T : IIngredient>.transform(transformer as IIngredientTransformer<IIngredient>) as IIngredientTransformed<IIngredient>;myIIngredientTransformed.transform(myIIngredientTransformer);
Parameters:
transformer: IIngredientTransformer<IIngredient>
Type: IIngredientTransformer<IIngredient>
Return Type:
IIngredientTransformed<IIngredient>
// IIngredientTransformed<T : IIngredient>.transformCustom(uid as string, function as function(r as IItemStack) as IItemStack = null) as IIngredientTransformed<IIngredient>;myIIngredientTransformed.transformCustom(myString, myFunction);
Parameters:
uid: string
Type: string
function: function(r as IItemStack) as IItemStack
(optional) Type: function(r as IItemStack) as IItemStack
Default Value: null
Return Type:
IIngredientTransformed<IIngredient>
// IIngredientTransformed<T : IIngredient>.transformDamage(amount as int = 1) as IIngredientTransformed<IIngredient>;myIIngredientTransformed.transformDamage(myInt);
Parameters:
amount: int
(optional) Type: int
Default Value: 1
Return Type:
IIngredientTransformed<IIngredient>
myIIngredientTransformed.transformer
Return Type:
IIngredientTransformer<IIngredient>
// IIngredientTransformed<T : IIngredient>.transformReplace(replaceWith as IItemStack) as IIngredientTransformed<IIngredient>;myIIngredientTransformed.transformReplace(myIItemStack);
Parameters:
replaceWith: IItemStack
Type: IItemStack
Return Type:
IIngredientTransformed<IIngredient>