IIngredientAny
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.IIngredientAny;
Description
An IIngredient which matches all itemsImplements
IIngredientAny
implements the following interfaces:
IIngredient
,CommandStringDisplayable
Operators
myIIngredient in myIIngredientAny
Parameters:
Return Type:
bool
// (IIngredientAny * (amount as int)) as IIngredientWithAmountmyIIngredientAny * myInt
Parameters:
amount: int
Type: int
Return Type:
IIngredientWithAmount
myIIngredientAny | myIIngredient
Parameters:
other: IIngredient
Type: IIngredient
Return Type:
IIngredientList
Members
The id can be used to override an existing attribute on an ItemStack with this new modifier. You can use
/ct hand attributes
to get the id 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
// IIngredientAny.addGlobalAttributeModifier(attribute as Attribute, id as ResourceLocation, value as double, operation as AttributeOperation, slotTypes as EquipmentSlot[]);myIIngredientAny.addGlobalAttributeModifier(<attribute:minecraft:generic.attack_damage>, myResourceLocation, 10, AttributeOperation.ADDITION, [<constant:minecraft:equipmentslot:chest>]);
Parameters:
value: double
Type: double
- The value of the modifier. myIIngredientAny.asIIngredientWithAmount();
Return Type:
IIngredientWithAmount
// IIngredientAny as IIngredientWithAmountmyIIngredientAny as IIngredientWithAmount
Return Type:
IIngredientWithAmount
// IIngredientAny.burnTime = (time as int);myIIngredientAny.burnTime = myInt;
Parameters:
time: int
Type: int
- the new burn time // IIngredientAny.burnTime(time as int);myIIngredientAny.burnTime(500);
Parameters:
time: int
Type: int
- the new burn time // IIngredientAny.clearTooltip(leaveName as bool = false);myIIngredientAny.clearTooltip(myBool);
Parameters:
leaveName: bool
(optional) Type: bool
Default Value: false
myIIngredientAny.contains((<item:minecraft:iron_ingot> | <item:minecraft:gold_ingot>));
Parameters:
Return Type:
bool
// IIngredientAny.empty as boolmyIIngredientAny.empty
Return Type:
bool
Returns: true if empty, false otherwise
// IIngredientAny.empty() as bool;myIIngredientAny.empty();
Return Type:
bool
myIIngredientAny.getRemainingItem(<item:minecraft:iron_ingot>);
Parameters:
Return Type:
IItemStack
// IIngredientAny.modifyShiftTooltip(shiftedFunction as ITooltipFunction, unshiftedFunction as ITooltipFunction = null);myIIngredientAny.modifyShiftTooltip(myITooltipFunction, myITooltipFunction);
Parameters:
shiftedFunction: ITooltipFunction
Type: ITooltipFunction
myIIngredientAny.modifyTooltip(myITooltipFunction);
Parameters:
function: ITooltipFunction
Type: ITooltipFunction
myIIngredientAny.mul(myInt);
Parameters:
amount: int
Type: int
Return Type:
IIngredientWithAmount
myIIngredientAny.onlyDamagedAtLeast(myInt);
Parameters:
minDamage: int
Type: int
Return Type:
IIngredient
myIIngredientAny.onlyDamagedAtMost(myInt);
Parameters:
maxDamage: int
Type: int
Return Type:
IIngredient
// IIngredientAny.onlyIf(uid as string, function as function(t as IItemStack) as bool = null) as IIngredient;myIIngredientAny.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:
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.
myIIngredientAny.removeGlobalAttribute(<attribute:minecraft:generic.attack_damage>, [<constant:minecraft:equipmentslot:chest>]);
Parameters:
myIIngredientAny.removeGlobalAttributeModifier("8c1b5535-9f79-448b-87ae-52d81480aaa3", [<constant:minecraft:equipmentslot:chest>]);
Parameters:
uuid: string
Type: string
- The unique id of the AttributeModifier to remove. myIIngredientAny.removeGlobalAttributeModifier(IItemStack.BASE_ATTACK_DAMAGE_UUID, [<constant:minecraft:equipmentslot:chest>]);
Parameters:
uuid: UUID
Type: UUID
- The unique id of the AttributeModifier to remove. // IIngredientAny.removeTooltip(regex as string);myIIngredientAny.removeTooltip(myString);
Parameters:
regex: string
Type: string
// IIngredientAny.transformCustom(uid as string, function as function(r as IItemStack) as IItemStack = null) as IIngredient;myIIngredientAny.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:
IIngredient
myIIngredientAny.transformDamage(myInt);
Parameters:
amount: int
(optional) Type: int
Default Value: 1
Return Type:
IIngredient
myIIngredientAny.transformReplace(myIItemStack);
Parameters:
replaceWith: IItemStack
Type: IItemStack
Return Type:
IIngredient