Home Commands Examples Getting Started With Scripts Global Keywords 1.21 Migration Guide
BracketDumpers BracketHandlers BracketValidators ResourceLocationBracketHandler

WrappingIIngredient

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.

script.zs
import crafttweaker.api.ingredient.type.WrappingIIngredient;

Description

An IIngredient that wraps a vanilla Ingredient.

Implements

WrappingIIngredient implements the following interfaces:

IIngredient,CommandStringDisplayable

Operators

in(ingredient as IIngredient) as bool
Does the ingredient contain the given ingredient?
script.zs
// ((ingredient as IIngredient) in WrappingIIngredient) as bool
myIIngredient in <tag:item:minecraft:wool>.asIIngredient();

Parameters:

ingredient Type: IIngredient - The ingredient to check

Return Type: bool

*(amount as int) as IIngredientWithAmount
Use this in contexts where machines accept more than one item to state that fact.
script.zs
// (WrappingIIngredient * (amount as int)) as IIngredientWithAmount
<tag:item:minecraft:wool>.asIIngredient(); * myInt

Parameters:

amount Type: int

Return Type: IIngredientWithAmount

|(other as IIngredient) as IIngredientList
script.zs
// (WrappingIIngredient | (other as IIngredient)) as IIngredientList
<tag:item:minecraft:wool>.asIIngredient(); | myIIngredient

Parameters:

other Type: IIngredient

Return Type: IIngredientList

Members

addGlobalAttributeModifier(attribute as Attribute, id as ResourceLocation, value as double, operation as Operation, slotTypes as EquipmentSlot[])
This method no longer works and is deprecated, it is left in so it doesn't cause breaking changes.
Please use Item Components instead.
script.zs
// WrappingIIngredient.addGlobalAttributeModifier(attribute as Attribute, id as ResourceLocation, value as double, operation as AttributeOperation, slotTypes as EquipmentSlot[]);
<tag:item:minecraft:wool>.asIIngredient();.addGlobalAttributeModifier(myAttribute, myResourceLocation, myDouble, myOperation, myEquipmentSlot[]);

Parameters:

attribute Type: Attribute
value Type: double
slotTypes Type: EquipmentSlot[]
addShiftTooltip(content as Component, showMessage as Component = null)
script.zs
// WrappingIIngredient.addShiftTooltip(content as Component, showMessage as Component = null);
<tag:item:minecraft:wool>.asIIngredient();.addShiftTooltip(myComponent, myComponent);

Parameters:

content Type: Component
showMessage (optional) Type: Component

Default Value: null

addTooltip(content as Component)
script.zs
// WrappingIIngredient.addTooltip(content as Component);
<tag:item:minecraft:wool>.asIIngredient();.addTooltip(myComponent);

Parameters:

content Type: Component
anyDamage() as IIngredient
script.zs
// WrappingIIngredient.anyDamage() as IIngredient;
<tag:item:minecraft:wool>.asIIngredient();.anyDamage();

Return Type: IIngredient

implicit as IData
script.zs
// WrappingIIngredient as IData
<tag:item:minecraft:wool>.asIIngredient(); as IData

Return Type: IData

asIIngredientWithAmount() as IIngredientWithAmount
Used implicitly when a machine can accept more than one item but you only provide one.
script.zs
// WrappingIIngredient.asIIngredientWithAmount() as IIngredientWithAmount;
<tag:item:minecraft:wool>.asIIngredient();.asIIngredientWithAmount();

Return Type: IIngredientWithAmount

implicit as IIngredientWithAmount
Used implicitly when a machine can accept more than one item but you only provide one.
script.zs
// WrappingIIngredient as IIngredientWithAmount
<tag:item:minecraft:wool>.asIIngredient(); as IIngredientWithAmount

Return Type: IIngredientWithAmount

implicit as MapData
script.zs
// WrappingIIngredient as MapData
<tag:item:minecraft:wool>.asIIngredient(); as MapData

Return Type: MapData

Setter
Sets the burn time of this ingredient, for use in the furnace and other machines
script.zs
// WrappingIIngredient.burnTime = (time as int);
<tag:item:minecraft:wool>.asIIngredient();.burnTime = myInt;

Parameters:

time Type: int - the new burn time
burnTime(time as int)
Sets the burn time of this ingredient, for use in the furnace and other machines
script.zs
// WrappingIIngredient.burnTime(time as int);
<tag:item:minecraft:wool>.asIIngredient();.burnTime(500);

Parameters:

time Type: int - the new burn time
clearTooltip(leaveName as bool = false)
script.zs
// WrappingIIngredient.clearTooltip(leaveName as bool = false);
<tag:item:minecraft:wool>.asIIngredient();.clearTooltip(myBool);

Parameters:

leaveName (optional) Type: bool

Default Value: false

condition(condition as IIngredientCondition) as IIngredient
Use this if you already have the condition from another ingredient
script.zs
// WrappingIIngredient.condition(condition as IIngredientCondition) as IIngredient;
<tag:item:minecraft:wool>.asIIngredient();.condition(myIIngredientCondition);

Parameters:

Return Type: IIngredient

contains(ingredient as IIngredient) as bool
Does the ingredient contain the given ingredient?
script.zs
// WrappingIIngredient.contains(ingredient as IIngredient) as bool;
<tag:item:minecraft:wool>.asIIngredient();.contains((<item:minecraft:iron_ingot> | <item:minecraft:gold_ingot>));

Parameters:

ingredient Type: IIngredient - The ingredient to check

Return Type: bool

getRemainingItem(stack as IItemStack) as IItemStack
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.
script.zs
// WrappingIIngredient.getRemainingItem(stack as IItemStack) as IItemStack;
<tag:item:minecraft:wool>.asIIngredient();.getRemainingItem(<item:minecraft:iron_ingot>);

Parameters:

stack Type: IItemStack - The stack to provide for this ingredient.

Return Type: IItemStack

modifyShiftTooltip(shiftedFunction as ITooltipFunction, unshiftedFunction as ITooltipFunction = null)
script.zs
// WrappingIIngredient.modifyShiftTooltip(shiftedFunction as ITooltipFunction, unshiftedFunction as ITooltipFunction = null);
<tag:item:minecraft:wool>.asIIngredient();.modifyShiftTooltip(myITooltipFunction, myITooltipFunction);

Parameters:

shiftedFunction Type: ITooltipFunction
unshiftedFunction (optional) Type: ITooltipFunction

Default Value: null

modifyTooltip(function as ITooltipFunction)
script.zs
// WrappingIIngredient.modifyTooltip(function as ITooltipFunction);
<tag:item:minecraft:wool>.asIIngredient();.modifyTooltip(myITooltipFunction);

Parameters:

mul(amount as int) as IIngredientWithAmount
Use this in contexts where machines accept more than one item to state that fact.
script.zs
// WrappingIIngredient.mul(amount as int) as IIngredientWithAmount;
<tag:item:minecraft:wool>.asIIngredient();.mul(myInt);

Parameters:

amount Type: int

Return Type: IIngredientWithAmount

onlyDamaged() as IIngredient
script.zs
// WrappingIIngredient.onlyDamaged() as IIngredient;
<tag:item:minecraft:wool>.asIIngredient();.onlyDamaged();

Return Type: IIngredient

onlyDamagedAtLeast(minDamage as int) as IIngredient
script.zs
// WrappingIIngredient.onlyDamagedAtLeast(minDamage as int) as IIngredient;
<tag:item:minecraft:wool>.asIIngredient();.onlyDamagedAtLeast(myInt);

Parameters:

minDamage Type: int

Return Type: IIngredient

onlyDamagedAtMost(maxDamage as int) as IIngredient
script.zs
// WrappingIIngredient.onlyDamagedAtMost(maxDamage as int) as IIngredient;
<tag:item:minecraft:wool>.asIIngredient();.onlyDamagedAtMost(myInt);

Parameters:

maxDamage Type: int

Return Type: IIngredient

onlyIf(uid as string, function as function(t as IItemStack) as bool = null) as IIngredient
script.zs
// WrappingIIngredient.onlyIf(uid as string, function as function(t as IItemStack) as bool = null) as IIngredient;
<tag:item:minecraft:wool>.asIIngredient();.onlyIf(myString, myPredicate);

Parameters:

uid Type: string
function (optional) Type: function(t as IItemStack) as bool

Default Value: null

Return Type: IIngredient

removeGlobalAttribute(attribute as Attribute, slotTypes as EquipmentSlot[])
This method no longer works and is deprecated, it is left in so it doesn't cause breaking changes.
Please use Item Components instead.
script.zs
// WrappingIIngredient.removeGlobalAttribute(attribute as Attribute, slotTypes as EquipmentSlot[]);
<tag:item:minecraft:wool>.asIIngredient();.removeGlobalAttribute(myAttribute, myEquipmentSlot[]);

Parameters:

attribute Type: Attribute
slotTypes Type: EquipmentSlot[]
removeGlobalAttributeModifier(uuid as string, slotTypes as EquipmentSlot[])
This method no longer works and is deprecated, it is left in so it doesn't cause breaking changes.
Please use Item Components instead.
script.zs
// WrappingIIngredient.removeGlobalAttributeModifier(uuid as string, slotTypes as EquipmentSlot[]);
<tag:item:minecraft:wool>.asIIngredient();.removeGlobalAttributeModifier(myString, myEquipmentSlot[]);

Parameters:

uuid Type: string
slotTypes Type: EquipmentSlot[]
removeGlobalAttributeModifier(uuid as UUID, slotTypes as EquipmentSlot[])
This method no longer works and is deprecated, it is left in so it doesn't cause breaking changes.
Please use Item Components instead.
script.zs
// WrappingIIngredient.removeGlobalAttributeModifier(uuid as UUID, slotTypes as EquipmentSlot[]);
<tag:item:minecraft:wool>.asIIngredient();.removeGlobalAttributeModifier(myUUID, myEquipmentSlot[]);

Parameters:

uuid Type: UUID
slotTypes Type: EquipmentSlot[]
removeTooltip(regex as string)
script.zs
// WrappingIIngredient.removeTooltip(regex as string);
<tag:item:minecraft:wool>.asIIngredient();.removeTooltip(myString);

Parameters:

regex Type: string
reuse() as IIngredient
script.zs
// WrappingIIngredient.reuse() as IIngredient;
<tag:item:minecraft:wool>.asIIngredient();.reuse();

Return Type: IIngredient

transformCustom(uid as string, function as function(r as IItemStack) as IItemStack = null) as IIngredient
script.zs
// WrappingIIngredient.transformCustom(uid as string, function as function(r as IItemStack) as IItemStack = null) as IIngredient;
<tag:item:minecraft:wool>.asIIngredient();.transformCustom(myString, myFunction);

Parameters:

uid Type: string
function (optional) Type: function(r as IItemStack) as IItemStack

Default Value: null

Return Type: IIngredient

transformDamage(amount as int = 1) as IIngredient
script.zs
// WrappingIIngredient.transformDamage(amount as int = 1) as IIngredient;
<tag:item:minecraft:wool>.asIIngredient();.transformDamage(myInt);

Parameters:

amount (optional) Type: int

Default Value: 1

Return Type: IIngredient

transformReplace(replaceWith as IItemStack) as IIngredient
script.zs
// WrappingIIngredient.transformReplace(replaceWith as IItemStack) as IIngredient;
<tag:item:minecraft:wool>.asIIngredient();.transformReplace(myIItemStack);

Parameters:

replaceWith Type: IItemStack

Return Type: IIngredient