MCItemStackMutable

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.item.MCItemStackMutable;

Implements

MCItemStackMutable implements the following interfaces:

ForgeItemStack,IItemStack,IIngredient,IIngredientWithAmount,CommandStringDisplayable

Operators

in(ingredient as IIngredient) as bool
Does the ingredient contain the given ingredient?
script.zs
// ((ingredient as IIngredient) in MCItemStackMutable) as bool
myIIngredient in myMCItemStackMutable

Parameters:

ingredient Type: IIngredient - The ingredient to check

Return Type: bool

==(o as Object) as bool
script.zs
// (MCItemStackMutable == (o as Object)) as bool
myMCItemStackMutable == myObject

Parameters:

o Type: Object

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
// (MCItemStackMutable * (amount as int)) as IIngredientWithAmount
myMCItemStackMutable * myInt

Parameters:

amount Type: int

Return Type: IIngredientWithAmount

|(other as IIngredient) as IIngredientList
script.zs
// (MCItemStackMutable | (other as IIngredient)) as IIngredientList
myMCItemStackMutable | myIIngredient

Parameters:

other Type: IIngredient

Return Type: IIngredientList

%(percentage as double) as Percentaged<IItemStack>
script.zs
// (MCItemStackMutable % (percentage as double)) as Percentaged<IItemStack>
myMCItemStackMutable % myDouble

Parameters:

percentage Type: double

Return Type: Percentaged<IItemStack>

*(amount as int) as IItemStack
Sets the amount of the ItemStack
script.zs
// (MCItemStackMutable * (amount as int)) as IItemStack
myMCItemStackMutable * myInt

Parameters:

amount Type: int - new amount

Return Type: IItemStack

Members

addGlobalAttributeModifier(attribute as Attribute, name as string, value as double, operation as Operation, slotTypes as EquipmentSlot[])
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
script.zs
// MCItemStackMutable.addGlobalAttributeModifier(attribute as Attribute, name as string, value as double, operation as Operation, slotTypes as EquipmentSlot[]);
myMCItemStackMutable.addGlobalAttributeModifier(<attribute:minecraft:generic.attack_damage>, "Extra Power", 10, AttributeOperation.ADDITION, [<constant:minecraft:equipmentslot:chest>]);

Parameters:

attribute Type: Attribute - The Attribute of the modifier.
name Type: string - The name of the modifier.
value Type: double - The value of the modifier.
operation Type: AttributeOperation - The operation of the modifier.
slotTypes Type: EquipmentSlot[] - What slots the modifier is valid for.
addGlobalAttributeModifier(attribute as Attribute, uuid as string, name as string, value as double, operation as Operation, slotTypes as EquipmentSlot[])
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
script.zs
// MCItemStackMutable.addGlobalAttributeModifier(attribute as Attribute, uuid as string, name as string, value as double, operation as Operation, slotTypes as EquipmentSlot[]);
myMCItemStackMutable.addGlobalAttributeModifier(<attribute:minecraft:generic.attack_damage>, "8c1b5535-9f79-448b-87ae-52d81480aaa3", "Extra Power", 10, AttributeOperation.ADDITION, [<constant:minecraft:equipmentslot:chest>]);

Parameters:

attribute Type: Attribute - The Attribute of the modifier.
uuid Type: string - The unique identifier of the modifier to replace.
name Type: string - The name of the modifier.
value Type: double - The value of the modifier.
operation Type: AttributeOperation - The operation of the modifier.
slotTypes Type: EquipmentSlot[] - What slots the modifier is valid for.
addGlobalAttributeModifier(attribute as Attribute, uuid as UUID, name as string, value as double, operation as Operation, slotTypes as EquipmentSlot[])
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
script.zs
// MCItemStackMutable.addGlobalAttributeModifier(attribute as Attribute, uuid as UUID, name as string, value as double, operation as Operation, slotTypes as EquipmentSlot[]);
myMCItemStackMutable.addGlobalAttributeModifier(<attribute:minecraft:generic.attack_damage>, IItemStack.BASE_ATTACK_DAMAGE_UUID, "Extra Power", 10, AttributeOperation.ADDITION, [<constant:minecraft:equipmentslot:chest>]);

Parameters:

attribute Type: Attribute - The Attribute of the modifier.
uuid Type: UUID - The unique identifier of the modifier to replace.
name Type: string - The name of the modifier.
value Type: double - The value of the modifier.
operation Type: AttributeOperation - The operation of the modifier.
slotTypes Type: EquipmentSlot[] - What slots the modifier is valid for.
addShiftTooltip(content as Component, showMessage as Component = null)
script.zs
// MCItemStackMutable.addShiftTooltip(content as Component, showMessage as Component = null);
myMCItemStackMutable.addShiftTooltip(myComponent, myComponent);

Parameters:

content Type: Component
showMessage (optional) Type: Component

Default Value: null

addTooltip(content as Component)
script.zs
// MCItemStackMutable.addTooltip(content as Component);
myMCItemStackMutable.addTooltip(myComponent);

Parameters:

content Type: Component
Getter
Gets the amount of Items in the ItemStack
script.zs
// MCItemStackMutable.amount as int
myMCItemStackMutable.amount

Return Type: int

Getter
Gets the amount of Items in the ItemStack
script.zs
// MCItemStackMutable.amount as int
myMCItemStackMutable.amount

Return Type: int

anyDamage() as IIngredientConditioned<IIngredient>
script.zs
// MCItemStackMutable.anyDamage() as IIngredientConditioned<IIngredient>;
myMCItemStackMutable.anyDamage();

Return Type: IngredientConditioned<IIngredient>

asIData() as IData
script.zs
// MCItemStackMutable.asIData() as IData;
myMCItemStackMutable.asIData();

Return Type: IData

implicit as IData
script.zs
// MCItemStackMutable as IData
myMCItemStackMutable as IData

Return Type: IData

implicit as IData
script.zs
// MCItemStackMutable as IData
myMCItemStackMutable as IData

Return Type: IData

asIIngredientWithAmount() as IIngredientWithAmount
script.zs
// MCItemStackMutable.asIIngredientWithAmount() as IIngredientWithAmount;
myMCItemStackMutable.asIIngredientWithAmount();

Return Type: IIngredientWithAmount

asIIngredientWithAmount() as IIngredientWithAmount
Used implicitly when a machine can accept more than one item but you only provide one.
script.zs
// MCItemStackMutable.asIIngredientWithAmount() as IIngredientWithAmount;
myMCItemStackMutable.asIIngredientWithAmount();

Return Type: IIngredientWithAmount

implicit as IIngredientWithAmount
script.zs
// MCItemStackMutable as IIngredientWithAmount
myMCItemStackMutable as IIngredientWithAmount

Return Type: IIngredientWithAmount

implicit as IIngredientWithAmount
Used implicitly when a machine can accept more than one item but you only provide one.
script.zs
// MCItemStackMutable as IIngredientWithAmount
myMCItemStackMutable as IIngredientWithAmount

Return Type: IIngredientWithAmount

asItemLike() as ItemLike
script.zs
// MCItemStackMutable.asItemLike() as ItemLike;
myMCItemStackMutable.asItemLike();

Return Type: ItemLike

implicit as ItemLike
script.zs
// MCItemStackMutable as ItemLike
myMCItemStackMutable as ItemLike

Return Type: ItemLike

implicit as MapData
script.zs
// MCItemStackMutable as MapData
myMCItemStackMutable as MapData

Return Type: MapData

asVanillaIngredient() as Ingredient
Create a Vanilla ingredient matching this one.
script.zs
// MCItemStackMutable.asVanillaIngredient() as Ingredient;
myMCItemStackMutable.asVanillaIngredient();

Return Type: Ingredient

implicit as Ingredient
Create a Vanilla ingredient matching this one.
script.zs
// MCItemStackMutable as Ingredient
myMCItemStackMutable as Ingredient

Return Type: Ingredient

implicit as Percentaged<IItemStack>
script.zs
// MCItemStackMutable as Percentaged<IItemStack>
myMCItemStackMutable as Percentaged<IItemStack>

Return Type: Percentaged<IItemStack>

Field
script.zs
// MCItemStackMutable.BASE_ATTACK_DAMAGE_UUID as UUID
MCItemStackMutable.BASE_ATTACK_DAMAGE_UUID

Return Type: UUID

Field
script.zs
// MCItemStackMutable.BASE_ATTACK_SPEED_UUID as UUID
MCItemStackMutable.BASE_ATTACK_SPEED_UUID

Return Type: UUID

Getter
Gets the base repair cost of the ItemStack, or 0 if no repair is defined.
script.zs
// MCItemStackMutable.baseRepairCost as int
myMCItemStackMutable.baseRepairCost

Return Type: int

Getter
script.zs
// MCItemStackMutable.burnTime as int
myMCItemStackMutable.burnTime

Return Type: int

Setter
Sets the burn time of this ingredient, for use in the furnace and other machines
script.zs
// MCItemStackMutable.burnTime = (time as int);
myMCItemStackMutable.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
// MCItemStackMutable.burnTime(time as int);
myMCItemStackMutable.burnTime(500);

Parameters:

time Type: int - the new burn time
clearTooltip(leaveName as bool = false)
script.zs
// MCItemStackMutable.clearTooltip(leaveName as bool = false);
myMCItemStackMutable.clearTooltip(myBool);

Parameters:

leaveName (optional) Type: bool

Default Value: false

Getter
Returns the BEP to get this stack
script.zs
// MCItemStackMutable.commandString as string
myMCItemStackMutable.commandString

Return Type: string

Getter
Returns the BEP to get this thingy
script.zs
// MCItemStackMutable.commandString as string
myMCItemStackMutable.commandString

Return Type: string

commandString() as string
Returns the BEP to get this thingy
script.zs
// MCItemStackMutable.commandString() as string;
myMCItemStackMutable.commandString();

Return Type: string

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

Parameters:

ingredient Type: IIngredient - The ingredient to check

Return Type: bool

Field
script.zs
// MCItemStackMutable.CRAFTTWEAKER_DATA_KEY as string
MCItemStackMutable.CRAFTTWEAKER_DATA_KEY

Return Type: string

Getter
script.zs
// MCItemStackMutable.damage as int
myMCItemStackMutable.damage

Return Type: int

Getter
Returns if the ItemStack is damageable I.E Swords and tools are damageable, sticks are not.
script.zs
// MCItemStackMutable.damageableItem as bool
myMCItemStackMutable.damageableItem

Return Type: bool

Getter
Returns if the ItemStack is damaged I.E a Swords that is no at full durability is damaged.
script.zs
// MCItemStackMutable.damaged as bool
myMCItemStackMutable.damaged

Return Type: bool

Getter
script.zs
// MCItemStackMutable.definition as Item
myMCItemStackMutable.definition

Return Type: ItemDefinition

definition() as Item
script.zs
// MCItemStackMutable.definition() as Item;
myMCItemStackMutable.definition();

Return Type: ItemDefinition

implicit as Item
script.zs
// MCItemStackMutable as Item
myMCItemStackMutable as Item

Return Type: ItemDefinition

Getter
Returns the unlocalized Name of the Item in the ItemStack
script.zs
// MCItemStackMutable.descriptionId as string
myMCItemStackMutable.descriptionId

Return Type: string

Getter
Gets the display name of the ItemStack
script.zs
// MCItemStackMutable.displayName as Component
myMCItemStackMutable.displayName

Return Type: Component

Getter
Checks if this ingredient is empty.
script.zs
// MCItemStackMutable.empty as bool
myMCItemStackMutable.empty

Return Type: bool

empty() as bool
Checks if this ingredient is empty.

Returns: true if empty, false otherwise

script.zs
// MCItemStackMutable.empty() as bool;
myMCItemStackMutable.empty();

Return Type: bool

Getter
script.zs
// MCItemStackMutable.enchantments as Integer[Enchantment]
myMCItemStackMutable.enchantments

Return Type: Integer[Enchantment]

Setter
Sets the enchantments on this IItemStack.
script.zs
// MCItemStackMutable.enchantments = (enchantments as Integer[Enchantment]);
myMCItemStackMutable.enchantments = myMap;

Parameters:

enchantments Type: Integer[Enchantment] - The new enchantments
enchantments() as Integer[Enchantment]
script.zs
// MCItemStackMutable.enchantments() as Integer[Enchantment];
myMCItemStackMutable.enchantments();

Return Type: Integer[Enchantment]

enchantments(enchantments as Integer[Enchantment]) as IItemStack
Sets the enchantments on this IItemStack.

Returns: This itemStack if it is mutable, a new one with the enchantments otherwise

script.zs
// MCItemStackMutable.enchantments(enchantments as Integer[Enchantment]) as IItemStack;
myMCItemStackMutable.enchantments(myMap);

Parameters:

enchantments Type: Integer[Enchantment] - The new enchantments

Return Type: IItemStack

Getter
Checks if this IItemStack burns when thrown into fire / lava or damaged by fire.
script.zs
// MCItemStackMutable.fireResistant as bool
myMCItemStackMutable.fireResistant

Return Type: bool

Setter
Sets if this IItemStack is immune to fire / lava.
If true, the item will not burn when thrown into fire or lava.
script.zs
// MCItemStackMutable.fireResistant = (fireResistant as bool);
myMCItemStackMutable.fireResistant = myBool;

Parameters:

fireResistant Type: bool - Should the item be immune to fire.
fireResistant() as bool
Checks if this IItemStack burns when thrown into fire / lava or damaged by fire.

Returns: True if this IItemStack is immune to fire. False otherwise.

script.zs
// MCItemStackMutable.fireResistant() as bool;
myMCItemStackMutable.fireResistant();

Return Type: bool

fireResistant(fireResistant as bool)
Sets if this IItemStack is immune to fire / lava.
If true, the item will not burn when thrown into fire or lava.
script.zs
// MCItemStackMutable.fireResistant(fireResistant as bool);
myMCItemStackMutable.fireResistant(myBool);

Parameters:

fireResistant Type: bool - Should the item be immune to fire.
Getter
script.zs
// MCItemStackMutable.food as FoodProperties
myMCItemStackMutable.food

Return Type: FoodProperties

Setter
script.zs
// MCItemStackMutable.food = (food as FoodProperties);
myMCItemStackMutable.food = myFoodProperties;

Parameters:

food() as FoodProperties
script.zs
// MCItemStackMutable.food() as FoodProperties;
myMCItemStackMutable.food();

Return Type: FoodProperties

food(food as FoodProperties)
script.zs
// MCItemStackMutable.food(food as FoodProperties);
myMCItemStackMutable.food(myFoodProperties);

Parameters:

getAttributes(slotType as EquipmentSlot) as List<AttributeModifier>[Attribute]
Gets the Attributes and the AttributeModifiers on this IItemStack for the given EquipmentSlot

Returns: A Map of Attribute to a List of AttributeModifier for the given EquipmentSlot.

script.zs
// MCItemStackMutable.getAttributes(slotType as EquipmentSlot) as List<AttributeModifier>[Attribute];
myMCItemStackMutable.getAttributes(<constant:minecraft:equipmentslot:chest>);

Parameters:

slotType Type: EquipmentSlot - The slot to get the Attributes for.

Return Type: List<AttributeModifier>[Attribute]

getBurnTime(manager as IRecipeManager<Recipe>) as int
script.zs
// MCItemStackMutable.getBurnTime(manager as IRecipeManager<Recipe>) as int;
myMCItemStackMutable.getBurnTime(myIRecipeManager);

Parameters:

Return Type: int

getEnchantmentLevel(enchantment as Enchantment) as int
Gets the level of the given enchantment on the item. Returns 0 if the item doesn't have the given enchantment.
script.zs
// MCItemStackMutable.getEnchantmentLevel(enchantment as Enchantment) as int;
myMCItemStackMutable.getEnchantmentLevel(myEnchantment);

Parameters:

enchantment Type: Enchantment

Return Type: int

getImmutableInternal() as ItemStack
script.zs
// MCItemStackMutable.getImmutableInternal() as ItemStack;
myMCItemStackMutable.getImmutableInternal();

Return Type: ItemStack

getOrCreateTag() as IData
Returns the NBT tag attached to this ItemStack or makes a new tag.

Returns: MapData of the ItemStack NBT Tag, empty tag if it doesn't exist.

script.zs
// MCItemStackMutable.getOrCreateTag() as IData;
myMCItemStackMutable.getOrCreateTag();

Return Type: IData

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
// MCItemStackMutable.getRemainingItem(stack as IItemStack) as IItemStack;
myMCItemStackMutable.getRemainingItem(<item:minecraft:iron_ingot>);

Parameters:

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

Return Type: IItemStack

grow(amount as int = 1) as IItemStack
Grows this IItemStack's stack size by the given amount, or 1 if no amount is given.

Returns: This IItemStack if mutable, a new one with the new amount otherwise.

script.zs
// MCItemStackMutable.grow(amount as int = 1) as IItemStack;
myMCItemStackMutable.grow(2);

Parameters:

amount (optional) Type: int - The amount to grow by.

Default Value: 1

Return Type: IItemStack

Getter
Returns true if the ItemStack has a display name.
script.zs
// MCItemStackMutable.hasCustomHoverName as bool
myMCItemStackMutable.hasCustomHoverName

Return Type: bool

Getter
Returns true if this ItemStack has a foil effect.
Foil is the glint / effect that is added to enchanted ItemStacks (and other items).
script.zs
// MCItemStackMutable.hasFoil as bool
myMCItemStackMutable.hasFoil

Return Type: bool

Getter
Returns true if this ItemStack has a Tag
script.zs
// MCItemStackMutable.hasTag as bool
myMCItemStackMutable.hasTag

Return Type: bool

Getter
Gets the hover name of the ItemStack.

This will give the raw name without the formatting that 'displayName' applies.

script.zs
// MCItemStackMutable.hoverName as Component
myMCItemStackMutable.hoverName

Return Type: Component

hoverName() as Component
Gets the hover name of the ItemStack.

This will give the raw name without the formatting that 'displayName' applies.

Returns: The hover name of the ItemStack.

script.zs
// MCItemStackMutable.hoverName() as Component;
myMCItemStackMutable.hoverName();

Return Type: Component

Getter
The backing ingredient
script.zs
// MCItemStackMutable.ingredient as IIngredient
myMCItemStackMutable.ingredient

Return Type: IIngredient

Getter
script.zs
// MCItemStackMutable.isEdible as bool
myMCItemStackMutable.isEdible

Return Type: bool

isEdible() as bool
script.zs
// MCItemStackMutable.isEdible() as bool;
myMCItemStackMutable.isEdible();

Return Type: bool

Getter
Can this ItemStack be enchanted?
script.zs
// MCItemStackMutable.isEnchantable as bool
myMCItemStackMutable.isEnchantable

Return Type: bool

Getter
Is this ItemStack enchanted?
script.zs
// MCItemStackMutable.isEnchanted as bool
myMCItemStackMutable.isEnchanted

Return Type: bool

Getter
script.zs
// MCItemStackMutable.isMutable as bool
myMCItemStackMutable.isMutable

Return Type: bool

isMutable() as bool
script.zs
// MCItemStackMutable.isMutable() as bool;
myMCItemStackMutable.isMutable();

Return Type: bool

matches(stack as IItemStack) as bool
Does the given stack match the ingredient?
script.zs
// MCItemStackMutable.matches(stack as IItemStack) as bool;
myMCItemStackMutable.matches(<item:minecraft:iron_ingot>);

Parameters:

stack Type: IItemStack - The stack to check

Return Type: bool

matches(stack as IItemStack, ignoreDamage as bool) as bool
Does the given stack match the ingredient?
script.zs
// MCItemStackMutable.matches(stack as IItemStack, ignoreDamage as bool) as bool;
myMCItemStackMutable.matches(<item:minecraft:iron_ingot>, myBool);

Parameters:

stack Type: IItemStack - The stack to check
ignoreDamage Type: bool - Should damage be checked?

Return Type: bool

Getter
Returns the max damage of the ItemStack This is the max durability of the ItemStack.
script.zs
// MCItemStackMutable.maxDamage as int
myMCItemStackMutable.maxDamage

Return Type: int

Setter
Sets the max damage of the ItemStack.
Setting the damage to 0 will make the item unbreakable.
script.zs
// MCItemStackMutable.maxDamage = (newMaxDamage as int);
myMCItemStackMutable.maxDamage = myInt;

Parameters:

newMaxDamage Type: int - The new max damage of the ItemStack
Getter
Returns the max stack size of the Item in the ItemStack
script.zs
// MCItemStackMutable.maxStackSize as int
myMCItemStackMutable.maxStackSize

Return Type: int

Setter
Sets the max stacksize of the Item.
script.zs
// MCItemStackMutable.maxStackSize = (newMaxStackSize as int);
myMCItemStackMutable.maxStackSize = myInt;

Parameters:

newMaxStackSize Type: int - The new max stack size of the Item.
maxStackSize() as int
Returns the max stack size of the Item in the ItemStack

Returns: Max stack size of the Item.

script.zs
// MCItemStackMutable.maxStackSize() as int;
myMCItemStackMutable.maxStackSize();

Return Type: int

maxStackSize(newMaxStackSize as int)
Sets the max stacksize of the Item.
script.zs
// MCItemStackMutable.maxStackSize(newMaxStackSize as int);
myMCItemStackMutable.maxStackSize(16);

Parameters:

newMaxStackSize Type: int - The new max stack size of the Item.
modifyShiftTooltip(shiftedFunction as ITooltipFunction, unshiftedFunction as ITooltipFunction = null)
script.zs
// MCItemStackMutable.modifyShiftTooltip(shiftedFunction as ITooltipFunction, unshiftedFunction as ITooltipFunction = null);
myMCItemStackMutable.modifyShiftTooltip(myITooltipFunction, myITooltipFunction);

Parameters:

shiftedFunction Type: ITooltipFunction
unshiftedFunction (optional) Type: ITooltipFunction

Default Value: null

modifyTooltip(function as ITooltipFunction)
script.zs
// MCItemStackMutable.modifyTooltip(function as ITooltipFunction);
myMCItemStackMutable.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
// MCItemStackMutable.mul(amount as int) as IIngredientWithAmount;
myMCItemStackMutable.mul(myInt);

Parameters:

amount Type: int

Return Type: IIngredientWithAmount

only(condition as IIngredientCondition<IIngredient>) as IIngredientConditioned<IIngredient>
Use this if you already have the condition from another ingredient
script.zs
// MCItemStackMutable.only(condition as IIngredientCondition<IIngredient>) as IIngredientConditioned<IIngredient>;
myMCItemStackMutable.only(myIIngredientCondition);

Return Type: IngredientConditioned<IIngredient>

onlyDamaged() as IIngredientConditioned<IIngredient>
script.zs
// MCItemStackMutable.onlyDamaged() as IIngredientConditioned<IIngredient>;
myMCItemStackMutable.onlyDamaged();

Return Type: IngredientConditioned<IIngredient>

onlyDamagedAtLeast(minDamage as int) as IIngredientConditioned<IIngredient>
script.zs
// MCItemStackMutable.onlyDamagedAtLeast(minDamage as int) as IIngredientConditioned<IIngredient>;
myMCItemStackMutable.onlyDamagedAtLeast(myInt);

Parameters:

minDamage Type: int

Return Type: IngredientConditioned<IIngredient>

onlyDamagedAtMost(maxDamage as int) as IIngredientConditioned<IIngredient>
script.zs
// MCItemStackMutable.onlyDamagedAtMost(maxDamage as int) as IIngredientConditioned<IIngredient>;
myMCItemStackMutable.onlyDamagedAtMost(myInt);

Parameters:

maxDamage Type: int

Return Type: IngredientConditioned<IIngredient>

onlyIf(uid as string, function as function(t as IItemStack) as bool = null) as IIngredientConditioned<IIngredient>
script.zs
// MCItemStackMutable.onlyIf(uid as string, function as function(t as IItemStack) as bool = null) as IIngredientConditioned<IIngredient>;
myMCItemStackMutable.onlyIf(myString, myPredicate);

Parameters:

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

Default Value: null

Return Type: IngredientConditioned<IIngredient>

Getter
Gets owning mod for the Item in this IItemStack
script.zs
// MCItemStackMutable.owner as string
myMCItemStackMutable.owner

Return Type: string

percent(percentage as double) as Percentaged<IItemStack>
script.zs
// MCItemStackMutable.percent(percentage as double) as Percentaged<IItemStack>;
myMCItemStackMutable.percent(myDouble);

Parameters:

percentage Type: double

Return Type: Percentaged<IItemStack>

Getter
Returns the rarity of the Item in the ItemStack
script.zs
// MCItemStackMutable.rarity as Rarity
myMCItemStackMutable.rarity

Return Type: Rarity

Setter
Sets the rarity of the Item.
script.zs
// MCItemStackMutable.rarity = (newRarity as Rarity);
myMCItemStackMutable.rarity = myRarity;

Parameters:

newRarity Type: Rarity - The new rarity of the Item.
rarity() as Rarity
Returns the rarity of the Item in the ItemStack

Returns: Rarity of the Item.

script.zs
// MCItemStackMutable.rarity() as Rarity;
myMCItemStackMutable.rarity();

Return Type: Rarity

rarity(newRarity as Rarity)
Sets the rarity of the Item.
script.zs
// MCItemStackMutable.rarity(newRarity as Rarity);
myMCItemStackMutable.rarity(Rarity.UNCOMMON);

Parameters:

newRarity Type: Rarity - The new rarity of the Item.
Getter
Gets the registry name for the Item in this IItemStack
script.zs
// MCItemStackMutable.registryName as ResourceLocation
myMCItemStackMutable.registryName

Return Type: ResourceLocation

removeEnchantment(enchantment as Enchantment) as IItemStack
Removes the given enchantment from this IItemStack.

Returns: This itemStack if it is mutable, a new one with the enchantment removed otherwise

script.zs
// MCItemStackMutable.removeEnchantment(enchantment as Enchantment) as IItemStack;
myMCItemStackMutable.removeEnchantment(<enchantment:minecraft:riptide>);

Parameters:

enchantment Type: Enchantment - The enchantment to remove.

Return Type: IItemStack

removeGlobalAttribute(attribute as Attribute, slotTypes as EquipmentSlot[])
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.
script.zs
// MCItemStackMutable.removeGlobalAttribute(attribute as Attribute, slotTypes as EquipmentSlot[]);
myMCItemStackMutable.removeGlobalAttribute(<attribute:minecraft:generic.attack_damage>, [<constant:minecraft:equipmentslot:chest>]);

Parameters:

attribute Type: Attribute - The attribute to remove.
slotTypes Type: EquipmentSlot[] - The slot types to remove it from.
removeGlobalAttributeModifier(uuid as string, slotTypes as EquipmentSlot[])
Removes all AttributeModifiers who's ID is the same as the given uuid from this IIngredient.
script.zs
// MCItemStackMutable.removeGlobalAttributeModifier(uuid as string, slotTypes as EquipmentSlot[]);
myMCItemStackMutable.removeGlobalAttributeModifier("8c1b5535-9f79-448b-87ae-52d81480aaa3", [<constant:minecraft:equipmentslot:chest>]);

Parameters:

uuid Type: string - The unique id of the AttributeModifier to remove.
slotTypes Type: EquipmentSlot[] - The slot types to remove it from.
removeGlobalAttributeModifier(uuid as UUID, slotTypes as EquipmentSlot[])
Removes all AttributeModifiers who's ID is the same as the given uuid from this IIngredient.
script.zs
// MCItemStackMutable.removeGlobalAttributeModifier(uuid as UUID, slotTypes as EquipmentSlot[]);
myMCItemStackMutable.removeGlobalAttributeModifier(IItemStack.BASE_ATTACK_DAMAGE_UUID, [<constant:minecraft:equipmentslot:chest>]);

Parameters:

uuid Type: UUID - The unique id of the AttributeModifier to remove.
slotTypes Type: EquipmentSlot[] - The slot types to remove it from.
removeTooltip(regex as string)
script.zs
// MCItemStackMutable.removeTooltip(regex as string);
myMCItemStackMutable.removeTooltip(myString);

Parameters:

regex Type: string
resetHoverName()
Clears any custom name set for this ItemStack
script.zs
// MCItemStackMutable.resetHoverName();
myMCItemStackMutable.resetHoverName();
reuse() as IIngredientTransformed<IIngredient>
script.zs
// MCItemStackMutable.reuse() as IIngredientTransformed<IIngredient>;
myMCItemStackMutable.reuse();

Return Type: IIngredientTransformed<IIngredient>

setBurnTime(time as int, manager as IRecipeManager<Recipe>)
Sets the burn time of this ingredient, for use in the furnace and other machines
script.zs
// MCItemStackMutable.setBurnTime(time as int, manager as IRecipeManager<Recipe>);
myMCItemStackMutable.setBurnTime(500, myIRecipeManager);

Parameters:

time Type: int - the new burn time
shrink(amount as int = 1) as IItemStack
Shrinks this IItemStack's stack size by the given amount, or 1 if no amount is given.

Returns: This IItemStack if mutable, a new one with the new amount otherwise.

script.zs
// MCItemStackMutable.shrink(amount as int = 1) as IItemStack;
myMCItemStackMutable.shrink(2);

Parameters:

amount (optional) Type: int - The amount to shrink by.

Default Value: 1

Return Type: IItemStack

Getter
Returns if the ItemStack can have an amount greater than 1 I.E Swords and tools are not stackable, sticks are.
script.zs
// MCItemStackMutable.stackable as bool
myMCItemStackMutable.stackable

Return Type: bool

Getter
Returns the NBT tag attached to this ItemStack.
script.zs
// MCItemStackMutable.tag as IData
myMCItemStackMutable.tag

Return Type: IData

transform(transformer as IIngredientTransformer<IIngredient>) as IIngredientTransformed<IIngredient>
Use this if you already have the transformer from another ingredient
script.zs
// MCItemStackMutable.transform(transformer as IIngredientTransformer<IIngredient>) as IIngredientTransformed<IIngredient>;
myMCItemStackMutable.transform(myIIngredientTransformer);

Return Type: IIngredientTransformed<IIngredient>

transformCustom(uid as string, function as function(r as IItemStack) as IItemStack = null) as IIngredientTransformed<IIngredient>
script.zs
// MCItemStackMutable.transformCustom(uid as string, function as function(r as IItemStack) as IItemStack = null) as IIngredientTransformed<IIngredient>;
myMCItemStackMutable.transformCustom(myString, myFunction);

Parameters:

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

Default Value: null

Return Type: IIngredientTransformed<IIngredient>

transformDamage(amount as int = 1) as IIngredientTransformed<IIngredient>
script.zs
// MCItemStackMutable.transformDamage(amount as int = 1) as IIngredientTransformed<IIngredient>;
myMCItemStackMutable.transformDamage(myInt);

Parameters:

amount (optional) Type: int

Default Value: 1

Return Type: IIngredientTransformed<IIngredient>

transformReplace(replaceWith as IItemStack) as IIngredientTransformed<IIngredient>
script.zs
// MCItemStackMutable.transformReplace(replaceWith as IItemStack) as IIngredientTransformed<IIngredient>;
myMCItemStackMutable.transformReplace(myIItemStack);

Parameters:

replaceWith Type: IItemStack

Return Type: IIngredientTransformed<IIngredient>

Getter
Gets the use duration of the ItemStack
script.zs
// MCItemStackMutable.useDuration as int
myMCItemStackMutable.useDuration

Return Type: int

Getter
Returns true if this stack is considered a crossbow item
script.zs
// MCItemStackMutable.useOnRelease as bool
myMCItemStackMutable.useOnRelease

Return Type: bool

withAttributeModifier(attribute as Attribute, uuid as string, name as string, value as double, operation as Operation, slotTypes as EquipmentSlot[], preserveDefaults as bool = false) as IItemStack
Adds an AttributeModifier to this IItemStack 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 will only appear on this specific IItemStack.
By defaults, adding a modifier will remove the default Attribute Modifiers on the Item, like the Diamond Chestplate's Armor and Toughness values. When preserveDefaults is set to true (by default it is false.), the default Attribute Modifiers will be preserved when adding this modifier. This means that if you were adding the forge:nametag_distance attribute to an Item, it would keep its default attributes (like Armor and Toughness values).
script.zs
// MCItemStackMutable.withAttributeModifier(attribute as Attribute, uuid as string, name as string, value as double, operation as Operation, slotTypes as EquipmentSlot[], preserveDefaults as bool = false) as IItemStack;
myMCItemStackMutable.withAttributeModifier(<attribute:minecraft:generic.attack_damage>, "8c1b5535-9f79-448b-87ae-52d81480aaa3", "Extra Power", 10, AttributeOperation.ADDITION, [<constant:minecraft:equipmentslot:chest>], true);

Parameters:

attribute Type: Attribute - The Attribute of the modifier.
uuid Type: string - The unique identifier of the modifier to replace.
name Type: string - The name of the modifier.
value Type: double - The value of the modifier.
operation Type: AttributeOperation - The operation of the modifier.
slotTypes Type: EquipmentSlot[] - What slots the modifier is valid for.
preserveDefaults (optional) Type: bool - Should the default Item Attribute Modifiers be preserved when adding this modifier.

Default Value: false

Return Type: IItemStack

withAttributeModifier(attribute as Attribute, uuid as UUID, name as string, value as double, operation as Operation, slotTypes as EquipmentSlot[], preserveDefaults as bool = false) as IItemStack
Adds an AttributeModifier to this IItemStack 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 will only appear on this specific IItemStack.
By defaults, adding a modifier will remove the default Attribute Modifiers on the Item, like the Diamond Chestplate's Armor and Toughness values. When preserveDefaults is set to true (by default it is false.), the default Attribute Modifiers will be preserved when adding this modifier. This means that if you were adding the forge:nametag_distance attribute to an Item, it would keep its default attributes (like Armor and Toughness values).
script.zs
// MCItemStackMutable.withAttributeModifier(attribute as Attribute, uuid as UUID, name as string, value as double, operation as Operation, slotTypes as EquipmentSlot[], preserveDefaults as bool = false) as IItemStack;
myMCItemStackMutable.withAttributeModifier(<attribute:minecraft:generic.attack_damage>, "8c1b5535-9f79-448b-87ae-52d81480aaa3", "Extra Power", 10, AttributeOperation.ADDITION, [<constant:minecraft:equipmentslot:chest>], true);

Parameters:

attribute Type: Attribute - The Attribute of the modifier.
uuid Type: UUID - The unique identifier of the modifier to replace.
name Type: string - The name of the modifier.
value Type: double - The value of the modifier.
operation Type: AttributeOperation - The operation of the modifier.
slotTypes Type: EquipmentSlot[] - What slots the modifier is valid for.
preserveDefaults (optional) Type: bool - Should the default Item Attribute Modifiers be preserved when adding this modifier.

Default Value: false

Return Type: IItemStack

withAttributeModifier(attribute as Attribute, name as string, value as double, operation as Operation, slotTypes as EquipmentSlot[], preserveDefaults as bool = false) as IItemStack
Adds an AttributeModifier to this IItemStack.
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 will only appear on this specific IItemStack.
By defaults, adding a modifier will remove the default Attribute Modifiers on the Item, like the Diamond Chestplate's Armor and Toughness values. When preserveDefaults is set to true (by default it is false.), the default Attribute Modifiers will be preserved when adding this modifier. This means that if you were adding the forge:nametag_distance attribute to an Item, it would keep its default attributes (like Armor and Toughness values).
script.zs
// MCItemStackMutable.withAttributeModifier(attribute as Attribute, name as string, value as double, operation as Operation, slotTypes as EquipmentSlot[], preserveDefaults as bool = false) as IItemStack;
myMCItemStackMutable.withAttributeModifier(<attribute:minecraft:generic.attack_damage>, "Extra Power", 10, AttributeOperation.ADDITION, [<constant:minecraft:equipmentslot:chest>], true);

Parameters:

attribute Type: Attribute - The Attribute of the modifier.
name Type: string - The name of the modifier.
value Type: double - The value of the modifier.
operation Type: AttributeOperation - The operation of the modifier.
slotTypes Type: EquipmentSlot[] - What slots the modifier is valid for.
preserveDefaults (optional) Type: bool - Should the default Item Attribute Modifiers be preserved when adding this modifier.

Default Value: false

Return Type: IItemStack

withDamage(damage as int) as IItemStack
Sets the damage of the ItemStack
script.zs
// MCItemStackMutable.withDamage(damage as int) as IItemStack;
myMCItemStackMutable.withDamage(10);

Parameters:

damage Type: int - the new damage value

Return Type: IItemStack

withDisplayName(name as Component) as IItemStack
Sets the display name of the ItemStack
script.zs
// MCItemStackMutable.withDisplayName(name as Component) as IItemStack;
myMCItemStackMutable.withDisplayName("totally not dirt");

Parameters:

name Type: Component - New name of the stack.

Return Type: IItemStack

withEnchantment(enchantment as Enchantment, level as int = 1) as IItemStack
Enchants this IItemStack with the given Enchantment.

Returns: This itemStack if it is mutable, a new one with the enchantment added otherwise

script.zs
// MCItemStackMutable.withEnchantment(enchantment as Enchantment, level as int = 1) as IItemStack;
myMCItemStackMutable.withEnchantment(<enchantment:minecraft:riptide>, 2);

Parameters:

enchantment Type: Enchantment - The enchantment to add.
level (optional) Type: int - The level of the enchantment

Default Value: 1

Return Type: IItemStack

withLore(lore as Component[]) as IItemStack
Sets the lore of the ItemStack
script.zs
// MCItemStackMutable.withLore(lore as Component[]) as IItemStack;
myMCItemStackMutable.withLore(new crafttweaker.api.text.TextComponent("I am the lore I speak for the trees"););

Parameters:

lore Type: Component[] - the new Lore of the ItemStack.

Return Type: IItemStack

withoutTag() as IItemStack
Removes the tag from this ItemStack.

Returns: This itemStack if it is mutable, a new one with the changed property otherwise

script.zs
// MCItemStackMutable.withoutTag() as IItemStack;
myMCItemStackMutable.withoutTag();

Return Type: IItemStack

withTag(tag as MapData) as IItemStack
Sets the tag for the ItemStack.

Returns: This itemStack if it is mutable, a new one with the changed property otherwise

script.zs
// MCItemStackMutable.withTag(tag as MapData) as IItemStack;
myMCItemStackMutable.withTag({Display: {lore: ["Hello"]}});

Parameters:

tag Type: MapData - The tag to set.

Return Type: IItemStack