FabricItemStack

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.FabricItemStack;

Implements

FabricItemStack implements the following interfaces:

IItemStack,IIngredient,IIngredientWithAmount,DataComponentHolder,ComponentAccess<IItemStack>,CommandStringDisplayable

Operators

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

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

Parameters:

amount Type: int

Return Type: IIngredientWithAmount

|(other as IIngredient) as IIngredientList
script.zs
// (FabricItemStack | (other as IIngredient)) as IIngredientList
myFabricItemStack | myIIngredient

Parameters:

other Type: IIngredient

Return Type: IIngredientList

%(percentage as double) as Percentaged<IItemStack>
script.zs
// (FabricItemStack % (percentage as double)) as Percentaged<IItemStack>
myFabricItemStack % myDouble

Parameters:

percentage Type: double

Return Type: Percentaged<IItemStack>

*(amount as int) as IItemStack
Sets the amount of the ItemStack
script.zs
// (FabricItemStack * (amount as int)) as IItemStack
myFabricItemStack * 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
// FabricItemStack.addGlobalAttributeModifier(attribute as Attribute, name as string, value as double, operation as Operation, slotTypes as EquipmentSlot[]);
myFabricItemStack.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
// FabricItemStack.addGlobalAttributeModifier(attribute as Attribute, uuid as string, name as string, value as double, operation as Operation, slotTypes as EquipmentSlot[]);
myFabricItemStack.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
// FabricItemStack.addGlobalAttributeModifier(attribute as Attribute, uuid as UUID, name as string, value as double, operation as Operation, slotTypes as EquipmentSlot[]);
myFabricItemStack.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
// FabricItemStack.addShiftTooltip(content as Component, showMessage as Component = null);
myFabricItemStack.addShiftTooltip(myComponent, myComponent);

Parameters:

content Type: Component
showMessage (optional) Type: Component

Default Value: null

addTooltip(content as Component)
script.zs
// FabricItemStack.addTooltip(content as Component);
myFabricItemStack.addTooltip(myComponent);

Parameters:

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

Return Type: int

Getter
Gets the amount of Items in the ItemStack
script.zs
// FabricItemStack.amount as int
myFabricItemStack.amount

Return Type: int

anyDamage() as IIngredient
script.zs
// FabricItemStack.anyDamage() as IIngredient;
myFabricItemStack.anyDamage();

Return Type: IIngredient

applyComponents(map as DataComponentMap) as IItemStack
script.zs
// FabricItemStack.applyComponents(map as DataComponentMap) as IItemStack;
myFabricItemStack.applyComponents(myDataComponentMap);

Parameters:

Return Type: IItemStack

applyComponents(patch as DataComponentPatch) as IItemStack
script.zs
// FabricItemStack.applyComponents(patch as DataComponentPatch) as IItemStack;
myFabricItemStack.applyComponents(myDataComponentPatch);

Parameters:

Return Type: IItemStack

applyComponentsAndValidate(patch as DataComponentPatch) as IItemStack
script.zs
// FabricItemStack.applyComponentsAndValidate(patch as DataComponentPatch) as IItemStack;
myFabricItemStack.applyComponentsAndValidate(myDataComponentPatch);

Parameters:

Return Type: IItemStack

asIData() as IData
script.zs
// FabricItemStack.asIData() as IData;
myFabricItemStack.asIData();

Return Type: IData

implicit as IData
script.zs
// FabricItemStack as IData
myFabricItemStack as IData

Return Type: IData

implicit as IData
script.zs
// FabricItemStack as IData
myFabricItemStack as IData

Return Type: IData

asIIngredientWithAmount() as IIngredientWithAmount
script.zs
// FabricItemStack.asIIngredientWithAmount() as IIngredientWithAmount;
myFabricItemStack.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
// FabricItemStack.asIIngredientWithAmount() as IIngredientWithAmount;
myFabricItemStack.asIIngredientWithAmount();

Return Type: IIngredientWithAmount

implicit as IIngredientWithAmount
script.zs
// FabricItemStack as IIngredientWithAmount
myFabricItemStack 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
// FabricItemStack as IIngredientWithAmount
myFabricItemStack as IIngredientWithAmount

Return Type: IIngredientWithAmount

asImmutable() as IItemStack
script.zs
// FabricItemStack.asImmutable() as IItemStack;
myFabricItemStack.asImmutable();

Return Type: IItemStack

asItemLike() as ItemLike
script.zs
// FabricItemStack.asItemLike() as ItemLike;
myFabricItemStack.asItemLike();

Return Type: ItemLike

implicit as ItemLike
script.zs
// FabricItemStack as ItemLike
myFabricItemStack as ItemLike

Return Type: ItemLike

implicit as MapData
script.zs
// FabricItemStack as MapData
myFabricItemStack as MapData

Return Type: MapData

asMutable() as IItemStack
script.zs
// FabricItemStack.asMutable() as IItemStack;
myFabricItemStack.asMutable();

Return Type: IItemStack

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

Return Type: Ingredient

implicit as Ingredient
Create a Vanilla ingredient matching this one.
script.zs
// FabricItemStack as Ingredient
myFabricItemStack as Ingredient

Return Type: Ingredient

implicit as Percentaged<IItemStack>
script.zs
// FabricItemStack as Percentaged<IItemStack>
myFabricItemStack as Percentaged<IItemStack>

Return Type: Percentaged<IItemStack>

Getter
Gets the data in &lt;componenttype:minecraft:attribute_modifiers&gt;
script.zs
// FabricItemStack.attributeModifiers as ItemAttributeModifiers
myFabricItemStack.attributeModifiers

Return Type: ItemAttributeModifiers

Getter
script.zs
// FabricItemStack.bannerPatterns as BannerPatternLayers
myFabricItemStack.bannerPatterns

Return Type: BannerPatternLayers

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

Return Type: UUID

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

Return Type: UUID

Getter
script.zs
// FabricItemStack.baseColor as DyeColor
myFabricItemStack.baseColor

Return Type: DyeColor

Getter
script.zs
// FabricItemStack.bees as List<Occupant>
myFabricItemStack.bees

Return Type: List<BeehiveBlockEntityOccupant>

Getter
script.zs
// FabricItemStack.blockEntityData as CustomData
myFabricItemStack.blockEntityData

Return Type: CustomData

Getter
script.zs
// FabricItemStack.blockState as BlockItemStateProperties
myFabricItemStack.blockState

Return Type: BlockItemStateProperties

Getter
script.zs
// FabricItemStack.bucketEntityData as CustomData
myFabricItemStack.bucketEntityData

Return Type: CustomData

Getter
script.zs
// FabricItemStack.bundleContents as BundleContents
myFabricItemStack.bundleContents

Return Type: BundleContents

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

Parameters:

time Type: int - the new burn time
Getter
Gets the data in &lt;componenttype:minecraft:can_break&gt;
script.zs
// FabricItemStack.canBreak as AdventureModePredicate
myFabricItemStack.canBreak

Return Type: AdventureModePredicate

Getter
Gets the data in &lt;componenttype:minecraft:can_place_on&gt;
script.zs
// FabricItemStack.canPlaceOn as AdventureModePredicate
myFabricItemStack.canPlaceOn

Return Type: AdventureModePredicate

Getter
script.zs
// FabricItemStack.chargedProjectiles as ChargedProjectiles
myFabricItemStack.chargedProjectiles

Return Type: ChargedProjectiles

clearTooltip(leaveName as bool = false)
script.zs
// FabricItemStack.clearTooltip(leaveName as bool = false);
myFabricItemStack.clearTooltip(myBool);

Parameters:

leaveName (optional) Type: bool

Default Value: false

Getter
Returns the BEP to get this stack
script.zs
// FabricItemStack.commandString as string
myFabricItemStack.commandString

Return Type: string

Getter
Returns the BEP to get this thingy
script.zs
// FabricItemStack.commandString as string
myFabricItemStack.commandString

Return Type: string

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

Return Type: string

Getter
script.zs
// FabricItemStack.componentsPatch as DataComponentPatch
myFabricItemStack.componentsPatch

Return Type: DataComponentPatch

condition(condition as IIngredientCondition) as IIngredient
Use this if you already have the condition from another ingredient
script.zs
// FabricItemStack.condition(condition as IIngredientCondition) as IIngredient;
myFabricItemStack.condition(myIIngredientCondition);

Parameters:

Return Type: IIngredient

Getter
script.zs
// FabricItemStack.container as ItemContainerContents
myFabricItemStack.container

Return Type: ItemContainerContents

Getter
script.zs
// FabricItemStack.containerLoot as SeededContainerLoot
myFabricItemStack.containerLoot

Return Type: SeededContainerLoot

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

Parameters:

ingredient Type: IIngredient - The ingredient to check

Return Type: bool

copy() as IItemStack
Creates a copy
script.zs
// FabricItemStack.copy() as IItemStack;
myFabricItemStack.copy();

Return Type: IItemStack

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

Return Type: string

Getter
Gets the data in &lt;componenttype:minecraft:creative_slot_lock&gt;
script.zs
// FabricItemStack.creativeSlotLock as bool
myFabricItemStack.creativeSlotLock

Return Type: bool

Getter
Gets the data in the &lt;componenttype:minecraft:custom_data&gt;
script.zs
// FabricItemStack.customData as CustomData
myFabricItemStack.customData

Return Type: CustomData

Getter
Gets the data in &lt;componenttype:minecraft:custom_model_data&gt;
script.zs
// FabricItemStack.customModelData as CustomModelData
myFabricItemStack.customModelData

Return Type: CustomModelData

Getter
Gets the data in the &lt;componenttype:minecraft:custom_name&gt;
A custom name is generally displayed in italics and controlled by the user.
script.zs
// FabricItemStack.customName as Component
myFabricItemStack.customName

Return Type: Component

Getter
Gets the data in the &lt;componenttype:minecraft:damage&gt;
script.zs
// FabricItemStack.damage as int
myFabricItemStack.damage

Return Type: int

Getter
Returns if the ItemStack is damageable I.E Swords and tools are damageable, sticks are not.
script.zs
// FabricItemStack.damageableItem as bool
myFabricItemStack.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
// FabricItemStack.damaged as bool
myFabricItemStack.damaged

Return Type: bool

Getter
script.zs
// FabricItemStack.debugStickState as DebugStickState
myFabricItemStack.debugStickState

Return Type: DebugStickState

Getter
script.zs
// FabricItemStack.definition as Item
myFabricItemStack.definition

Return Type: ItemDefinition

definition() as Item
script.zs
// FabricItemStack.definition() as Item;
myFabricItemStack.definition();

Return Type: ItemDefinition

implicit as Item
script.zs
// FabricItemStack as Item
myFabricItemStack as Item

Return Type: ItemDefinition

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

Return Type: string

Getter
Gets the display name of the ItemStack
script.zs
// FabricItemStack.displayName as Component
myFabricItemStack.displayName

Return Type: Component

Getter
script.zs
// FabricItemStack.dyedColor as DyedItemColor
myFabricItemStack.dyedColor

Return Type: DyedItemColor

Getter
Checks if this ingredient is empty.
script.zs
// FabricItemStack.empty as bool
myFabricItemStack.empty

Return Type: bool

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

Returns: true if empty, false otherwise

script.zs
// FabricItemStack.empty() as bool;
myFabricItemStack.empty();

Return Type: bool

Getter
Gets the data in &lt;componenttype:minecraft:enchantment_glint_override&gt;
If it is present, it is first checked to determine whether there is special behaviour, otherwise the code checks for enchantments.
script.zs
// FabricItemStack.enchantmentGlintOverride as bool
myFabricItemStack.enchantmentGlintOverride

Return Type: bool

Getter
Gets the data in &lt;componenttype:minecraft:enchantments&gt;
script.zs
// FabricItemStack.enchantments as ItemEnchantments
myFabricItemStack.enchantments

Return Type: ItemEnchantments

Getter
script.zs
// FabricItemStack.entityData as CustomData
myFabricItemStack.entityData

Return Type: CustomData

Getter
script.zs
// FabricItemStack.fireworkExplosion as FireworkExplosion
myFabricItemStack.fireworkExplosion

Return Type: FireworkExplosion

Getter
script.zs
// FabricItemStack.fireworks as Fireworks
myFabricItemStack.fireworks

Return Type: Fireworks

Getter
Gets the data in &lt;componenttype:minecraft:food&gt;
script.zs
// FabricItemStack.food as FoodProperties
myFabricItemStack.food

Return Type: FoodProperties

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
// FabricItemStack.getAttributes(slotType as EquipmentSlot) as List<AttributeModifier>[Attribute];
myFabricItemStack.getAttributes(<constant:minecraft:equipmentslot:chest>);

Parameters:

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

Return Type: List<AttributeModifier>[Attribute]

getImmutableInternal() as ItemStack
script.zs
// FabricItemStack.getImmutableInternal() as ItemStack;
myFabricItemStack.getImmutableInternal();

Return Type: ItemStack

getInternal() as ItemStack
Gets the internal ItemStack for this IItemStack.

Returns: internal ItemStack

script.zs
// FabricItemStack.getInternal() as ItemStack;
myFabricItemStack.getInternal();

Return Type: ItemStack

implicit as ItemStack
Gets the internal ItemStack for this IItemStack.
script.zs
// FabricItemStack as ItemStack
myFabricItemStack as ItemStack

Return Type: ItemStack

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
// FabricItemStack.getRemainingItem(stack as IItemStack) as IItemStack;
myFabricItemStack.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
// FabricItemStack.grow(amount as int = 1) as IItemStack;
myFabricItemStack.grow(2);

Parameters:

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

Default Value: 1

Return Type: IItemStack

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:attribute_modifiers&gt;
script.zs
// FabricItemStack.hasAttributeModifiers as bool
myFabricItemStack.hasAttributeModifiers

Return Type: bool

Getter
script.zs
// FabricItemStack.hasBannerPatterns as bool
myFabricItemStack.hasBannerPatterns

Return Type: bool

Getter
script.zs
// FabricItemStack.hasBaseColor as bool
myFabricItemStack.hasBaseColor

Return Type: bool

Getter
script.zs
// FabricItemStack.hasBees as bool
myFabricItemStack.hasBees

Return Type: bool

Getter
script.zs
// FabricItemStack.hasBlockEntityData as bool
myFabricItemStack.hasBlockEntityData

Return Type: bool

Getter
script.zs
// FabricItemStack.hasBlockState as bool
myFabricItemStack.hasBlockState

Return Type: bool

Getter
script.zs
// FabricItemStack.hasBucketEntityData as bool
myFabricItemStack.hasBucketEntityData

Return Type: bool

Getter
script.zs
// FabricItemStack.hasBundleContents as bool
myFabricItemStack.hasBundleContents

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:can_break&gt;
script.zs
// FabricItemStack.hasCanBreak as bool
myFabricItemStack.hasCanBreak

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:can_place_on&gt;
script.zs
// FabricItemStack.hasCanPlaceOn as bool
myFabricItemStack.hasCanPlaceOn

Return Type: bool

Getter
script.zs
// FabricItemStack.hasChargedProjectiles as bool
myFabricItemStack.hasChargedProjectiles

Return Type: bool

Getter
script.zs
// FabricItemStack.hasContainer as bool
myFabricItemStack.hasContainer

Return Type: bool

Getter
script.zs
// FabricItemStack.hasContainerLoot as bool
myFabricItemStack.hasContainerLoot

Return Type: bool

Getter
Checks whether the ComponentAccess has the &lt;componenttype:minecraft:custom_data&gt;
script.zs
// FabricItemStack.hasCustomData as bool
myFabricItemStack.hasCustomData

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:custom_model_data&gt;
script.zs
// FabricItemStack.hasCustomModelData as bool
myFabricItemStack.hasCustomModelData

Return Type: bool

Getter
Checks whether the ComponentAccess has the &lt;componenttype:minecraft:custom_name&gt;
script.zs
// FabricItemStack.hasCustomName as bool
myFabricItemStack.hasCustomName

Return Type: bool

Getter
Checks whether the ComponentAccess has the &lt;componenttype:minecraft:damage&gt;
script.zs
// FabricItemStack.hasDamage as bool
myFabricItemStack.hasDamage

Return Type: bool

Getter
script.zs
// FabricItemStack.hasDebugStickState as bool
myFabricItemStack.hasDebugStickState

Return Type: bool

Getter
script.zs
// FabricItemStack.hasDyedColor as bool
myFabricItemStack.hasDyedColor

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:enchantment_glint_override&gt;
script.zs
// FabricItemStack.hasEnchantmentGlintOverride as bool
myFabricItemStack.hasEnchantmentGlintOverride

Return Type: bool

Getter
Checks whether the ComponentAccess has the &lt;componenttype:minecraft:enchantments&gt;
script.zs
// FabricItemStack.hasEnchantments as bool
myFabricItemStack.hasEnchantments

Return Type: bool

Getter
script.zs
// FabricItemStack.hasEntityData as bool
myFabricItemStack.hasEntityData

Return Type: bool

Getter
script.zs
// FabricItemStack.hasFireworkExplosion as bool
myFabricItemStack.hasFireworkExplosion

Return Type: bool

Getter
script.zs
// FabricItemStack.hasFireworks as bool
myFabricItemStack.hasFireworks

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
// FabricItemStack.hasFoil as bool
myFabricItemStack.hasFoil

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:food&gt;
script.zs
// FabricItemStack.hasFood as bool
myFabricItemStack.hasFood

Return Type: bool

Getter
script.zs
// FabricItemStack.hasInstrument as bool
myFabricItemStack.hasInstrument

Return Type: bool

Getter
Checks whether the ComponentAccess has the &lt;componenttype:minecraft:item_namegt;
script.zs
// FabricItemStack.hasItemName as bool
myFabricItemStack.hasItemName

Return Type: bool

Getter
script.zs
// FabricItemStack.hasLock as bool
myFabricItemStack.hasLock

Return Type: bool

Getter
script.zs
// FabricItemStack.hasLodestoneTracker as bool
myFabricItemStack.hasLodestoneTracker

Return Type: bool

Getter
Checks whether the ComponentAccess has the &lt;componenttype:minecraft:lore&gt;
script.zs
// FabricItemStack.hasLore as bool
myFabricItemStack.hasLore

Return Type: bool

Getter
script.zs
// FabricItemStack.hasMapColor as bool
myFabricItemStack.hasMapColor

Return Type: bool

Getter
script.zs
// FabricItemStack.hasMapDecorations as bool
myFabricItemStack.hasMapDecorations

Return Type: bool

Getter
script.zs
// FabricItemStack.hasMapId as bool
myFabricItemStack.hasMapId

Return Type: bool

Getter
script.zs
// FabricItemStack.hasMapPostProcessing as bool
myFabricItemStack.hasMapPostProcessing

Return Type: bool

Getter
Checks whether the ComponentAccess has the &lt;componenttype:minecraft:max_damage&gt;
script.zs
// FabricItemStack.hasMaxDamage as bool
myFabricItemStack.hasMaxDamage

Return Type: bool

Getter
Checks whether the ComponentAccess has the &lt;componenttype:minecraft:max_stack_size&gt;
script.zs
// FabricItemStack.hasMaxStackSize as bool
myFabricItemStack.hasMaxStackSize

Return Type: bool

Getter
script.zs
// FabricItemStack.hasNoteBlockSound as bool
myFabricItemStack.hasNoteBlockSound

Return Type: bool

Getter
script.zs
// FabricItemStack.hasOminousBottleAmplifier as bool
myFabricItemStack.hasOminousBottleAmplifier

Return Type: bool

Getter
script.zs
// FabricItemStack.hasPotDecorations as bool
myFabricItemStack.hasPotDecorations

Return Type: bool

Getter
script.zs
// FabricItemStack.hasPotionContents as bool
myFabricItemStack.hasPotionContents

Return Type: bool

Getter
script.zs
// FabricItemStack.hasProfile as bool
myFabricItemStack.hasProfile

Return Type: bool

Getter
Checks whether the ComponentAccess has the &lt;componenttype:minecraft:rarity&gt;
script.zs
// FabricItemStack.hasRarity as bool
myFabricItemStack.hasRarity

Return Type: bool

Getter
script.zs
// FabricItemStack.hasRecipes as bool
myFabricItemStack.hasRecipes

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:repair_cost&gt;
script.zs
// FabricItemStack.hasRepairCost as bool
myFabricItemStack.hasRepairCost

Return Type: bool

Getter
script.zs
// FabricItemStack.hasStoredEnchantments as bool
myFabricItemStack.hasStoredEnchantments

Return Type: bool

Getter
script.zs
// FabricItemStack.hasSuspiciousStewEffects as bool
myFabricItemStack.hasSuspiciousStewEffects

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:tool&gt;
script.zs
// FabricItemStack.hasTool as bool
myFabricItemStack.hasTool

Return Type: bool

Getter
script.zs
// FabricItemStack.hasTrim as bool
myFabricItemStack.hasTrim

Return Type: bool

Getter
Checks whether the ComponentAccess has the &lt;componenttype:minecraft:unbreakable&gt;
script.zs
// FabricItemStack.hasUnbreakable as bool
myFabricItemStack.hasUnbreakable

Return Type: bool

Getter
script.zs
// FabricItemStack.hasWritableBookContent as bool
myFabricItemStack.hasWritableBookContent

Return Type: bool

Getter
script.zs
// FabricItemStack.hasWrittenBookContent as bool
myFabricItemStack.hasWrittenBookContent

Return Type: bool

Getter
Gets the data in &lt;componenttype:minecraft:hide_additional_tooltip&gt;
script.zs
// FabricItemStack.hideAdditionalTooltip as bool
myFabricItemStack.hideAdditionalTooltip

Return Type: bool

Getter
Gets the data in &lt;componenttype:minecraft:hide_tooltip&gt;
script.zs
// FabricItemStack.hideTooltip as bool
myFabricItemStack.hideTooltip

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
// FabricItemStack.hoverName as Component
myFabricItemStack.hoverName

Return Type: Component

Getter
The backing ingredient
script.zs
// FabricItemStack.ingredient as IIngredient
myFabricItemStack.ingredient

Return Type: IIngredient

Getter
script.zs
// FabricItemStack.instrument as Instrument
myFabricItemStack.instrument

Return Type: Instrument

Getter
Can this ItemStack be enchanted?
script.zs
// FabricItemStack.isEnchantable as bool
myFabricItemStack.isEnchantable

Return Type: bool

Getter
Gets the data in &lt;componenttype:minecraft:fire_resistant&gt;
script.zs
// FabricItemStack.isFireResistant as bool
myFabricItemStack.isFireResistant

Return Type: bool

Getter
script.zs
// FabricItemStack.isImmutable as bool
myFabricItemStack.isImmutable

Return Type: bool

isImmutable() as bool
script.zs
// FabricItemStack.isImmutable() as bool;
myFabricItemStack.isImmutable();

Return Type: bool

Getter
Gets the data in &lt;componenttype:minecraft:intangible_projectile&gt;
script.zs
// FabricItemStack.isIntangibleProjectile as bool
myFabricItemStack.isIntangibleProjectile

Return Type: bool

Getter
script.zs
// FabricItemStack.isMutable as bool
myFabricItemStack.isMutable

Return Type: bool

isMutable() as bool
script.zs
// FabricItemStack.isMutable() as bool;
myFabricItemStack.isMutable();

Return Type: bool

Getter
Gets the data in the &lt;componenttype:minecraft:custom_name&gt;
In the case of items, an item name is set by the make to make a special instance of an item, such as with ominous banners.
script.zs
// FabricItemStack.itemName as Component
myFabricItemStack.itemName

Return Type: Component

Getter
script.zs
// FabricItemStack.items as IItemStack[]
myFabricItemStack.items

Return Type: IItemStack[]

Getter
script.zs
// FabricItemStack.lockComponent as LockCode
myFabricItemStack.lockComponent

Return Type: LockCode

Getter
script.zs
// FabricItemStack.lodestoneTracker as LodestoneTracker
myFabricItemStack.lodestoneTracker

Return Type: LodestoneTracker

Getter
Gets the data in the &lt;componenttype:minecraft:lore&gt;
script.zs
// FabricItemStack.lore as ItemLore
myFabricItemStack.lore

Return Type: ItemLore

Getter
script.zs
// FabricItemStack.mapColor as MapItemColor
myFabricItemStack.mapColor

Return Type: MapItemColor

Getter
script.zs
// FabricItemStack.mapDecorations as MapDecorations
myFabricItemStack.mapDecorations

Return Type: MapDecorations

Getter
script.zs
// FabricItemStack.mapId as MapId
myFabricItemStack.mapId

Return Type: MapId

Getter
script.zs
// FabricItemStack.mapPostProcessing as MapPostProcessing
myFabricItemStack.mapPostProcessing

Return Type: MapPostProcessing

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

Parameters:

stack Type: IItemStack - The stack to check

Return Type: bool

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

Return Type: int

Getter
Gets the data in the &lt;componenttype:minecraft:max_damage&gt;
script.zs
// FabricItemStack.maxDamage as int
myFabricItemStack.maxDamage

Return Type: int

Getter
Gets the data in the &lt;componenttype:minecraft:max_stack_size&gt;
script.zs
// FabricItemStack.maxStackSize as int
myFabricItemStack.maxStackSize

Return Type: int

modifyShiftTooltip(shiftedFunction as ITooltipFunction, unshiftedFunction as ITooltipFunction = null)
script.zs
// FabricItemStack.modifyShiftTooltip(shiftedFunction as ITooltipFunction, unshiftedFunction as ITooltipFunction = null);
myFabricItemStack.modifyShiftTooltip(myITooltipFunction, myITooltipFunction);

Parameters:

shiftedFunction Type: ITooltipFunction
unshiftedFunction (optional) Type: ITooltipFunction

Default Value: null

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

Parameters:

amount Type: int

Return Type: IIngredientWithAmount

Getter
script.zs
// FabricItemStack.noteBlockSound as ResourceLocation
myFabricItemStack.noteBlockSound

Return Type: ResourceLocation

Getter
script.zs
// FabricItemStack.ominousBottleAmplifier as int
myFabricItemStack.ominousBottleAmplifier

Return Type: int

onlyDamaged() as IIngredient
script.zs
// FabricItemStack.onlyDamaged() as IIngredient;
myFabricItemStack.onlyDamaged();

Return Type: IIngredient

onlyDamagedAtLeast(minDamage as int) as IIngredient
script.zs
// FabricItemStack.onlyDamagedAtLeast(minDamage as int) as IIngredient;
myFabricItemStack.onlyDamagedAtLeast(myInt);

Parameters:

minDamage Type: int

Return Type: IIngredient

onlyDamagedAtMost(maxDamage as int) as IIngredient
script.zs
// FabricItemStack.onlyDamagedAtMost(maxDamage as int) as IIngredient;
myFabricItemStack.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
// FabricItemStack.onlyIf(uid as string, function as function(t as IItemStack) as bool = null) as IIngredient;
myFabricItemStack.onlyIf(myString, myPredicate);

Parameters:

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

Default Value: null

Return Type: IIngredient

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

Return Type: string

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

Parameters:

percentage Type: double

Return Type: Percentaged<IItemStack>

Getter
script.zs
// FabricItemStack.potDecorations as PotDecorations
myFabricItemStack.potDecorations

Return Type: PotDecorations

Getter
script.zs
// FabricItemStack.potionContents as PotionContents
myFabricItemStack.potionContents

Return Type: PotionContents

Getter
script.zs
// FabricItemStack.profile as ResolvableProfile
myFabricItemStack.profile

Return Type: ResolvableProfile

Getter
script.zs
// FabricItemStack.prototype as DataComponentMap
myFabricItemStack.prototype

Return Type: DataComponentMap

Getter
Gets the data in the &lt;componenttype:minecraft:rarity&gt;
script.zs
// FabricItemStack.rarity as Rarity
myFabricItemStack.rarity

Return Type: Rarity

Getter
script.zs
// FabricItemStack.recipes as List<ResourceLocation>
myFabricItemStack.recipes

Return Type: List<ResourceLocation>

Getter
Gets the registry name for the Item in this IItemStack
script.zs
// FabricItemStack.registryName as ResourceLocation
myFabricItemStack.registryName

Return Type: ResourceLocation

remove(type as DataComponentType<T>) as IItemStack
script.zs
// FabricItemStack.remove<T>(type as DataComponentType<T>) as IItemStack;
myFabricItemStack.remove<T>(myDataComponentType);

Parameters:

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
// FabricItemStack.removeGlobalAttribute(attribute as Attribute, slotTypes as EquipmentSlot[]);
myFabricItemStack.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
// FabricItemStack.removeGlobalAttributeModifier(uuid as string, slotTypes as EquipmentSlot[]);
myFabricItemStack.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
// FabricItemStack.removeGlobalAttributeModifier(uuid as UUID, slotTypes as EquipmentSlot[]);
myFabricItemStack.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
// FabricItemStack.removeTooltip(regex as string);
myFabricItemStack.removeTooltip(myString);

Parameters:

regex Type: string
Getter
Gets the data in &lt;componenttype:minecraft:repair_cost&gt;
script.zs
// FabricItemStack.repairCost as int
myFabricItemStack.repairCost

Return Type: int

reuse() as IIngredient
script.zs
// FabricItemStack.reuse() as IIngredient;
myFabricItemStack.reuse();

Return Type: IIngredient

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
// FabricItemStack.shrink(amount as int = 1) as IItemStack;
myFabricItemStack.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
// FabricItemStack.stackable as bool
myFabricItemStack.stackable

Return Type: bool

Getter
script.zs
// FabricItemStack.storedEnchantments as ItemEnchantments
myFabricItemStack.storedEnchantments

Return Type: ItemEnchantments

Getter
script.zs
// FabricItemStack.suspiciousStewEffects as SuspiciousStewEffects
myFabricItemStack.suspiciousStewEffects

Return Type: SuspiciousStewEffects

Getter
Gets the data in &lt;componenttype:minecraft:tool&gt;
script.zs
// FabricItemStack.tool as Tool
myFabricItemStack.tool

Return Type: Tool

transformCustom(uid as string, function as function(r as IItemStack) as IItemStack = null) as IIngredient
script.zs
// FabricItemStack.transformCustom(uid as string, function as function(r as IItemStack) as IItemStack = null) as IIngredient;
myFabricItemStack.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
// FabricItemStack.transformDamage(amount as int = 1) as IIngredient;
myFabricItemStack.transformDamage(myInt);

Parameters:

amount (optional) Type: int

Default Value: 1

Return Type: IIngredient

transformReplace(replaceWith as IItemStack) as IIngredient
script.zs
// FabricItemStack.transformReplace(replaceWith as IItemStack) as IIngredient;
myFabricItemStack.transformReplace(myIItemStack);

Parameters:

replaceWith Type: IItemStack

Return Type: IIngredient

Getter
script.zs
// FabricItemStack.trim as ArmorTrim
myFabricItemStack.trim

Return Type: ArmorTrim

Getter
Gets the data in the &lt;componenttype:minecraft:unbreakable&gt;
script.zs
// FabricItemStack.unbreakable as Unbreakable
myFabricItemStack.unbreakable

Return Type: Unbreakable

update(type as DataComponentType<T>, defaultValue as T, data as U, operator as BiFunction<T, T, U>) as IItemStack
script.zs
// FabricItemStack.update<T, U>(type as DataComponentType<T>, defaultValue as T, data as U, operator as BiFunction<T, T, U>) as IItemStack;
myFabricItemStack.update<T, U>(myDataComponentType, myT, myU, myBiFunction);

Parameters:

defaultValue Type: T
data Type: U
operator Type: BiFunction<T, T, U>

Return Type: IItemStack

update(type as DataComponentType<T>, defaultValue as T, operator as UnaryOperator<T>) as IItemStack
script.zs
// FabricItemStack.update<T>(type as DataComponentType<T>, defaultValue as T, operator as UnaryOperator<T>) as IItemStack;
myFabricItemStack.update<T>(myDataComponentType, myT, myUnaryOperator);

Parameters:

defaultValue Type: T
operator Type: UnaryOperator<T>

Return Type: IItemStack

Getter
Gets the use duration of the ItemStack
script.zs
// FabricItemStack.useDuration as int
myFabricItemStack.useDuration

Return Type: int

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

Return Type: bool

with(type as DataComponentType<T>, value as T?) as IItemStack
script.zs
// FabricItemStack.with<T>(type as DataComponentType<T>, value as T?) as IItemStack;
myFabricItemStack.with<T>(myDataComponentType, myT);

Parameters:

value Type: T?

Return Type: IItemStack

withAttributeModifiers(modifiers as ItemAttributeModifiers) as ComponentAccess
Sets the &lt;componenttype:minecraft:attribute_modifiers&gt; of the ComponentAccess to have the given ItemAttributeModifiers

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withAttributeModifiers(modifiers as ItemAttributeModifiers) as ComponentAccess;
myFabricItemStack.withAttributeModifiers(ItemAttributeModifiers.builder().add(<attribute:minecraft:player.block_break_speed>,
AttributeModifier.create("test", 2.0, <constant:minecraft:attribute/operation:add_value>, "596e0826-7c66-42c6-b3da-45a6d667ccf7"),
<constant:minecraft:equipmentslot/group:mainhand>).build(););

Parameters:

modifiers Type: ItemAttributeModifiers - The attributes to give to the item.

Return Type: ComponentAccess

withAttributeModifiers(modifier as Entry, showInTooltip as bool = true) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withAttributeModifiers(modifier as Entry, showInTooltip as bool = true) as ComponentAccess;
myFabricItemStack.withAttributeModifiers(myEntry, myBool);

Parameters:

showInTooltip (optional) Type: bool

Default Value: true

Return Type: ComponentAccess

withAttributeModifiers(modifiers as List<Entry>, showInTooltip as bool = true) as ComponentAccess
script.zs
// FabricItemStack.withAttributeModifiers(modifiers as List<Entry>, showInTooltip as bool = true) as ComponentAccess;
myFabricItemStack.withAttributeModifiers(myList, myBool);

Parameters:

showInTooltip (optional) Type: bool

Default Value: true

Return Type: ComponentAccess

withBannerPatterns(layers as List<Layer>) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withBannerPatterns(layers as List<Layer>) as ComponentAccess;
myFabricItemStack.withBannerPatterns(myList);

Parameters:

Return Type: ComponentAccess

withBannerPatterns(layers as BannerPatternLayers) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withBannerPatterns(layers as BannerPatternLayers) as ComponentAccess;
myFabricItemStack.withBannerPatterns(myBannerPatternLayers);

Parameters:

Return Type: ComponentAccess

withBaseColor(color as DyeColor) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withBaseColor(color as DyeColor) as ComponentAccess;
myFabricItemStack.withBaseColor(myDyeColor);

Parameters:

color Type: DyeColor

Return Type: ComponentAccess

withBees(occupants as List<Occupant>) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withBees(occupants as List<Occupant>) as ComponentAccess;
myFabricItemStack.withBees(myList);

Parameters:

Return Type: ComponentAccess

withBlockEntityData(data as MapData) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withBlockEntityData(data as MapData) as ComponentAccess;
myFabricItemStack.withBlockEntityData(myMapData);

Parameters:

data Type: MapData

Return Type: ComponentAccess

withBlockEntityData(data as CustomData) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withBlockEntityData(data as CustomData) as ComponentAccess;
myFabricItemStack.withBlockEntityData(myCustomData);

Parameters:

data Type: CustomData

Return Type: ComponentAccess

withBlockState(properties as BlockItemStateProperties) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withBlockState(properties as BlockItemStateProperties) as ComponentAccess;
myFabricItemStack.withBlockState(myBlockItemStateProperties);

Parameters:

Return Type: ComponentAccess

withBucketEntityData(data as MapData) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withBucketEntityData(data as MapData) as ComponentAccess;
myFabricItemStack.withBucketEntityData(myMapData);

Parameters:

data Type: MapData

Return Type: ComponentAccess

withBucketEntityData(data as CustomData) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withBucketEntityData(data as CustomData) as ComponentAccess;
myFabricItemStack.withBucketEntityData(myCustomData);

Parameters:

data Type: CustomData

Return Type: ComponentAccess

withBundleContents(contents as List<IItemStack>) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withBundleContents(contents as List<IItemStack>) as ComponentAccess;
myFabricItemStack.withBundleContents(myList);

Parameters:

contents Type: List<IItemStack>

Return Type: ComponentAccess

withBundleContents(contents as BundleContents) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withBundleContents(contents as BundleContents) as ComponentAccess;
myFabricItemStack.withBundleContents(myBundleContents);

Parameters:

contents Type: BundleContents

Return Type: ComponentAccess

withCanBreak(predicates as List<BlockPredicate>, showInTooltip as bool = true) as ComponentAccess
Sets the &lt;componenttype:minecraft:can_break&gt; with the given BlockPredicates.
Any predicate that matches will allow the Block to be broken by this ItemStack.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withCanBreak(predicates as List<BlockPredicate>, showInTooltip as bool = true) as ComponentAccess;
myFabricItemStack.withCanBreak(BlockPredicate.create().of(<block:minecraft:diamond_ore>).build(), true);

Parameters:

predicates Type: List<BlockPredicate> - The collection of predicates to test for
showInTooltip (optional) Type: bool - Whether to show the ability in the tooltip or not.

Default Value: true

Return Type: ComponentAccess

withCanBreak(predicate as AdventureModePredicate) as ComponentAccess
Sets the &lt;componenttype:minecraft:can_break&gt; of the ComponentAccess to have the given AdventureModePredicate

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withCanBreak(predicate as AdventureModePredicate) as ComponentAccess;
myFabricItemStack.withCanBreak(myAdventureModePredicate);

Parameters:

predicate Type: AdventureModePredicate - The adventure mode predicate to use to determine whether the item can be used to break a block.

Return Type: ComponentAccess

withCanPlaceOn(predicates as List<BlockPredicate>, showInTooltip as bool = true) as ComponentAccess
Sets the &lt;componenttype:minecraft:can_place_on&gt; with the given BlockPredicates.
Any predicate that matches will allow the BlockItem within the ItemStack to be placed.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withCanPlaceOn(predicates as List<BlockPredicate>, showInTooltip as bool = true) as ComponentAccess;
myFabricItemStack.withCanPlaceOn(BlockPredicate.create().of(<block:minecraft:dirt>).build(), myBool);

Parameters:

predicates Type: List<BlockPredicate> - The collection of predicates to test for
showInTooltip (optional) Type: bool - Whether to show the restriction in the tooltip or not.

Default Value: true

Return Type: ComponentAccess

withCanPlaceOn(predicate as AdventureModePredicate) as ComponentAccess
Sets the &lt;componenttype:minecraft:can_place_on&gt; of the ComponentAccess to have the given AdventureModePredicate

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withCanPlaceOn(predicate as AdventureModePredicate) as ComponentAccess;
myFabricItemStack.withCanPlaceOn(myAdventureModePredicate);

Parameters:

predicate Type: AdventureModePredicate - The adventure mode predicate to use to determine whether the current block can be placed on another block.

Return Type: ComponentAccess

withChargedProjectiles(item as IItemStack) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withChargedProjectiles(item as IItemStack) as ComponentAccess;
myFabricItemStack.withChargedProjectiles(myIItemStack);

Parameters:

item Type: IItemStack

Return Type: ComponentAccess

withChargedProjectiles(items as List<IItemStack>) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withChargedProjectiles(items as List<IItemStack>) as ComponentAccess;
myFabricItemStack.withChargedProjectiles(myList);

Parameters:

items Type: List<IItemStack>

Return Type: ComponentAccess

withChargedProjectiles(chargedProjectiles as ChargedProjectiles) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withChargedProjectiles(chargedProjectiles as ChargedProjectiles) as ComponentAccess;
myFabricItemStack.withChargedProjectiles(myChargedProjectiles);

Parameters:

chargedProjectiles Type: ChargedProjectiles

Return Type: ComponentAccess

withContainer(contents as List<IItemStack>) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withContainer(contents as List<IItemStack>) as ComponentAccess;
myFabricItemStack.withContainer(myList);

Parameters:

contents Type: List<IItemStack>

Return Type: ComponentAccess

withContainer(contents as ItemContainerContents) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withContainer(contents as ItemContainerContents) as ComponentAccess;
myFabricItemStack.withContainer(myItemContainerContents);

Parameters:

Return Type: ComponentAccess

withContainerLoot(lootTable as ResourceKey<LootTable>, seed as long) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withContainerLoot(lootTable as ResourceKey<LootTable>, seed as long) as ComponentAccess;
myFabricItemStack.withContainerLoot(myResourceKey, myLong);

Parameters:

seed Type: long

Return Type: ComponentAccess

withContainerLoot(loot as SeededContainerLoot) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withContainerLoot(loot as SeededContainerLoot) as ComponentAccess;
myFabricItemStack.withContainerLoot(mySeededContainerLoot);

Parameters:

Return Type: ComponentAccess

withCreativeSlotLock() as ComponentAccess
Sets the &lt;componenttype:minecraft:creative_slot_lock&gt; of the ComponentAccess to exist.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withCreativeSlotLock() as ComponentAccess;
myFabricItemStack.withCreativeSlotLock();

Return Type: ComponentAccess

withCustomData(customData as MapData) as ComponentAccess
Sets the <componenttype:minecraft:custom_data> of the ComponentAccess to have the given MapData

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withCustomData(customData as MapData) as ComponentAccess;
myFabricItemStack.withCustomData({custom_ammo_thing: 1, owner: "Benji"});

Parameters:

customData Type: MapData - The MapData to set the component to.

Return Type: ComponentAccess

withCustomData(customData as CustomData) as ComponentAccess
Sets the &lt;componenttype:minecraft:custom_data&gt; of the ComponentAccess to have the given CustomData

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withCustomData(customData as CustomData) as ComponentAccess;
myFabricItemStack.withCustomData(myCustomData);

Parameters:

customData Type: CustomData

Return Type: ComponentAccess

withCustomModelData(value as int) as ComponentAccess
Sets the &lt;componenttype:minecraft:custom_data&gt; of the ComponentAccess to have the given CustomData

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withCustomModelData(value as int) as ComponentAccess;
myFabricItemStack.withCustomModelData(2);

Parameters:

value Type: int - The value to set the CustomModelData to

Return Type: ComponentAccess

withCustomModelData(data as CustomModelData) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withCustomModelData(data as CustomModelData) as ComponentAccess;
myFabricItemStack.withCustomModelData(myCustomModelData);

Parameters:

Return Type: ComponentAccess

withCustomName(name as Component) as ComponentAccess
Sets the &lt;componenttype:minecraft:custom_name&gt; of the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withCustomName(name as Component) as ComponentAccess;
myFabricItemStack.withCustomName(Component.literal("Fancy Water"));

Parameters:

name Type: Component - The component to use.

Return Type: ComponentAccess

withDamage(damage as int) as ComponentAccess
Sets the &lt;componenttype:minecraft:damage&gt; of the ComponentAccess to have the given value. Damage is related to durability.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withDamage(damage as int) as ComponentAccess;
myFabricItemStack.withDamage(16);

Parameters:

damage Type: int - The new damage of the ComponentAccess.

Return Type: ComponentAccess

withDebugStickState(state as DebugStickState) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withDebugStickState(state as DebugStickState) as ComponentAccess;
myFabricItemStack.withDebugStickState(myDebugStickState);

Parameters:

Return Type: ComponentAccess

withDyedColor(rgb as int, showInTooltip as bool = true) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withDyedColor(rgb as int, showInTooltip as bool = true) as ComponentAccess;
myFabricItemStack.withDyedColor(myInt, myBool);

Parameters:

rgb Type: int
showInTooltip (optional) Type: bool

Default Value: true

Return Type: ComponentAccess

withDyedColor(color as DyedItemColor) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withDyedColor(color as DyedItemColor) as ComponentAccess;
myFabricItemStack.withDyedColor(myDyedItemColor);

Parameters:

Return Type: ComponentAccess

withEnchantment(enchantment as Enchantment, level as int = 1) as ComponentAccess
Sets the &lt;componenttype:minecraft:enchantments&gt; of the ComponentAccess to have the given Enchantment and level.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withEnchantment(enchantment as Enchantment, level as int = 1) as ComponentAccess;
myFabricItemStack.withEnchantment(<enchantment:minecraft:efficiency>, 4);

Parameters:

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

Default Value: 1

Return Type: ComponentAccess

withEnchantmentGlintOverride(value as bool) as ComponentAccess
Sets the &lt;componenttype:minecraft:enchantment_glint_override&gt; of the ComponentAccess to have the given value.
If it is false, the item will never render the enchantment glint If it is true, the item will render the enchantment glint always, indenpendently of whether it is enchanted or not.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withEnchantmentGlintOverride(value as bool) as ComponentAccess;
myFabricItemStack.withEnchantmentGlintOverride(true);

Parameters:

value Type: bool - The value of the override, as described above

Return Type: ComponentAccess

withEnchantments(enchantments as ItemEnchantments) as ComponentAccess
Sets the &lt;componenttype:minecraft:enchantments&gt; of the ComponentAccess to have the given ItemEnchantments

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withEnchantments(enchantments as ItemEnchantments) as ComponentAccess;
myFabricItemStack.withEnchantments(myItemEnchantments);

Parameters:

enchantments Type: ItemEnchantments

Return Type: ComponentAccess

withEntityData(data as MapData) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withEntityData(data as MapData) as ComponentAccess;
myFabricItemStack.withEntityData(myMapData);

Parameters:

data Type: MapData

Return Type: ComponentAccess

withEntityData(data as CustomData) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withEntityData(data as CustomData) as ComponentAccess;
myFabricItemStack.withEntityData(myCustomData);

Parameters:

data Type: CustomData

Return Type: ComponentAccess

withFireResistant() as ComponentAccess
Sets the &lt;componenttype:minecraft:fire_resistant&gt; of the ComponentAccess to exist.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withFireResistant() as ComponentAccess;
myFabricItemStack.withFireResistant();

Return Type: ComponentAccess

withFireworkExplosion(explosion as FireworkExplosion) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withFireworkExplosion(explosion as FireworkExplosion) as ComponentAccess;
myFabricItemStack.withFireworkExplosion(myFireworkExplosion);

Parameters:

Return Type: ComponentAccess

withFireworks(flightDuration as int, explosions as List<FireworkExplosion>) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withFireworks(flightDuration as int, explosions as List<FireworkExplosion>) as ComponentAccess;
myFabricItemStack.withFireworks(myInt, myList);

Parameters:

flightDuration Type: int
explosions Type: List<FireworkExplosion>

Return Type: ComponentAccess

withFireworks(fireworks as Fireworks) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withFireworks(fireworks as Fireworks) as ComponentAccess;
myFabricItemStack.withFireworks(myFireworks);

Parameters:

fireworks Type: Fireworks

Return Type: ComponentAccess

withFood(food as FoodProperties) as ComponentAccess
Sets the &lt;componenttype:minecraft:food&gt; of the ComponentAccess to have the given FoodProperties

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withFood(food as FoodProperties) as ComponentAccess;
myFabricItemStack.withFood(myFoodProperties);

Parameters:

Return Type: ComponentAccess

withHideAdditionalTooltip() as ComponentAccess
Sets the &lt;componenttype:minecraft:hide_additional_tooltip&gt; of the ComponentAccess to exist.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withHideAdditionalTooltip() as ComponentAccess;
myFabricItemStack.withHideAdditionalTooltip();

Return Type: ComponentAccess

withHideTooltip() as ComponentAccess
Sets the &lt;componenttype:minecraft:hide_tooltip&gt; of the ComponentAccess to exist.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withHideTooltip() as ComponentAccess;
myFabricItemStack.withHideTooltip();

Return Type: ComponentAccess

withInstrument(instrument as Instrument) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withInstrument(instrument as Instrument) as ComponentAccess;
myFabricItemStack.withInstrument(myInstrument);

Parameters:

instrument Type: Instrument

Return Type: ComponentAccess

withIntangibleProjectile() as ComponentAccess
Sets the &lt;componenttype:minecraft:intangible_projectile&gt; of the ComponentAccess to have exist.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withIntangibleProjectile() as ComponentAccess;
myFabricItemStack.withIntangibleProjectile();

Return Type: ComponentAccess

withItemName(name as Component) as ComponentAccess
Sets the &lt;componenttype:minecraft:item_name&gt; of the ComponentAccess to have the given Component

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withItemName(name as Component) as ComponentAccess;
myFabricItemStack.withItemName(Component.literal("Fancy Water"));

Parameters:

name Type: Component

Return Type: ComponentAccess

withJsonComponent(type as DataComponentType<T>, value as IData) as IItemStack
script.zs
// FabricItemStack.withJsonComponent(type as DataComponentType<T>, value as IData) as IItemStack;
myFabricItemStack.withJsonComponent(myDataComponentType, myIData);

Parameters:

value Type: IData

Return Type: IItemStack

withJsonComponents(value as IData) as IItemStack
script.zs
// FabricItemStack.withJsonComponents(value as IData) as IItemStack;
myFabricItemStack.withJsonComponents(myIData);

Parameters:

value Type: IData

Return Type: IItemStack

withLock(code as string) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withLock(code as string) as ComponentAccess;
myFabricItemStack.withLock(myString);

Parameters:

code Type: string

Return Type: ComponentAccess

withLock(lock as LockCode) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withLock(lock as LockCode) as ComponentAccess;
myFabricItemStack.withLock(myLockCode);

Parameters:

lock Type: LockCode

Return Type: ComponentAccess

withLodestoneTracker(tracker as LodestoneTracker) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withLodestoneTracker(tracker as LodestoneTracker) as ComponentAccess;
myFabricItemStack.withLodestoneTracker(myLodestoneTracker);

Parameters:

Return Type: ComponentAccess

withLore(components as List<Component>) as ComponentAccess
Sets the &lt;componenttype:minecraft:lore&gt; of the ComponentAccess to have the given stdlib.List&lt;Component&gt;

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withLore(components as List<Component>) as ComponentAccess;
myFabricItemStack.withLore([Component.literal("Found in a dark cave"), Component.translatable("Belonged to a Dragon")]);

Parameters:

components Type: List<Component> - The list of Components to add as lore.

Return Type: ComponentAccess

withLore(lore as ItemLore) as ComponentAccess
Sets the &lt;componenttype:minecraft:lore&gt; of the ComponentAccess to have the given ItemLore

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withLore(lore as ItemLore) as ComponentAccess;
myFabricItemStack.withLore(myItemLore);

Parameters:

lore Type: ItemLore

Return Type: ComponentAccess

withMapColor(rgb as int) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withMapColor(rgb as int) as ComponentAccess;
myFabricItemStack.withMapColor(myInt);

Parameters:

rgb Type: int

Return Type: ComponentAccess

withMapColor(color as MapItemColor) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withMapColor(color as MapItemColor) as ComponentAccess;
myFabricItemStack.withMapColor(myMapItemColor);

Parameters:

color Type: MapItemColor

Return Type: ComponentAccess

withMapDecorations(decorations as Entry[string]) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withMapDecorations(decorations as Entry[string]) as ComponentAccess;
myFabricItemStack.withMapDecorations(myMap);

Parameters:

decorations Type: MapDecorationsEntry[string]

Return Type: ComponentAccess

withMapDecorations(decorations as MapDecorations) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withMapDecorations(decorations as MapDecorations) as ComponentAccess;
myFabricItemStack.withMapDecorations(myMapDecorations);

Parameters:

decorations Type: MapDecorations

Return Type: ComponentAccess

withMapId(id as int) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withMapId(id as int) as ComponentAccess;
myFabricItemStack.withMapId(myInt);

Parameters:

id Type: int

Return Type: ComponentAccess

withMapId(mapId as MapId) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withMapId(mapId as MapId) as ComponentAccess;
myFabricItemStack.withMapId(myMapId);

Parameters:

mapId Type: MapId

Return Type: ComponentAccess

withMapPostProcessing(value as MapPostProcessing) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withMapPostProcessing(value as MapPostProcessing) as ComponentAccess;
myFabricItemStack.withMapPostProcessing(myMapPostProcessing);

Parameters:

Return Type: ComponentAccess

withMaxDamage(maxDamage as int) as ComponentAccess
Sets the &lt;componenttype:minecraft:max_damage&gt; of the ComponentAccess to have the given value.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withMaxDamage(maxDamage as int) as ComponentAccess;
myFabricItemStack.withMaxDamage(1024);

Parameters:

maxDamage Type: int

Return Type: ComponentAccess

withMaxStackSize(maxStackSize as int) as ComponentAccess
Sets the &lt;componenttype:minecraft:stack_size&gt; of the ComponentAccess to have the given value. Non standard stack sizes may render differently and may not be handled correctly by all mods. Test your changes!

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withMaxStackSize(maxStackSize as int) as ComponentAccess;
myFabricItemStack.withMaxStackSize(16);

Parameters:

maxStackSize Type: int - The new maxStackSize of the ComponentAccess.

Return Type: ComponentAccess

withNoteBlockSound(sound as ResourceLocation) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withNoteBlockSound(sound as ResourceLocation) as ComponentAccess;
myFabricItemStack.withNoteBlockSound(myResourceLocation);

Parameters:

Return Type: ComponentAccess

withOminousBottleAmplifier(amplifier as int) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withOminousBottleAmplifier(amplifier as int) as ComponentAccess;
myFabricItemStack.withOminousBottleAmplifier(myInt);

Parameters:

amplifier Type: int

Return Type: ComponentAccess

without(type as DataComponentType<T>) as IItemStack
script.zs
// FabricItemStack.without<T>(type as DataComponentType<T>) as IItemStack;
myFabricItemStack.without<T>(myDataComponentType);

Parameters:

Return Type: IItemStack

withoutAttributeModifiers() as ComponentAccess
Removes the &lt;componenttype:minecraft:attribute_modifiers&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutAttributeModifiers() as ComponentAccess;
myFabricItemStack.withoutAttributeModifiers();

Return Type: ComponentAccess

withoutBannerPatterns() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutBannerPatterns() as ComponentAccess;
myFabricItemStack.withoutBannerPatterns();

Return Type: ComponentAccess

withoutBaseColor() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutBaseColor() as ComponentAccess;
myFabricItemStack.withoutBaseColor();

Return Type: ComponentAccess

withoutBees() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutBees() as ComponentAccess;
myFabricItemStack.withoutBees();

Return Type: ComponentAccess

withoutBlockEntityData() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutBlockEntityData() as ComponentAccess;
myFabricItemStack.withoutBlockEntityData();

Return Type: ComponentAccess

withoutBlockState() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutBlockState() as ComponentAccess;
myFabricItemStack.withoutBlockState();

Return Type: ComponentAccess

withoutBucketEntityData() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutBucketEntityData() as ComponentAccess;
myFabricItemStack.withoutBucketEntityData();

Return Type: ComponentAccess

withoutBundleContents() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutBundleContents() as ComponentAccess;
myFabricItemStack.withoutBundleContents();

Return Type: ComponentAccess

withoutCanBreak() as ComponentAccess
Removes the &lt;componenttype:minecraft:can_break&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutCanBreak() as ComponentAccess;
myFabricItemStack.withoutCanBreak();

Return Type: ComponentAccess

withoutCanPlaceOn() as ComponentAccess
Removes the &lt;componenttype:minecraft:can_place_on&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutCanPlaceOn() as ComponentAccess;
myFabricItemStack.withoutCanPlaceOn();

Return Type: ComponentAccess

withoutChargedProjectiles() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutChargedProjectiles() as ComponentAccess;
myFabricItemStack.withoutChargedProjectiles();

Return Type: ComponentAccess

withoutContainer() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutContainer() as ComponentAccess;
myFabricItemStack.withoutContainer();

Return Type: ComponentAccess

withoutContainerLoot() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutContainerLoot() as ComponentAccess;
myFabricItemStack.withoutContainerLoot();

Return Type: ComponentAccess

withoutCreativeSlotLock() as ComponentAccess
Removes the &lt;componenttype:minecraft:creative_slot_lock&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutCreativeSlotLock() as ComponentAccess;
myFabricItemStack.withoutCreativeSlotLock();

Return Type: ComponentAccess

withoutCustomData() as ComponentAccess
Removes the &lt;componenttype:minecraft:custom_data&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutCustomData() as ComponentAccess;
myFabricItemStack.withoutCustomData();

Return Type: ComponentAccess

withoutCustomModelData() as ComponentAccess
Removes the &lt;componenttype:minecraft:custom_model_data&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutCustomModelData() as ComponentAccess;
myFabricItemStack.withoutCustomModelData();

Return Type: ComponentAccess

withoutCustomName() as ComponentAccess
Removes the &lt;componenttype:minecraft:custom_name&gt; from the ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutCustomName() as ComponentAccess;
myFabricItemStack.withoutCustomName();

Return Type: ComponentAccess

withoutDamage() as ComponentAccess
Removes the &lt;componenttype:minecraft:damage&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutDamage() as ComponentAccess;
myFabricItemStack.withoutDamage();

Return Type: ComponentAccess

withoutDebugStickState() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutDebugStickState() as ComponentAccess;
myFabricItemStack.withoutDebugStickState();

Return Type: ComponentAccess

withoutDyedColor() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutDyedColor() as ComponentAccess;
myFabricItemStack.withoutDyedColor();

Return Type: ComponentAccess

withoutEnchantment(enchantment as Enchantment) as ComponentAccess
Removes the Enchantment from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutEnchantment(enchantment as Enchantment) as ComponentAccess;
myFabricItemStack.withoutEnchantment(<enchantment:minecraft:mending>);

Parameters:

enchantment Type: Enchantment - The Enchantment to remove

Return Type: ComponentAccess

withoutEnchantmentGlintOverride() as ComponentAccess
Removes the &lt;componenttype:minecraft:enchantment_glint_override&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutEnchantmentGlintOverride() as ComponentAccess;
myFabricItemStack.withoutEnchantmentGlintOverride();

Return Type: ComponentAccess

withoutEnchantments() as ComponentAccess
Removes the &lt;componenttype:minecraft:enchantments&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutEnchantments() as ComponentAccess;
myFabricItemStack.withoutEnchantments();

Return Type: ComponentAccess

withoutEntityDate() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutEntityDate() as ComponentAccess;
myFabricItemStack.withoutEntityDate();

Return Type: ComponentAccess

withoutFireResistant() as ComponentAccess
Removes the &lt;componenttype:minecraft:fire_resistant&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutFireResistant() as ComponentAccess;
myFabricItemStack.withoutFireResistant();

Return Type: ComponentAccess

withoutFireworkExplosion() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutFireworkExplosion() as ComponentAccess;
myFabricItemStack.withoutFireworkExplosion();

Return Type: ComponentAccess

withoutFireworks() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutFireworks() as ComponentAccess;
myFabricItemStack.withoutFireworks();

Return Type: ComponentAccess

withoutFood() as ComponentAccess
Removes the &lt;componenttype:minecraft:food&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutFood() as ComponentAccess;
myFabricItemStack.withoutFood();

Return Type: ComponentAccess

withoutHideAdditionalTooltip() as ComponentAccess
Removes the &lt;componenttype:minecraft:hide_additional_tooltip&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutHideAdditionalTooltip() as ComponentAccess;
myFabricItemStack.withoutHideAdditionalTooltip();

Return Type: ComponentAccess

withoutHideTooltip() as ComponentAccess
Removes the &lt;componenttype:minecraft:hide_tooltip&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutHideTooltip() as ComponentAccess;
myFabricItemStack.withoutHideTooltip();

Return Type: ComponentAccess

withoutInstrument() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutInstrument() as ComponentAccess;
myFabricItemStack.withoutInstrument();

Return Type: ComponentAccess

withoutIntangibleProjectile() as ComponentAccess
Removes the &lt;componenttype:minecraft:intangible_projectile&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutIntangibleProjectile() as ComponentAccess;
myFabricItemStack.withoutIntangibleProjectile();

Return Type: ComponentAccess

withoutItemName() as ComponentAccess
Removes the &lt;componenttype:minecraft:item_name&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutItemName() as ComponentAccess;
myFabricItemStack.withoutItemName();

Return Type: ComponentAccess

withoutLock() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutLock() as ComponentAccess;
myFabricItemStack.withoutLock();

Return Type: ComponentAccess

withoutLodestoneTracker() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutLodestoneTracker() as ComponentAccess;
myFabricItemStack.withoutLodestoneTracker();

Return Type: ComponentAccess

withoutLore() as ComponentAccess
Removes the &lt;componenttype:minecraft:lore&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutLore() as ComponentAccess;
myFabricItemStack.withoutLore();

Return Type: ComponentAccess

withoutMapColor() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutMapColor() as ComponentAccess;
myFabricItemStack.withoutMapColor();

Return Type: ComponentAccess

withoutMapDecorations() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutMapDecorations() as ComponentAccess;
myFabricItemStack.withoutMapDecorations();

Return Type: ComponentAccess

withoutMapId() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutMapId() as ComponentAccess;
myFabricItemStack.withoutMapId();

Return Type: ComponentAccess

withoutMapPostProcessing() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutMapPostProcessing() as ComponentAccess;
myFabricItemStack.withoutMapPostProcessing();

Return Type: ComponentAccess

withoutMaxDamage() as ComponentAccess
Removes the &lt;componenttype:minecraft:max_damage&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutMaxDamage() as ComponentAccess;
myFabricItemStack.withoutMaxDamage();

Return Type: ComponentAccess

withoutMaxStackSize() as ComponentAccess
Removes the &lt;componenttype:minecraft:stack_size&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutMaxStackSize() as ComponentAccess;
myFabricItemStack.withoutMaxStackSize();

Return Type: ComponentAccess

withoutNoteBlockSound() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutNoteBlockSound() as ComponentAccess;
myFabricItemStack.withoutNoteBlockSound();

Return Type: ComponentAccess

withoutOminousBottleAmplifier() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutOminousBottleAmplifier() as ComponentAccess;
myFabricItemStack.withoutOminousBottleAmplifier();

Return Type: ComponentAccess

withoutPotDecorations() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutPotDecorations() as ComponentAccess;
myFabricItemStack.withoutPotDecorations();

Return Type: ComponentAccess

withoutPotionContents() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutPotionContents() as ComponentAccess;
myFabricItemStack.withoutPotionContents();

Return Type: ComponentAccess

withoutProfile() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutProfile() as ComponentAccess;
myFabricItemStack.withoutProfile();

Return Type: ComponentAccess

withoutRarity() as ComponentAccess
Removes the &lt;componenttype:minecraft:rarity&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutRarity() as ComponentAccess;
myFabricItemStack.withoutRarity();

Return Type: ComponentAccess

withoutRecipes() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutRecipes() as ComponentAccess;
myFabricItemStack.withoutRecipes();

Return Type: ComponentAccess

withoutRepairCost() as ComponentAccess
Removes the &lt;componenttype:minecraft:repair_cost&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutRepairCost() as ComponentAccess;
myFabricItemStack.withoutRepairCost();

Return Type: ComponentAccess

withoutStoredEnchantments() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutStoredEnchantments() as ComponentAccess;
myFabricItemStack.withoutStoredEnchantments();

Return Type: ComponentAccess

withoutSuspiciousStewEffects() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutSuspiciousStewEffects() as ComponentAccess;
myFabricItemStack.withoutSuspiciousStewEffects();

Return Type: ComponentAccess

withoutTool() as ComponentAccess
Removes the &lt;componenttype:minecraft:tool&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutTool() as ComponentAccess;
myFabricItemStack.withoutTool();

Return Type: ComponentAccess

withoutTrim() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutTrim() as ComponentAccess;
myFabricItemStack.withoutTrim();

Return Type: ComponentAccess

withoutUnbreakable() as ComponentAccess
Removes the &lt;componenttype:minecraft:unbreakable&gt; from the ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutUnbreakable() as ComponentAccess;
myFabricItemStack.withoutUnbreakable();

Return Type: ComponentAccess

withoutWritableBookContent() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutWritableBookContent() as ComponentAccess;
myFabricItemStack.withoutWritableBookContent();

Return Type: ComponentAccess

withoutWrittenBookContent() as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withoutWrittenBookContent() as ComponentAccess;
myFabricItemStack.withoutWrittenBookContent();

Return Type: ComponentAccess

withPotDecorations(back as Item, left as Item, right as Item, front as Item) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withPotDecorations(back as Item, left as Item, right as Item, front as Item) as ComponentAccess;
myFabricItemStack.withPotDecorations(myItem, myItem, myItem, myItem);

Return Type: ComponentAccess

withPotDecorations(decorations as PotDecorations) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withPotDecorations(decorations as PotDecorations) as ComponentAccess;
myFabricItemStack.withPotDecorations(myPotDecorations);

Parameters:

decorations Type: PotDecorations

Return Type: ComponentAccess

withPotionContents(potion as Potion) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withPotionContents(potion as Potion) as ComponentAccess;
myFabricItemStack.withPotionContents(myPotion);

Parameters:

potion Type: Potion

Return Type: ComponentAccess

withPotionContents(potion as Potion, customEffects as List<MobEffectInstance>) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withPotionContents(potion as Potion, customEffects as List<MobEffectInstance>) as ComponentAccess;
myFabricItemStack.withPotionContents(myPotion, myList);

Parameters:

potion Type: Potion
customEffects Type: List<MobEffectInstance>

Return Type: ComponentAccess

withPotionContents(potion as Potion, customColor as int, customEffects as List<MobEffectInstance>) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withPotionContents(potion as Potion, customColor as int, customEffects as List<MobEffectInstance>) as ComponentAccess;
myFabricItemStack.withPotionContents(myPotion, myInt, myList);

Parameters:

potion Type: Potion
customColor Type: int
customEffects Type: List<MobEffectInstance>

Return Type: ComponentAccess

withPotionContents(contents as PotionContents) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withPotionContents(contents as PotionContents) as ComponentAccess;
myFabricItemStack.withPotionContents(myPotionContents);

Parameters:

contents Type: PotionContents

Return Type: ComponentAccess

withProfile(profile as ResolvableProfile) as ComponentAccess
script.zs
// FabricItemStack.withProfile(profile as ResolvableProfile) as ComponentAccess;
myFabricItemStack.withProfile(myResolvableProfile);

Parameters:

Return Type: ComponentAccess

withRarity(rarity as Rarity) as ComponentAccess
Sets the &lt;componenttype:minecraft:rarity&gt; of the ComponentAccess to have the given Rarity

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withRarity(rarity as Rarity) as ComponentAccess;
myFabricItemStack.withRarity(<constant:minecraft:item/rarity:epic>);

Parameters:

rarity Type: Rarity - The rarity to set

Return Type: ComponentAccess

withRecipes(recipes as List<ResourceLocation>) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withRecipes(recipes as List<ResourceLocation>) as ComponentAccess;
myFabricItemStack.withRecipes(myList);

Parameters:

recipes Type: List<ResourceLocation>

Return Type: ComponentAccess

withRepairCost(cost as int) as ComponentAccess
Sets the &lt;componenttype:minecraft:repair_cost&gt; of the ComponentAccess to have the given value.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withRepairCost(cost as int) as ComponentAccess;
myFabricItemStack.withRepairCost(20);

Parameters:

cost Type: int - The repair cost

Return Type: ComponentAccess

withStoredEnchantments(enchantments as ItemEnchantments) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withStoredEnchantments(enchantments as ItemEnchantments) as ComponentAccess;
myFabricItemStack.withStoredEnchantments(myItemEnchantments);

Parameters:

enchantments Type: ItemEnchantments

Return Type: ComponentAccess

withSuspiciousStewEffects(effects as List<Entry>) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withSuspiciousStewEffects(effects as List<Entry>) as ComponentAccess;
myFabricItemStack.withSuspiciousStewEffects(myList);

Parameters:

Return Type: ComponentAccess

withSuspiciousStewEffects(suspiciousStewEffects as SuspiciousStewEffects) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withSuspiciousStewEffects(suspiciousStewEffects as SuspiciousStewEffects) as ComponentAccess;
myFabricItemStack.withSuspiciousStewEffects(mySuspiciousStewEffects);

Parameters:

suspiciousStewEffects Type: SuspiciousStewEffects

Return Type: ComponentAccess

withTool(rules as List<Rule>, defaultMiningSpeed as float, damagePerBlock as int) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withTool(rules as List<Rule>, defaultMiningSpeed as float, damagePerBlock as int) as ComponentAccess;
myFabricItemStack.withTool(myList, myFloat, myInt);

Parameters:

rules Type: List<ToolRule>
defaultMiningSpeed Type: float
damagePerBlock Type: int

Return Type: ComponentAccess

withTool(tool as Tool) as ComponentAccess
Sets the &lt;componenttype:minecraft:tool&gt; of the ComponentAccess to have the given Tool

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withTool(tool as Tool) as ComponentAccess;
myFabricItemStack.withTool(myTool);

Parameters:

tool Type: Tool

Return Type: ComponentAccess

withTrim(trim as ArmorTrim) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withTrim(trim as ArmorTrim) as ComponentAccess;
myFabricItemStack.withTrim(myArmorTrim);

Parameters:

trim Type: ArmorTrim

Return Type: ComponentAccess

withUnbreakable(showInTooltip as bool = true) as ComponentAccess
Sets the &lt;componenttype:minecraft:unbreakable&gt; of the ComponentAccess. The existance of the component makes the ComponentAccess unbreakable.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withUnbreakable(showInTooltip as bool = true) as ComponentAccess;
myFabricItemStack.withUnbreakable(myBool);

Parameters:

showInTooltip (optional) Type: bool - Whether to show that the ComponentAccess is unbreakable in a tooltip.

Default Value: true

Return Type: ComponentAccess

withUnbreakable(unbreakable as Unbreakable) as ComponentAccess
Sets the &lt;componenttype:minecraft:unbreakable&gt; of the ComponentAccess. The existance of the component makes the ComponentAccess unbreakable.

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withUnbreakable(unbreakable as Unbreakable) as ComponentAccess;
myFabricItemStack.withUnbreakable(myUnbreakable);

Parameters:

unbreakable Type: Unbreakable - The Unbreakable instance with the configured values.

Return Type: ComponentAccess

withWritableBookContent(pages as List<Filterable<string>>) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withWritableBookContent(pages as List<Filterable<string>>) as ComponentAccess;
myFabricItemStack.withWritableBookContent(myList);

Parameters:

pages Type: List<Filterable<string>>

Return Type: ComponentAccess

withWritableBookContent(content as WritableBookContent) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withWritableBookContent(content as WritableBookContent) as ComponentAccess;
myFabricItemStack.withWritableBookContent(myWritableBookContent);

Parameters:

Return Type: ComponentAccess

withWrittenBookContent(content as WrittenBookContent) as ComponentAccess

Returns: The new instance with the modified data.

script.zs
// FabricItemStack.withWrittenBookContent(content as WrittenBookContent) as ComponentAccess;
myFabricItemStack.withWrittenBookContent(myWrittenBookContent);

Parameters:

Return Type: ComponentAccess

Getter
script.zs
// FabricItemStack.writableBookContent as WritableBookContent
myFabricItemStack.writableBookContent

Return Type: WritableBookContent

Getter
script.zs
// FabricItemStack.writtenBookContent as WrittenBookContent
myFabricItemStack.writtenBookContent

Return Type: WrittenBookContent