IIngredientEmpty
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.IIngredientEmpty;Implemented Interfaces
IIngredientEmpty implements the following interfaces. That means all methods defined in these interfaces are also available in IIngredientEmpty
Enum Constants
IIngredientEmpty is an enum. It has 1 enum constants. They are accessible using the code below.
IIngredientEmpty.INSTANCEStatic Methods
Return Type: IIngredientEmpty
// IIngredientEmpty.getInstance() as IIngredientEmpty
IIngredientEmpty.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
// IIngredientEmpty.addGlobalAttributeModifier(attribute as Attribute, name as string, value as double, operation as AttributeOperation, slotTypes as EquipmentSlot[])
myIIngredientEmpty.addGlobalAttributeModifier(<attribute:minecraft:generic.attack_damage>, "Extra Power", 10, AttributeOperation.ADDITION, [<constant:minecraft: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
// IIngredientEmpty.addGlobalAttributeModifier(attribute as Attribute, uuid as invalid, name as string, value as double, operation as AttributeOperation, slotTypes as EquipmentSlot[])
myIIngredientEmpty.addGlobalAttributeModifier(<attribute:minecraft:generic.attack_damage>, IItemStack.BASE_ATTACK_DAMAGE_UUID, "Extra Power", 10, AttributeOperation.ADDITION, [<constant:minecraft:equipmentslot:chest>]);| Parameter | Type | Description | 
|---|---|---|
| Parameterattribute | TypeAttribute | DescriptionThe Attribute of the modifier. | 
| Parameteruuid | Typeinvalid | 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. | 
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
// IIngredientEmpty.addGlobalAttributeModifier(attribute as Attribute, uuid as string, name as string, value as double, operation as AttributeOperation, slotTypes as EquipmentSlot[])
myIIngredientEmpty.addGlobalAttributeModifier(<attribute:minecraft:generic.attack_damage>, "8c1b5535-9f79-448b-87ae-52d81480aaa3", "Extra Power", 10, AttributeOperation.ADDITION, [<constant:minecraft: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. | 
IIngredientEmpty.addTooltip(content as Component)| Parameter | Type | 
|---|---|
| Parametercontent | TypeComponent | 
Return Type: IngredientConditioned<IIngredient>
// IIngredientEmpty.anyDamage() as IngredientConditioned<IIngredient>
myIIngredientEmpty.anyDamage();Used implicitly when a machine can accept more than one item but you only provide one.
Return Type: IIngredientWithAmount
// IIngredientEmpty.asIIngredientWithAmount() as IIngredientWithAmount
myIIngredientEmpty.asIIngredientWithAmount();IIngredientEmpty.clearTooltip(leaveName as boolean)| Parameter | Type | Optional | Default Value | 
|---|---|---|---|
| ParameterleaveName | Typeboolean | Optionaltrue | Default Valuefalse | 
Does the ingredient contain the given ingredient?
Return Type: boolean
// IIngredientEmpty.contains(ingredient as IIngredient) as boolean
myIIngredientEmpty.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
// IIngredientEmpty.getRemainingItem(stack as IItemStack) as IItemStack
myIIngredientEmpty.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
// IIngredientEmpty.matches(stack as IItemStack) as boolean
myIIngredientEmpty.matches(<item:minecraft:iron_ingot>);| Parameter | Type | Description | 
|---|---|---|
| Parameterstack | TypeIItemStack | DescriptionThe stack to check | 
IIngredientEmpty.modifyShiftTooltip(shiftedFunction as ITooltipFunction, unshiftedFunction as ITooltipFunction)| Parameter | Type | Optional | 
|---|---|---|
| ParametershiftedFunction | TypeITooltipFunction | Optionalfalse | 
| ParameterunshiftedFunction | TypeITooltipFunction | Optionaltrue | 
IIngredientEmpty.modifyTooltip(function as ITooltipFunction)| Parameter | Type | 
|---|---|
| Parameterfunction | TypeITooltipFunction | 
Use this in contexts where machines accept more than one item to state that fact.
Return Type: IIngredientWithAmount
IIngredientEmpty.mul(amount as int) as IIngredientWithAmount| Parameter | Type | 
|---|---|
| Parameteramount | Typeint | 
Use this if you already have the condition from another ingredient
Return Type: IngredientConditioned<IIngredient>
IIngredientEmpty.only(condition as IIngredientCondition<IIngredient>) as IngredientConditioned<IIngredient>| Parameter | Type | 
|---|---|
| Parametercondition | TypeIIngredientCondition<IIngredient> | 
Return Type: IngredientConditioned<IIngredient>
// IIngredientEmpty.onlyDamaged() as IngredientConditioned<IIngredient>
myIIngredientEmpty.onlyDamaged();Return Type: IngredientConditioned<IIngredient>
IIngredientEmpty.onlyDamagedAtLeast(minDamage as int) as IngredientConditioned<IIngredient>| Parameter | Type | 
|---|---|
| ParameterminDamage | Typeint | 
Return Type: IngredientConditioned<IIngredient>
IIngredientEmpty.onlyDamagedAtMost(maxDamage as int) as IngredientConditioned<IIngredient>| Parameter | Type | 
|---|---|
| ParametermaxDamage | Typeint | 
Return Type: IngredientConditioned<IIngredient>
IIngredientEmpty.onlyIf(uid as string, function as Predicate<IItemStack>) as IngredientConditioned<IIngredient>| Parameter | Type | Optional | 
|---|---|---|
| Parameteruid | Typestring | Optionalfalse | 
| Parameterfunction | TypePredicate<IItemStack> | Optionaltrue | 
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.
// IIngredientEmpty.removeGlobalAttribute(attribute as Attribute, slotTypes as EquipmentSlot[])
myIIngredientEmpty.removeGlobalAttribute(<attribute:minecraft:generic.attack_damage>, [<constant:minecraft: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.
// IIngredientEmpty.removeGlobalAttributeModifier(uuid as invalid, slotTypes as EquipmentSlot[])
myIIngredientEmpty.removeGlobalAttributeModifier(IItemStack.BASE_ATTACK_DAMAGE_UUID, [<constant:minecraft:equipmentslot:chest>]);| Parameter | Type | Description | 
|---|---|---|
| Parameteruuid | Typeinvalid | DescriptionThe unique id of the AttributeModifier 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.
// IIngredientEmpty.removeGlobalAttributeModifier(uuid as string, slotTypes as EquipmentSlot[])
myIIngredientEmpty.removeGlobalAttributeModifier("8c1b5535-9f79-448b-87ae-52d81480aaa3", [<constant:minecraft:equipmentslot:chest>]);| Parameter | Type | Description | 
|---|---|---|
| Parameteruuid | Typestring | DescriptionThe unique id of the AttributeModifier to remove. | 
| ParameterslotTypes | TypeEquipmentSlot[] | DescriptionThe slot types to remove it from. | 
IIngredientEmpty.removeTooltip(regex as string)| Parameter | Type | 
|---|---|
| Parameterregex | Typestring | 
Return Type: IIngredientTransformed<IIngredient>
// IIngredientEmpty.reuse() as IIngredientTransformed<IIngredient>
myIIngredientEmpty.reuse();Sets the burn time of this ingredient, for use in the furnace and other machines
// IIngredientEmpty.setBurnTime(time as int)
myIIngredientEmpty.setBurnTime(500);| Parameter | Type | Description | 
|---|---|---|
| Parametertime | Typeint | Descriptionthe new burn time | 
Use this if you already have the transformer from another ingredient
Return Type: IIngredientTransformed<IIngredient>
IIngredientEmpty.transform(transformer as IIngredientTransformer<IIngredient>) as IIngredientTransformed<IIngredient>| Parameter | Type | 
|---|---|
| Parametertransformer | TypeIIngredientTransformer<IIngredient> | 
Return Type: IIngredientTransformed<IIngredient>
IIngredientEmpty.transformCustom(uid as string, function as Function<IItemStack,IItemStack>) as IIngredientTransformed<IIngredient>| Parameter | Type | Optional | 
|---|---|---|
| Parameteruid | Typestring | Optionalfalse | 
| Parameterfunction | TypeFunction<IItemStack,IItemStack> | Optionaltrue | 
Return Type: IIngredientTransformed<IIngredient>
IIngredientEmpty.transformDamage(amount as int) as IIngredientTransformed<IIngredient>| Parameter | Type | Optional | Default Value | 
|---|---|---|---|
| Parameteramount | Typeint | Optionaltrue | Default Value1 | 
Return Type: IIngredientTransformed<IIngredient>
IIngredientEmpty.transformReplace(replaceWith as IItemStack) as IIngredientTransformed<IIngredient>| Parameter | Type | 
|---|---|
| ParameterreplaceWith | TypeIItemStack | 
Operators
Does the ingredient contain the given ingredient?
ingredient as IIngredient in myIIngredientEmpty(<item:minecraft:iron_ingot> | <item:minecraft:gold_ingot>) in myIIngredientEmptyUse this in contexts where machines accept more than one item to state that fact.
myIIngredientEmpty * amount as intmyIIngredientEmpty | 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 |