Home Commands Examples Getting Started With Scripts Global Keywords 1.21 Migration Guide
Equipable IItemStack ItemCooldowns ItemDefinition ItemStack UseOnContext
BracketDumpers BracketHandlers BracketValidators ResourceLocationBracketHandler

IItemStack

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

Implements

IItemStack implements the following interfaces:

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

Undocumented Interfaces

IDataComponentHolderExtension

Operators

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

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

Parameters:

amount Type: int

Return Type: IIngredientWithAmount

|(other as IIngredient) as IIngredientList
script.zs
// (IItemStack | (other as IIngredient)) as IIngredientList
myIItemStack | myIIngredient

Parameters:

other Type: IIngredient

Return Type: IIngredientList

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

Parameters:

percentage Type: double

Return Type: Percentaged<IItemStack>

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

Parameters:

amount Type: int - new amount

Return Type: IItemStack

Members

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

Parameters:

attribute Type: Attribute
value Type: double
slotTypes Type: EquipmentSlot[]
addShiftTooltip(content as Component, showMessage as Component = null)
script.zs
// IItemStack.addShiftTooltip(content as Component, showMessage as Component = null);
myIItemStack.addShiftTooltip(myComponent, myComponent);

Parameters:

content Type: Component
showMessage (optional) Type: Component

Default Value: null

addTooltip(content as Component)
script.zs
// IItemStack.addTooltip(content as Component);
myIItemStack.addTooltip(myComponent);

Parameters:

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

Return Type: int

anyDamage() as IIngredient
script.zs
// IItemStack.anyDamage() as IIngredient;
myIItemStack.anyDamage();

Return Type: IIngredient

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

Parameters:

Return Type: IItemStack

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

Parameters:

Return Type: IItemStack

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

Parameters:

Return Type: IItemStack

asIIngredientWithAmount() as IIngredientWithAmount
script.zs
// IItemStack.asIIngredientWithAmount() as IIngredientWithAmount;
myIItemStack.asIIngredientWithAmount();

Return Type: IIngredientWithAmount

implicit as IIngredientWithAmount
script.zs
// IItemStack as IIngredientWithAmount
myIItemStack as IIngredientWithAmount

Return Type: IIngredientWithAmount

asImmutable() as IItemStack
script.zs
// IItemStack.asImmutable() as IItemStack;
myIItemStack.asImmutable();

Return Type: IItemStack

asItemLike() as ItemLike
script.zs
// IItemStack.asItemLike() as ItemLike;
myIItemStack.asItemLike();

Return Type: ItemLike

implicit as ItemLike
script.zs
// IItemStack as ItemLike
myIItemStack as ItemLike

Return Type: ItemLike

implicit as MapData
script.zs
// IItemStack as MapData
myIItemStack as MapData

Return Type: MapData

asMutable() as IItemStack
script.zs
// IItemStack.asMutable() as IItemStack;
myIItemStack.asMutable();

Return Type: IItemStack

implicit as Percentaged<IItemStack>
script.zs
// IItemStack as Percentaged<IItemStack>
myIItemStack as Percentaged<IItemStack>

Return Type: Percentaged<IItemStack>

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

Return Type: ItemAttributeModifiers

Getter
Gets the data in &lt;componenttype:minecraft:banner_patterns&gt;
script.zs
// IItemStack.bannerPatterns as BannerPatternLayers
myIItemStack.bannerPatterns

Return Type: BannerPatternLayers

Field
script.zs
// IItemStack.BASE_ATTACK_DAMAGE_ID as ResourceLocation
IItemStack.BASE_ATTACK_DAMAGE_ID

Return Type: ResourceLocation

Field
script.zs
// IItemStack.BASE_ATTACK_SPEED_ID as ResourceLocation
IItemStack.BASE_ATTACK_SPEED_ID

Return Type: ResourceLocation

Getter
Gets the data in &lt;componenttype:minecraft:base_color&gt;
script.zs
// IItemStack.baseColor as DyeColor
myIItemStack.baseColor

Return Type: DyeColor

Getter
Gets the data in &lt;componenttype:minecraft:bees&gt;
script.zs
// IItemStack.bees as List<BeehiveBlockEntityOccupant>
myIItemStack.bees

Return Type: List<BeehiveBlockEntityOccupant>

Getter
Gets the data in &lt;componenttype:minecraft:block_entity_data&gt;
script.zs
// IItemStack.blockEntityData as CustomData
myIItemStack.blockEntityData

Return Type: CustomData

Getter
Gets the data in &lt;componenttype:minecraft:block_state&gt;
script.zs
// IItemStack.blockState as BlockItemStateProperties
myIItemStack.blockState

Return Type: BlockItemStateProperties

Getter
Gets the data in &lt;componenttype:minecraft:bucket_entity_data&gt;
script.zs
// IItemStack.bucketEntityData as CustomData
myIItemStack.bucketEntityData

Return Type: CustomData

Getter
Gets the data in &lt;componenttype:minecraft:bundle_contents&gt;
script.zs
// IItemStack.bundleContents as BundleContents
myIItemStack.bundleContents

Return Type: BundleContents

Getter
script.zs
// IItemStack.burnTime as int
myIItemStack.burnTime

Return Type: int

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

Parameters:

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

Return Type: AdventureModePredicate

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

Return Type: AdventureModePredicate

Getter
Gets the data in &lt;componenttype:minecraft:charged_projectiles&gt;
script.zs
// IItemStack.chargedProjectiles as ChargedProjectiles
myIItemStack.chargedProjectiles

Return Type: ChargedProjectiles

clearTooltip(leaveName as bool = false)
script.zs
// IItemStack.clearTooltip(leaveName as bool = false);
myIItemStack.clearTooltip(myBool);

Parameters:

leaveName (optional) Type: bool

Default Value: false

Getter
script.zs
// IItemStack.componentsPatch as DataComponentPatch
myIItemStack.componentsPatch

Return Type: DataComponentPatch

Getter
Gets the data in &lt;componenttype:minecraft:container&gt;
script.zs
// IItemStack.container as ItemContainerContents
myIItemStack.container

Return Type: ItemContainerContents

Getter
Gets the data in &lt;componenttype:minecraft:container_loot&gt;
script.zs
// IItemStack.containerLoot as SeededContainerLoot
myIItemStack.containerLoot

Return Type: SeededContainerLoot

contains(ingredient as IIngredient) as bool
Does the ingredient contain the given ingredient?
script.zs
// IItemStack.contains(ingredient as IIngredient) as bool;
myIItemStack.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
// IItemStack.copy() as IItemStack;
myIItemStack.copy();

Return Type: IItemStack

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

Return Type: string

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

Return Type: bool

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

Return Type: CustomData

Getter
Gets the data in &lt;componenttype:minecraft:custom_model_data&gt;
script.zs
// IItemStack.customModelData as CustomModelData
myIItemStack.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
// IItemStack.customName as Component
myIItemStack.customName

Return Type: Component

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

Return Type: int

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

Return Type: bool

Getter
Gets the data in &lt;componenttype:minecraft:debug_stick_state&gt;
script.zs
// IItemStack.debugStickState as DebugStickState
myIItemStack.debugStickState

Return Type: DebugStickState

Getter
script.zs
// IItemStack.definition as ItemDefinition
myIItemStack.definition

Return Type: ItemDefinition

definition() as Item
script.zs
// IItemStack.definition() as ItemDefinition;
myIItemStack.definition();

Return Type: ItemDefinition

implicit as Item
script.zs
// IItemStack as ItemDefinition
myIItemStack as Item

Return Type: ItemDefinition

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

Return Type: string

Getter
Gets the display name of the ItemStack
script.zs
// IItemStack.displayName as Component
myIItemStack.displayName

Return Type: Component

Getter
Gets the data in &lt;componenttype:minecraft:dye_color&gt;
script.zs
// IItemStack.dyedColor as DyedItemColor
myIItemStack.dyedColor

Return Type: DyedItemColor

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
// IItemStack.enchantmentGlintOverride as bool
myIItemStack.enchantmentGlintOverride

Return Type: bool

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

Return Type: ItemEnchantments

Getter
Gets the data in &lt;componenttype:minecraft:entity_data&gt;
script.zs
// IItemStack.entityData as CustomData
myIItemStack.entityData

Return Type: CustomData

Getter
Gets the data in &lt;componenttype:minecraft:firework_explosion&gt;
script.zs
// IItemStack.fireworkExplosion as FireworkExplosion
myIItemStack.fireworkExplosion

Return Type: FireworkExplosion

Getter
Gets the data in &lt;componenttype:minecraft:fireworks&gt;
script.zs
// IItemStack.fireworks as Fireworks
myIItemStack.fireworks

Return Type: Fireworks

Getter
Gets the data in &lt;componenttype:minecraft:food&gt;
script.zs
// IItemStack.food as FoodProperties
myIItemStack.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
// IItemStack.getAttributes(slotType as EquipmentSlot) as List<AttributeModifier>[Attribute];
myIItemStack.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
// IItemStack.getImmutableInternal() as ItemStack;
myIItemStack.getImmutableInternal();

Return Type: ItemStack

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

Returns: internal ItemStack

script.zs
// IItemStack.getInternal() as ItemStack;
myIItemStack.getInternal();

Return Type: ItemStack

implicit as ItemStack
Gets the internal ItemStack for this IItemStack.
script.zs
// IItemStack as ItemStack
myIItemStack 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
// IItemStack.getRemainingItem(stack as IItemStack) as IItemStack;
myIItemStack.getRemainingItem(<item:minecraft:iron_ingot>);

Parameters:

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

Return Type: IItemStack

getUseDuration(entity as LivingEntity) as int
Gets the use duration of the ItemStack for the given entity

Returns: use duration

script.zs
// IItemStack.getUseDuration(entity as LivingEntity) as int;
myIItemStack.getUseDuration(entity);

Parameters:

entity Type: LivingEntity

Return Type: int

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
// IItemStack.grow(amount as int = 1) as IItemStack;
myIItemStack.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
// IItemStack.hasAttributeModifiers as bool
myIItemStack.hasAttributeModifiers

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:banner_patterns&gt;
script.zs
// IItemStack.hasBannerPatterns as bool
myIItemStack.hasBannerPatterns

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:base_color&gt;
Used for shield colouring.
script.zs
// IItemStack.hasBaseColor as bool
myIItemStack.hasBaseColor

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:bees&gt;
script.zs
// IItemStack.hasBees as bool
myIItemStack.hasBees

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:block_entity_data&gt;
script.zs
// IItemStack.hasBlockEntityData as bool
myIItemStack.hasBlockEntityData

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:block_state&gt;
script.zs
// IItemStack.hasBlockState as bool
myIItemStack.hasBlockState

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:bucket_entity_data&gt;
script.zs
// IItemStack.hasBucketEntityData as bool
myIItemStack.hasBucketEntityData

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:bundle_contents&gt;
script.zs
// IItemStack.hasBundleContents as bool
myIItemStack.hasBundleContents

Return Type: bool

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

Return Type: bool

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

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:charged_projectiles&gt;
This component is used for crossbows.
script.zs
// IItemStack.hasChargedProjectiles as bool
myIItemStack.hasChargedProjectiles

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:container&gt;
script.zs
// IItemStack.hasContainer as bool
myIItemStack.hasContainer

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:container_loot&gt;
script.zs
// IItemStack.hasContainerLoot as bool
myIItemStack.hasContainerLoot

Return Type: bool

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

Return Type: bool

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

Return Type: bool

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

Return Type: bool

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

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:debug_stick_state&gt;
script.zs
// IItemStack.hasDebugStickState as bool
myIItemStack.hasDebugStickState

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:dyed_color&gt;
script.zs
// IItemStack.hasDyedColor as bool
myIItemStack.hasDyedColor

Return Type: bool

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

Return Type: bool

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

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:entity_data&gt;
script.zs
// IItemStack.hasEntityData as bool
myIItemStack.hasEntityData

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:firework_explosion&gt;
script.zs
// IItemStack.hasFireworkExplosion as bool
myIItemStack.hasFireworkExplosion

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:fireworks&gt;
script.zs
// IItemStack.hasFireworks as bool
myIItemStack.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
// IItemStack.hasFoil as bool
myIItemStack.hasFoil

Return Type: bool

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

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:instrument&gt;
script.zs
// IItemStack.hasInstrument as bool
myIItemStack.hasInstrument

Return Type: bool

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

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:lock&gt;
script.zs
// IItemStack.hasLock as bool
myIItemStack.hasLock

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:lodestone_tracker&gt;
script.zs
// IItemStack.hasLodestoneTracker as bool
myIItemStack.hasLodestoneTracker

Return Type: bool

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

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:map_color&gt;
script.zs
// IItemStack.hasMapColor as bool
myIItemStack.hasMapColor

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:map_decorations&gt;
MapDecorations are additional elements that render on a map, such as waypoints.
script.zs
// IItemStack.hasMapDecorations as bool
myIItemStack.hasMapDecorations

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:map_id&gt;
script.zs
// IItemStack.hasMapId as bool
myIItemStack.hasMapId

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:map_post_processing&gt;
This componenet stores additional info on the map, such as the scale or whether to lock it.
script.zs
// IItemStack.hasMapPostProcessing as bool
myIItemStack.hasMapPostProcessing

Return Type: bool

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

Return Type: bool

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

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:note_block_sound&gt;
script.zs
// IItemStack.hasNoteBlockSound as bool
myIItemStack.hasNoteBlockSound

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:ominous_bottle_amplifier&gt;
script.zs
// IItemStack.hasOminousBottleAmplifier as bool
myIItemStack.hasOminousBottleAmplifier

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:pot_decorations&gt;
script.zs
// IItemStack.hasPotDecorations as bool
myIItemStack.hasPotDecorations

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:potion_contents&gt;
Stores Potion Data on an item.
script.zs
// IItemStack.hasPotionContents as bool
myIItemStack.hasPotionContents

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:profile&gt;
script.zs
// IItemStack.hasProfile as bool
myIItemStack.hasProfile

Return Type: bool

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

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:recipes&gt;
Used for Knowledge Books.
script.zs
// IItemStack.hasRecipes as bool
myIItemStack.hasRecipes

Return Type: bool

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

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:stored_enchantments&gt;
The stored enchantments component is only present in enchanted books, since it just stores the enchantments under a lid for future use. The item is not enchanted.
script.zs
// IItemStack.hasStoredEnchantments as bool
myIItemStack.hasStoredEnchantments

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:suspicious_stew_effects&gt;
script.zs
// IItemStack.hasSuspiciousStewEffects as bool
myIItemStack.hasSuspiciousStewEffects

Return Type: bool

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

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:trim&gt;
script.zs
// IItemStack.hasTrim as bool
myIItemStack.hasTrim

Return Type: bool

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

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:writable_book_content&gt;
script.zs
// IItemStack.hasWritableBookContent as bool
myIItemStack.hasWritableBookContent

Return Type: bool

Getter
Checks whether the ComponentAccess has &lt;componenttype:minecraft:written_book_content&gt;
script.zs
// IItemStack.hasWrittenBookContent as bool
myIItemStack.hasWrittenBookContent

Return Type: bool

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

Return Type: bool

Getter
Gets the data in &lt;componenttype:minecraft:hide_tooltip&gt;
script.zs
// IItemStack.hideTooltip as bool
myIItemStack.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
// IItemStack.hoverName as Component
myIItemStack.hoverName

Return Type: Component

Getter
Gets the data in &lt;componenttype:minecraft:instrument&gt;
script.zs
// IItemStack.instrument as Instrument
myIItemStack.instrument

Return Type: Instrument

Getter
Can this ItemStack be enchanted?
script.zs
// IItemStack.isEnchantable as bool
myIItemStack.isEnchantable

Return Type: bool

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

Return Type: bool

Getter
script.zs
// IItemStack.isImmutable as bool
myIItemStack.isImmutable

Return Type: bool

isImmutable() as bool
script.zs
// IItemStack.isImmutable() as bool;
myIItemStack.isImmutable();

Return Type: bool

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

Return Type: bool

Getter
script.zs
// IItemStack.isMutable as bool
myIItemStack.isMutable

Return Type: bool

isMutable() as bool
script.zs
// IItemStack.isMutable() as bool;
myIItemStack.isMutable();

Return Type: bool

Getter
Gets the data in the &lt;componenttype:minecraft:item_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
// IItemStack.itemName as Component
myIItemStack.itemName

Return Type: Component

Getter
script.zs
// IItemStack.items as IItemStack[]
myIItemStack.items

Return Type: IItemStack[]

Getter
Gets the data in &lt;componenttype:minecraft:lock&gt;
script.zs
// IItemStack.lockComponent as LockCode
myIItemStack.lockComponent

Return Type: LockCode

Getter
Gets the data in &lt;componenttype:minecraft:lodestone_tracker&gt;
script.zs
// IItemStack.lodestoneTracker as LodestoneTracker
myIItemStack.lodestoneTracker

Return Type: LodestoneTracker

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

Return Type: ItemLore

Getter
Gets the data in &lt;componenttype:minecraft:map_color&gt;
script.zs
// IItemStack.mapColor as MapItemColor
myIItemStack.mapColor

Return Type: MapItemColor

Getter
Gets the data in &lt;componenttype:minecraft:map_decorations&gt;
script.zs
// IItemStack.mapDecorations as MapDecorations
myIItemStack.mapDecorations

Return Type: MapDecorations

Getter
Gets the data in &lt;componenttype:minecraft:map_id&gt;
script.zs
// IItemStack.mapId as MapId
myIItemStack.mapId

Return Type: MapId

Getter
Gets the data in &lt;componenttype:minecraft:map_post_processing&gt;
script.zs
// IItemStack.mapPostProcessing as MapPostProcessing
myIItemStack.mapPostProcessing

Return Type: MapPostProcessing

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

Return Type: int

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

Return Type: int

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

Parameters:

shiftedFunction Type: ITooltipFunction
unshiftedFunction (optional) Type: ITooltipFunction

Default Value: null

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

Parameters:

amount Type: int

Return Type: IIngredientWithAmount

Getter
Gets the data in &lt;componenttype:minecraft:note_block_sound&gt;
script.zs
// IItemStack.noteBlockSound as ResourceLocation
myIItemStack.noteBlockSound

Return Type: ResourceLocation

Getter
Gets the data in &lt;componenttype:minecraft:ominous_bottle_amplifier&gt;
script.zs
// IItemStack.ominousBottleAmplifier as int
myIItemStack.ominousBottleAmplifier

Return Type: int

onlyDamaged() as IIngredient
script.zs
// IItemStack.onlyDamaged() as IIngredient;
myIItemStack.onlyDamaged();

Return Type: IIngredient

onlyDamagedAtLeast(minDamage as int) as IIngredient
script.zs
// IItemStack.onlyDamagedAtLeast(minDamage as int) as IIngredient;
myIItemStack.onlyDamagedAtLeast(myInt);

Parameters:

minDamage Type: int

Return Type: IIngredient

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

Return Type: string

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

Parameters:

percentage Type: double

Return Type: Percentaged<IItemStack>

Getter
Gets the data in &lt;componenttype:minecraft:pot_decorations&gt;
script.zs
// IItemStack.potDecorations as PotDecorations
myIItemStack.potDecorations

Return Type: PotDecorations

Getter
Gets the data in &lt;componenttype:minecraft:potion_contents&gt;
script.zs
// IItemStack.potionContents as PotionContents
myIItemStack.potionContents

Return Type: PotionContents

Getter
script.zs
// IItemStack.potPattern as DecoratedPotPattern
myIItemStack.potPattern

Return Type: DecoratedPotPattern

potPattern() as DecoratedPotPattern
script.zs
// IItemStack.potPattern() as DecoratedPotPattern;
myIItemStack.potPattern();

Return Type: DecoratedPotPattern

Getter
script.zs
// IItemStack.potPatternId as ResourceKey<DecoratedPotPattern>
myIItemStack.potPatternId

Return Type: ResourceKey<DecoratedPotPattern>

potPatternId() as ResourceKey<DecoratedPotPattern>
script.zs
// IItemStack.potPatternId() as ResourceKey<DecoratedPotPattern>;
myIItemStack.potPatternId();

Return Type: ResourceKey<DecoratedPotPattern>

Getter
Gets the data in &lt;componenttype:minecraft:profile&gt;
script.zs
// IItemStack.profile as ResolvableProfile
myIItemStack.profile

Return Type: ResolvableProfile

Getter
script.zs
// IItemStack.prototype as DataComponentMap
myIItemStack.prototype

Return Type: DataComponentMap

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

Return Type: Rarity

Getter
Gets the data in &lt;componenttype:minecraft:recipes&gt;
script.zs
// IItemStack.recipes as List<ResourceLocation>
myIItemStack.recipes

Return Type: List<ResourceLocation>

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

Return Type: ResourceLocation

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

Parameters:

Return Type: IItemStack

removeGlobalAttribute(attribute as Attribute, slotTypes as EquipmentSlot[])
This method no longer works and is deprecated, it is left in so it doesn't cause breaking changes.
Please use Item Components instead.
script.zs
// IItemStack.removeGlobalAttribute(attribute as Attribute, slotTypes as EquipmentSlot[]);
myIItemStack.removeGlobalAttribute(myAttribute, myEquipmentSlot[]);

Parameters:

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

Parameters:

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

Parameters:

uuid Type: UUID
slotTypes Type: EquipmentSlot[]
removeTooltip(regex as string)
script.zs
// IItemStack.removeTooltip(regex as string);
myIItemStack.removeTooltip(myString);

Parameters:

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

Return Type: int

reuse() as IIngredient
script.zs
// IItemStack.reuse() as IIngredient;
myIItemStack.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
// IItemStack.shrink(amount as int = 1) as IItemStack;
myIItemStack.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
// IItemStack.stackable as bool
myIItemStack.stackable

Return Type: bool

Getter
Gets the data in &lt;componenttype:minecraft:stored_enchantments&gt;
script.zs
// IItemStack.storedEnchantments as ItemEnchantments
myIItemStack.storedEnchantments

Return Type: ItemEnchantments

Getter
Gets the data in &lt;componenttype:minecraft:suspicious_stew_effects&gt;
script.zs
// IItemStack.suspiciousStewEffects as SuspiciousStewEffects
myIItemStack.suspiciousStewEffects

Return Type: SuspiciousStewEffects

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

Return Type: Tool

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

Parameters:

amount (optional) Type: int

Default Value: 1

Return Type: IIngredient

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

Parameters:

replaceWith Type: IItemStack

Return Type: IIngredient

Getter
Gets the data in &lt;componenttype:minecraft:trim&gt;
script.zs
// IItemStack.trim as ArmorTrim
myIItemStack.trim

Return Type: ArmorTrim

Getter
Gets the data in the &lt;componenttype:minecraft:unbreakable&gt;
script.zs
// IItemStack.unbreakable as Unbreakable
myIItemStack.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
// IItemStack.update<T, U>(type as DataComponentType<T>, defaultValue as T, data as U, operator as BiFunction<T, T, U>) as IItemStack;
myIItemStack.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
// IItemStack.update<T>(type as DataComponentType<T>, defaultValue as T, operator as UnaryOperator<T>) as IItemStack;
myIItemStack.update<T>(myDataComponentType, myT, myUnaryOperator);

Parameters:

defaultValue Type: T
operator Type: UnaryOperator<T>

Return Type: IItemStack

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

Return Type: bool

with(type as DataComponentType<T>, value as T?) as IItemStack
script.zs
// IItemStack.with<T>(type as DataComponentType<T>, value as T?) as IItemStack;
myIItemStack.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
// IItemStack.withAttributeModifiers(modifiers as ItemAttributeModifiers) as ComponentAccess;
myIItemStack.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
// IItemStack.withAttributeModifiers(modifier as ItemAttributeModifiersEntry, showInTooltip as bool = true) as ComponentAccess;
myIItemStack.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
// IItemStack.withAttributeModifiers(modifiers as List<ItemAttributeModifiersEntry>, showInTooltip as bool = true) as ComponentAccess;
myIItemStack.withAttributeModifiers(myList, myBool);

Parameters:

showInTooltip (optional) Type: bool

Default Value: true

Return Type: ComponentAccess

withBannerPatterns(layers as List<Layer>) as ComponentAccess
Sets the &lt;componenttype:minecraft:banner_patterns&gt; of the ComponentAccess to have the given List<BannerPatternLayers.Layer>

Returns: The new instance with the modified data.

script.zs
// IItemStack.withBannerPatterns(layers as List<BannerPatternLayersLayer>) as ComponentAccess;
myIItemStack.withBannerPatterns(myList);

Parameters:

Return Type: ComponentAccess

withBannerPatterns(layers as BannerPatternLayers) as ComponentAccess
Sets the &lt;componenttype:minecraft:banner_patterns&gt; of the ComponentAccess to have the given BannerPatternLayers

Returns: The new instance with the modified data.

script.zs
// IItemStack.withBannerPatterns(layers as BannerPatternLayers) as ComponentAccess;
myIItemStack.withBannerPatterns(myBannerPatternLayers);

Parameters:

Return Type: ComponentAccess

withBaseColor(color as DyeColor) as ComponentAccess
Sets the &lt;componenttype:minecraft:base_color&gt; of the ComponentAccess to have the given DyeColor

Returns: The new instance with the modified data.

script.zs
// IItemStack.withBaseColor(color as DyeColor) as ComponentAccess;
myIItemStack.withBaseColor(myDyeColor);

Parameters:

color Type: DyeColor

Return Type: ComponentAccess

withBees(occupants as List<Occupant>) as ComponentAccess
Sets the &lt;componenttype:minecraft:bees&gt; of the ComponentAccess to have the given occupants

Returns: The new instance with the modified data.

script.zs
// IItemStack.withBees(occupants as List<BeehiveBlockEntityOccupant>) as ComponentAccess;
myIItemStack.withBees(myList);

Parameters:

Return Type: ComponentAccess

withBlockEntityData(data as MapData) as ComponentAccess
Sets the &lt;componenttype:minecraft:block_entity_data&gt; of the ComponentAccess to have the given MapData

Returns: The new instance with the modified data.

script.zs
// IItemStack.withBlockEntityData(data as MapData) as ComponentAccess;
myIItemStack.withBlockEntityData(myMapData);

Parameters:

data Type: MapData

Return Type: ComponentAccess

withBlockEntityData(data as CustomData) as ComponentAccess
Sets the &lt;componenttype:minecraft:block_entity_data&gt; of the ComponentAccess to have the given CustomData

Returns: The new instance with the modified data.

script.zs
// IItemStack.withBlockEntityData(data as CustomData) as ComponentAccess;
myIItemStack.withBlockEntityData(myCustomData);

Parameters:

data Type: CustomData

Return Type: ComponentAccess

withBlockState(properties as BlockItemStateProperties) as ComponentAccess
Sets the &lt;componenttype:minecraft:block_state&gt; of the ComponentAccess to have the given BlockItemStateProperties

Returns: The new instance with the modified data.

script.zs
// IItemStack.withBlockState(properties as BlockItemStateProperties) as ComponentAccess;
myIItemStack.withBlockState(myBlockItemStateProperties);

Parameters:

Return Type: ComponentAccess

withBucketEntityData(data as MapData) as ComponentAccess
Sets the &lt;componenttype:minecraft:bucket_entity_data&gt; of the ComponentAccess to have the given MapData

Returns: The new instance with the modified data.

script.zs
// IItemStack.withBucketEntityData(data as MapData) as ComponentAccess;
myIItemStack.withBucketEntityData(myMapData);

Parameters:

data Type: MapData

Return Type: ComponentAccess

withBucketEntityData(data as CustomData) as ComponentAccess
Sets the &lt;componenttype:minecraft:bucket_entity_data&gt; of the ComponentAccess to have the given CustomData

Returns: The new instance with the modified data.

script.zs
// IItemStack.withBucketEntityData(data as CustomData) as ComponentAccess;
myIItemStack.withBucketEntityData(myCustomData);

Parameters:

data Type: CustomData

Return Type: ComponentAccess

withBundleContents(contents as List<IItemStack>) as ComponentAccess
Sets the &lt;componenttype:minecraft:bundle_contents&gt; of the ComponentAccess to have the given contents

Returns: The new instance with the modified data.

script.zs
// IItemStack.withBundleContents(contents as List<IItemStack>) as ComponentAccess;
myIItemStack.withBundleContents([<item:minecraft:diamond> * 64]);

Parameters:

contents Type: List<IItemStack> - A list of items to store within.

Return Type: ComponentAccess

withBundleContents(contents as BundleContents) as ComponentAccess
Sets the &lt;componenttype:minecraft:bundle_contents&gt; of the ComponentAccess to have the given BundleContents

Returns: The new instance with the modified data.

script.zs
// IItemStack.withBundleContents(contents as BundleContents) as ComponentAccess;
myIItemStack.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
// IItemStack.withCanBreak(predicates as List<BlockPredicate>, showInTooltip as bool = true) as ComponentAccess;
myIItemStack.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
// IItemStack.withCanBreak(predicate as AdventureModePredicate) as ComponentAccess;
myIItemStack.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
// IItemStack.withCanPlaceOn(predicates as List<BlockPredicate>, showInTooltip as bool = true) as ComponentAccess;
myIItemStack.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
// IItemStack.withCanPlaceOn(predicate as AdventureModePredicate) as ComponentAccess;
myIItemStack.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
Sets the &lt;componenttype:minecraft:charged_projectiles&gt; of the ComponentAccess to have the given IItemStack

Returns: The new instance with the modified data.

script.zs
// IItemStack.withChargedProjectiles(item as IItemStack) as ComponentAccess;
myIItemStack.withChargedProjectiles(<item:minecraft:arrow>);

Parameters:

item Type: IItemStack - The item to store within.

Return Type: ComponentAccess

withChargedProjectiles(items as List<IItemStack>) as ComponentAccess
Sets the &lt;componenttype:minecraft:charged_projectiles&gt; of the ComponentAccess to have the given items.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withChargedProjectiles(items as List<IItemStack>) as ComponentAccess;
myIItemStack.withChargedProjectiles([<item:minecraft:arrow>]);

Parameters:

items Type: List<IItemStack> - The items to store within.

Return Type: ComponentAccess

withChargedProjectiles(chargedProjectiles as ChargedProjectiles) as ComponentAccess
Sets the &lt;componenttype:minecraft:charged_projectiles&gt; of the ComponentAccess to have the given ChargedProjectiles

Returns: The new instance with the modified data.

script.zs
// IItemStack.withChargedProjectiles(chargedProjectiles as ChargedProjectiles) as ComponentAccess;
myIItemStack.withChargedProjectiles(myChargedProjectiles);

Parameters:

chargedProjectiles Type: ChargedProjectiles

Return Type: ComponentAccess

withContainer(contents as List<IItemStack>) as ComponentAccess
Sets the &lt;componenttype:minecraft:container&gt; of the ComponentAccess to have the given values.

Returns: The new instance with the modified data.

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

Parameters:

contents Type: List<IItemStack>

Return Type: ComponentAccess

withContainer(contents as ItemContainerContents) as ComponentAccess
Sets the &lt;componenttype:minecraft:container&gt; of the ComponentAccess to have the given ItemContainerContents

Returns: The new instance with the modified data.

script.zs
// IItemStack.withContainer(contents as ItemContainerContents) as ComponentAccess;
myIItemStack.withContainer(myItemContainerContents);

Parameters:

Return Type: ComponentAccess

withContainerLoot(lootTable as ResourceKey<LootTable>, seed as long) as ComponentAccess
Sets the &lt;componenttype:minecraft:container_loot&gt; of the ComponentAccess to have the given loot table and seed.

Returns: The new instance with the modified data.

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

Parameters:

seed Type: long

Return Type: ComponentAccess

withContainerLoot(loot as SeededContainerLoot) as ComponentAccess
Sets the &lt;componenttype:minecraft:container_loot&gt; of the ComponentAccess to have the given SeededContainerLoot

Returns: The new instance with the modified data.

script.zs
// IItemStack.withContainerLoot(loot as SeededContainerLoot) as ComponentAccess;
myIItemStack.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
// IItemStack.withCreativeSlotLock() as ComponentAccess;
myIItemStack.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
// IItemStack.withCustomData(customData as MapData) as ComponentAccess;
myIItemStack.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
// IItemStack.withCustomData(customData as CustomData) as ComponentAccess;
myIItemStack.withCustomData(myCustomData);

Parameters:

customData Type: CustomData

Return Type: ComponentAccess

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

Returns: The new instance with the modified data.

script.zs
// IItemStack.withCustomModelData(value as int) as ComponentAccess;
myIItemStack.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
// IItemStack.withCustomModelData(data as CustomModelData) as ComponentAccess;
myIItemStack.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
// IItemStack.withCustomName(name as Component) as ComponentAccess;
myIItemStack.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. Using this on an item that has no maxDamage may have unforeseen issues.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withDamage(damage as int) as ComponentAccess;
myIItemStack.withDamage(16);

Parameters:

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

Return Type: ComponentAccess

withDebugStickState(state as DebugStickState) as ComponentAccess
Sets the &lt;componenttype:minecraft:debug_stick_state&gt; of the ComponentAccess to have the given DebugStickState

Returns: The new instance with the modified data.

script.zs
// IItemStack.withDebugStickState(state as DebugStickState) as ComponentAccess;
myIItemStack.withDebugStickState(myDebugStickState);

Parameters:

Return Type: ComponentAccess

withDyedColor(rgb as int, showInTooltip as bool = true) as ComponentAccess
Sets the &lt;componenttype:minecraft:dyed_color&gt; of the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withDyedColor(rgb as int, showInTooltip as bool = true) as ComponentAccess;
myIItemStack.withDyedColor(0xFFFF00, true);

Parameters:

rgb Type: int - The colour to dye this item with
showInTooltip (optional) Type: bool - Whether to show this information in a tooltip

Default Value: true

Return Type: ComponentAccess

withDyedColor(color as DyedItemColor) as ComponentAccess
Sets the &lt;componenttype:minecraft:dyed_color&gt; of the ComponentAccess to have the given DyedItemColor

Returns: The new instance with the modified data.

script.zs
// IItemStack.withDyedColor(color as DyedItemColor) as ComponentAccess;
myIItemStack.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
// IItemStack.withEnchantment(enchantment as Enchantment, level as int = 1) as ComponentAccess;
myIItemStack.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
// IItemStack.withEnchantmentGlintOverride(value as bool) as ComponentAccess;
myIItemStack.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
// IItemStack.withEnchantments(enchantments as ItemEnchantments) as ComponentAccess;
myIItemStack.withEnchantments(myItemEnchantments);

Parameters:

enchantments Type: ItemEnchantments

Return Type: ComponentAccess

withEntityData(data as MapData) as ComponentAccess
Sets the &lt;componenttype:minecraft:entity_data&gt; of the ComponentAccess to have the given MapData

Returns: The new instance with the modified data.

script.zs
// IItemStack.withEntityData(data as MapData) as ComponentAccess;
myIItemStack.withEntityData(myMapData);

Parameters:

data Type: MapData

Return Type: ComponentAccess

withEntityData(data as CustomData) as ComponentAccess
Sets the &lt;componenttype:minecraft:entity_data&gt; of the ComponentAccess to have the given CustomData

Returns: The new instance with the modified data.

script.zs
// IItemStack.withEntityData(data as CustomData) as ComponentAccess;
myIItemStack.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
// IItemStack.withFireResistant() as ComponentAccess;
myIItemStack.withFireResistant();

Return Type: ComponentAccess

withFireworkExplosion(explosion as FireworkExplosion) as ComponentAccess
Sets the &lt;componenttype:minecraft:firework_explosion&gt; of the ComponentAccess to have the given FireworkExplosion

Returns: The new instance with the modified data.

script.zs
// IItemStack.withFireworkExplosion(explosion as FireworkExplosion) as ComponentAccess;
myIItemStack.withFireworkExplosion(myFireworkExplosion);

Parameters:

Return Type: ComponentAccess

withFireworks(flightDuration as int, explosions as List<FireworkExplosion>) as ComponentAccess
Sets the &lt;componenttype:minecraft:fireworks&gt; of the ComponentAccess to have the given duration and explosions.

Returns: The new instance with the modified data.

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

Parameters:

flightDuration Type: int
explosions Type: List<FireworkExplosion>

Return Type: ComponentAccess

withFireworks(fireworks as Fireworks) as ComponentAccess
Sets the &lt;componenttype:minecraft:fireworks&gt; of the ComponentAccess to have the given Fireworks

Returns: The new instance with the modified data.

script.zs
// IItemStack.withFireworks(fireworks as Fireworks) as ComponentAccess;
myIItemStack.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
// IItemStack.withFood(food as FoodProperties) as ComponentAccess;
myIItemStack.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
// IItemStack.withHideAdditionalTooltip() as ComponentAccess;
myIItemStack.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
// IItemStack.withHideTooltip() as ComponentAccess;
myIItemStack.withHideTooltip();

Return Type: ComponentAccess

withInstrument(instrument as Instrument) as ComponentAccess
Sets the &lt;componenttype:minecraft:instrument&gt; of the ComponentAccess to have the given Instrument

Returns: The new instance with the modified data.

script.zs
// IItemStack.withInstrument(instrument as Instrument) as ComponentAccess;
myIItemStack.withInstrument(myInstrument);

Parameters:

instrument Type: Instrument

Return Type: ComponentAccess

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

Returns: The new instance with the modified data.

script.zs
// IItemStack.withIntangibleProjectile() as ComponentAccess;
myIItemStack.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
// IItemStack.withItemName(name as Component) as ComponentAccess;
myIItemStack.withItemName(Component.literal("Fancy Water"));

Parameters:

name Type: Component

Return Type: ComponentAccess

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

Parameters:

value Type: IData

Return Type: IItemStack

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

Parameters:

value Type: IData

Return Type: IItemStack

withLock(code as string) as ComponentAccess
Sets the &lt;componenttype:minecraft:lock&gt; of the ComponentAccess to have the given string.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withLock(code as string) as ComponentAccess;
myIItemStack.withLock(myString);

Parameters:

code Type: string

Return Type: ComponentAccess

withLock(lock as LockCode) as ComponentAccess
Sets the &lt;componenttype:minecraft:lock&gt; of the ComponentAccess to have the given LockCode

Returns: The new instance with the modified data.

script.zs
// IItemStack.withLock(lock as LockCode) as ComponentAccess;
myIItemStack.withLock(myLockCode);

Parameters:

lock Type: LockCode

Return Type: ComponentAccess

withLodestoneTracker(tracker as LodestoneTracker) as ComponentAccess
Sets the &lt;componenttype:minecraft:lodestone_tracker&gt; of the ComponentAccess to have the given LodestoneTracker

Returns: The new instance with the modified data.

script.zs
// IItemStack.withLodestoneTracker(tracker as LodestoneTracker) as ComponentAccess;
myIItemStack.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
// IItemStack.withLore(components as List<Component>) as ComponentAccess;
myIItemStack.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(components as Component) as ComponentAccess
script.zs
// IItemStack.withLore(components as Component) as ComponentAccess;
myIItemStack.withLore(myComponent);

Parameters:

components Type: Component

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
// IItemStack.withLore(lore as ItemLore) as ComponentAccess;
myIItemStack.withLore(myItemLore);

Parameters:

lore Type: ItemLore

Return Type: ComponentAccess

withMapColor(rgb as int) as ComponentAccess
Sets the &lt;componenttype:minecraft:map_color&gt; of the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withMapColor(rgb as int) as ComponentAccess;
myIItemStack.withMapColor(0xFF0000);

Parameters:

rgb Type: int - The new map colour

Return Type: ComponentAccess

withMapColor(color as MapItemColor) as ComponentAccess
Sets the &lt;componenttype:minecraft:map_color&gt; of the ComponentAccess to have the given MapItemColor

Returns: The new instance with the modified data.

script.zs
// IItemStack.withMapColor(color as MapItemColor) as ComponentAccess;
myIItemStack.withMapColor(myMapItemColor);

Parameters:

color Type: MapItemColor

Return Type: ComponentAccess

withMapDecorations(decorations as Entry[string]) as ComponentAccess
Sets the &lt;componenttype:minecraft:map_decorations&gt; of the ComponentAccess to have the given values.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withMapDecorations(decorations as MapDecorationsEntry[string]) as ComponentAccess;
myIItemStack.withMapDecorations(myMap);

Parameters:

decorations Type: MapDecorationsEntry[string]

Return Type: ComponentAccess

withMapDecorations(decorations as MapDecorations) as ComponentAccess
Sets the &lt;componenttype:minecraft:map_decorations&gt; of the ComponentAccess to have the given MapDecorations

Returns: The new instance with the modified data.

script.zs
// IItemStack.withMapDecorations(decorations as MapDecorations) as ComponentAccess;
myIItemStack.withMapDecorations(myMapDecorations);

Parameters:

decorations Type: MapDecorations

Return Type: ComponentAccess

withMapId(id as int) as ComponentAccess
Sets the &lt;componenttype:minecraft:map_id&gt; of the ComponentAccess to have the given value.
A map id is only useful after the game generates one to store data. Therefore, you should always pass in the parameter for an id you know is available.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withMapId(id as int) as ComponentAccess;
myIItemStack.withMapId(myInt);

Parameters:

id Type: int

Return Type: ComponentAccess

withMapId(mapId as MapId) as ComponentAccess
Sets the &lt;componenttype:minecraft:map_id&gt; of the ComponentAccess to have the given MapId

Returns: The new instance with the modified data.

script.zs
// IItemStack.withMapId(mapId as MapId) as ComponentAccess;
myIItemStack.withMapId(myMapId);

Parameters:

mapId Type: MapId

Return Type: ComponentAccess

withMapPostProcessing(value as MapPostProcessing) as ComponentAccess
Sets the &lt;componenttype:minecraft:map_post_processing&gt; of the ComponentAccess to have the given MapPostProcessing

Returns: The new instance with the modified data.

script.zs
// IItemStack.withMapPostProcessing(value as MapPostProcessing) as ComponentAccess;
myIItemStack.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.
It is likely that you need to call withDamage(0) in order for some things to function properly.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withMaxDamage(maxDamage as int) as ComponentAccess;
myIItemStack.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
// IItemStack.withMaxStackSize(maxStackSize as int) as ComponentAccess;
myIItemStack.withMaxStackSize(16);

Parameters:

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

Return Type: ComponentAccess

withNoteBlockSound(sound as ResourceLocation) as ComponentAccess
Sets the &lt;componenttype:minecraft:note_block_sound&gt; of the ComponentAccess to have the given ResourceLocation

Returns: The new instance with the modified data.

script.zs
// IItemStack.withNoteBlockSound(sound as ResourceLocation) as ComponentAccess;
myIItemStack.withNoteBlockSound(myResourceLocation);

Parameters:

Return Type: ComponentAccess

withOminousBottleAmplifier(amplifier as int) as ComponentAccess
Sets the &lt;componenttype:minecraft:ominous_bottle_amplifier&gt; of the ComponentAccess to have the given amplifier.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withOminousBottleAmplifier(amplifier as int) as ComponentAccess;
myIItemStack.withOminousBottleAmplifier(myInt);

Parameters:

amplifier Type: int

Return Type: ComponentAccess

without(type as DataComponentType<T>) as IItemStack
script.zs
// IItemStack.without<T>(type as DataComponentType<T>) as IItemStack;
myIItemStack.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
// IItemStack.withoutAttributeModifiers() as ComponentAccess;
myIItemStack.withoutAttributeModifiers();

Return Type: ComponentAccess

withoutBannerPatterns() as ComponentAccess
Removes the &lt;componenttype:minecraft:banner_patterns&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutBannerPatterns() as ComponentAccess;
myIItemStack.withoutBannerPatterns();

Return Type: ComponentAccess

withoutBaseColor() as ComponentAccess
Removes the &lt;componenttype:minecraft:base_color&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutBaseColor() as ComponentAccess;
myIItemStack.withoutBaseColor();

Return Type: ComponentAccess

withoutBees() as ComponentAccess
Removes the &lt;componenttype:minecraft:bees&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutBees() as ComponentAccess;
myIItemStack.withoutBees();

Return Type: ComponentAccess

withoutBlockEntityData() as ComponentAccess
Removes the &lt;componenttype:minecraft:block_entity_data&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutBlockEntityData() as ComponentAccess;
myIItemStack.withoutBlockEntityData();

Return Type: ComponentAccess

withoutBlockState() as ComponentAccess
Removes the &lt;componenttype:minecraft:block_state&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutBlockState() as ComponentAccess;
myIItemStack.withoutBlockState();

Return Type: ComponentAccess

withoutBucketEntityData() as ComponentAccess
Removes the &lt;componenttype:minecraft:bucket_entity_data&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutBucketEntityData() as ComponentAccess;
myIItemStack.withoutBucketEntityData();

Return Type: ComponentAccess

withoutBundleContents() as ComponentAccess
Removes the &lt;componenttype:minecraft:bundle_contents&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutBundleContents() as ComponentAccess;
myIItemStack.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
// IItemStack.withoutCanBreak() as ComponentAccess;
myIItemStack.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
// IItemStack.withoutCanPlaceOn() as ComponentAccess;
myIItemStack.withoutCanPlaceOn();

Return Type: ComponentAccess

withoutChargedProjectiles() as ComponentAccess
Removes the &lt;componenttype:minecraft:charged_projectiles&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutChargedProjectiles() as ComponentAccess;
myIItemStack.withoutChargedProjectiles();

Return Type: ComponentAccess

withoutComponents() as IItemStack
script.zs
// IItemStack.withoutComponents() as IItemStack;
myIItemStack.withoutComponents();

Return Type: IItemStack

withoutContainer() as ComponentAccess
Removes the &lt;componenttype:minecraft:container&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutContainer() as ComponentAccess;
myIItemStack.withoutContainer();

Return Type: ComponentAccess

withoutContainerLoot() as ComponentAccess
Removes the &lt;componenttype:minecraft:container_loot&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutContainerLoot() as ComponentAccess;
myIItemStack.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
// IItemStack.withoutCreativeSlotLock() as ComponentAccess;
myIItemStack.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
// IItemStack.withoutCustomData() as ComponentAccess;
myIItemStack.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
// IItemStack.withoutCustomModelData() as ComponentAccess;
myIItemStack.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
// IItemStack.withoutCustomName() as ComponentAccess;
myIItemStack.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
// IItemStack.withoutDamage() as ComponentAccess;
myIItemStack.withoutDamage();

Return Type: ComponentAccess

withoutDebugStickState() as ComponentAccess
Removes the &lt;componenttype:minecraft:debug_stick_state&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutDebugStickState() as ComponentAccess;
myIItemStack.withoutDebugStickState();

Return Type: ComponentAccess

withoutDyedColor() as ComponentAccess
Removes the &lt;componenttype:minecraft:dyed_color&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutDyedColor() as ComponentAccess;
myIItemStack.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
// IItemStack.withoutEnchantment(enchantment as Enchantment) as ComponentAccess;
myIItemStack.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
// IItemStack.withoutEnchantmentGlintOverride() as ComponentAccess;
myIItemStack.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
// IItemStack.withoutEnchantments() as ComponentAccess;
myIItemStack.withoutEnchantments();

Return Type: ComponentAccess

withoutEntityDate() as ComponentAccess
Removes the &lt;componenttype:minecraft:entity_data&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutEntityDate() as ComponentAccess;
myIItemStack.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
// IItemStack.withoutFireResistant() as ComponentAccess;
myIItemStack.withoutFireResistant();

Return Type: ComponentAccess

withoutFireworkExplosion() as ComponentAccess
Removes the &lt;componenttype:minecraft:firework_explosion&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutFireworkExplosion() as ComponentAccess;
myIItemStack.withoutFireworkExplosion();

Return Type: ComponentAccess

withoutFireworks() as ComponentAccess
Removes the &lt;componenttype:minecraft:fireworks&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutFireworks() as ComponentAccess;
myIItemStack.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
// IItemStack.withoutFood() as ComponentAccess;
myIItemStack.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
// IItemStack.withoutHideAdditionalTooltip() as ComponentAccess;
myIItemStack.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
// IItemStack.withoutHideTooltip() as ComponentAccess;
myIItemStack.withoutHideTooltip();

Return Type: ComponentAccess

withoutInstrument() as ComponentAccess
Removes the &lt;componenttype:minecraft:instrument&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutInstrument() as ComponentAccess;
myIItemStack.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
// IItemStack.withoutIntangibleProjectile() as ComponentAccess;
myIItemStack.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
// IItemStack.withoutItemName() as ComponentAccess;
myIItemStack.withoutItemName();

Return Type: ComponentAccess

withoutLock() as ComponentAccess
Removes the &lt;componenttype:minecraft:lock&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutLock() as ComponentAccess;
myIItemStack.withoutLock();

Return Type: ComponentAccess

withoutLodestoneTracker() as ComponentAccess
Removes the &lt;componenttype:minecraft:lodestone_tracker&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutLodestoneTracker() as ComponentAccess;
myIItemStack.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
// IItemStack.withoutLore() as ComponentAccess;
myIItemStack.withoutLore();

Return Type: ComponentAccess

withoutMapColor() as ComponentAccess
Removes the &lt;componenttype:minecraft:map_color&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutMapColor() as ComponentAccess;
myIItemStack.withoutMapColor();

Return Type: ComponentAccess

withoutMapDecorations() as ComponentAccess
Removes the &lt;componenttype:minecraft:map_decorations&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutMapDecorations() as ComponentAccess;
myIItemStack.withoutMapDecorations();

Return Type: ComponentAccess

withoutMapId() as ComponentAccess
Removes the &lt;componenttype:minecraft:map_id&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutMapId() as ComponentAccess;
myIItemStack.withoutMapId();

Return Type: ComponentAccess

withoutMapPostProcessing() as ComponentAccess
Removes the &lt;componenttype:minecraft:map_post_processing&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutMapPostProcessing() as ComponentAccess;
myIItemStack.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
// IItemStack.withoutMaxDamage() as ComponentAccess;
myIItemStack.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
// IItemStack.withoutMaxStackSize() as ComponentAccess;
myIItemStack.withoutMaxStackSize();

Return Type: ComponentAccess

withoutNoteBlockSound() as ComponentAccess
Removes the &lt;componenttype:minecraft:note_block_sound&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutNoteBlockSound() as ComponentAccess;
myIItemStack.withoutNoteBlockSound();

Return Type: ComponentAccess

withoutOminousBottleAmplifier() as ComponentAccess
Removes the &lt;componenttype:minecraft:ominous_bottle_amplifier&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutOminousBottleAmplifier() as ComponentAccess;
myIItemStack.withoutOminousBottleAmplifier();

Return Type: ComponentAccess

withoutPotDecorations() as ComponentAccess
Removes the &lt;componenttype:minecraft:pot_decorations&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutPotDecorations() as ComponentAccess;
myIItemStack.withoutPotDecorations();

Return Type: ComponentAccess

withoutPotionContents() as ComponentAccess
Removes the &lt;componenttype:minecraft:potion_contents&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutPotionContents() as ComponentAccess;
myIItemStack.withoutPotionContents();

Return Type: ComponentAccess

withoutProfile() as ComponentAccess
Removes the &lt;componenttype:minecraft:profile&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutProfile() as ComponentAccess;
myIItemStack.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
// IItemStack.withoutRarity() as ComponentAccess;
myIItemStack.withoutRarity();

Return Type: ComponentAccess

withoutRecipes() as ComponentAccess
Removes the &lt;componenttype:minecraft:recipes&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutRecipes() as ComponentAccess;
myIItemStack.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
// IItemStack.withoutRepairCost() as ComponentAccess;
myIItemStack.withoutRepairCost();

Return Type: ComponentAccess

withoutStoredEnchantments() as ComponentAccess
Removes the &lt;componenttype:minecraft:stored_enchantments&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutStoredEnchantments() as ComponentAccess;
myIItemStack.withoutStoredEnchantments();

Return Type: ComponentAccess

withoutSuspiciousStewEffects() as ComponentAccess
Removes the &lt;componenttype:minecraft:suspicious_stew_effects&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutSuspiciousStewEffects() as ComponentAccess;
myIItemStack.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
// IItemStack.withoutTool() as ComponentAccess;
myIItemStack.withoutTool();

Return Type: ComponentAccess

withoutTrim() as ComponentAccess
Removes the &lt;componenttype:minecraft:trim&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutTrim() as ComponentAccess;
myIItemStack.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
// IItemStack.withoutUnbreakable() as ComponentAccess;
myIItemStack.withoutUnbreakable();

Return Type: ComponentAccess

withoutWritableBookContent() as ComponentAccess
Removes the &lt;componenttype:minecraft:writable_book_content&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutWritableBookContent() as ComponentAccess;
myIItemStack.withoutWritableBookContent();

Return Type: ComponentAccess

withoutWrittenBookContent() as ComponentAccess
Removes the &lt;componenttype:minecraft:written_book_content&gt; from the ComponentAccess.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withoutWrittenBookContent() as ComponentAccess;
myIItemStack.withoutWrittenBookContent();

Return Type: ComponentAccess

withPotDecorations(back as Item, left as Item, right as Item, front as Item) as ComponentAccess
Sets the &lt;componenttype:minecraft:pot_decorations&gt; of the ComponentAccess to have the given items.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withPotDecorations(back as ItemDefinition, left as ItemDefinition, right as ItemDefinition, front as ItemDefinition) as ComponentAccess;
myIItemStack.withPotDecorations(myItem, myItem, myItem, myItem);

Return Type: ComponentAccess

withPotDecorations(decorations as PotDecorations) as ComponentAccess
Sets the &lt;componenttype:minecraft:pot_decorations&gt; of the ComponentAccess to have the given PotDecorations

Returns: The new instance with the modified data.

script.zs
// IItemStack.withPotDecorations(decorations as PotDecorations) as ComponentAccess;
myIItemStack.withPotDecorations(myPotDecorations);

Parameters:

decorations Type: PotDecorations

Return Type: ComponentAccess

withPotionContents(potion as Potion) as ComponentAccess
Sets the &lt;componenttype:minecraft:potion_contents&gt; of the ComponentAccess to have the given Potion
and no custom effects

Returns: The new instance with the modified data.

script.zs
// IItemStack.withPotionContents(potion as Potion) as ComponentAccess;
myIItemStack.withPotionContents(<potion:minecraft:swiftness>);

Parameters:

potion Type: Potion - The potion to store within

Return Type: ComponentAccess

withPotionContents(potion as Potion, customEffects as List<MobEffectInstance>) as ComponentAccess
Sets the &lt;componenttype:minecraft:potion_contents&gt; of the ComponentAccess to have the given Potion
and the given MobEffectInstance effects.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withPotionContents(potion as Potion, customEffects as List<MobEffectInstance>) as ComponentAccess;
myIItemStack.withPotionContents(<potion:minecraft:swiftness>, [MobEffectInstance.of(<mobeffect:minecraft:strength>, 20 * 20, 1, false, false, true)]);

Parameters:

potion Type: Potion - The potion to store within.
customEffects Type: List<MobEffectInstance> - The effects to grant upon consuming this potion.

Return Type: ComponentAccess

withPotionContents(potion as Potion, customColor as int, customEffects as List<MobEffectInstance>) as ComponentAccess
Sets the &lt;componenttype:minecraft:potion_contents&gt; of the ComponentAccess to have the given Potion
and the given MobEffectInstance effects.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withPotionContents(potion as Potion, customColor as int, customEffects as List<MobEffectInstance>) as ComponentAccess;
myIItemStack.withPotionContents(<potion:minecraft:swiftness>, 0xFFFFFF00, [MobEffectInstance.of(<mobeffect:minecraft:strength>, 20 * 20, 1, false, false, true)]);

Parameters:

potion Type: Potion - The potion to store within.
customColor Type: int - The ARGB color the potion will have.
customEffects Type: List<MobEffectInstance> - The effects to grant upon consuming this potion.

Return Type: ComponentAccess

withPotionContents(contents as PotionContents) as ComponentAccess
Sets the &lt;componenttype:minecraft:potion_contents&gt; of the ComponentAccess to have the given PotionContents

Returns: The new instance with the modified data.

script.zs
// IItemStack.withPotionContents(contents as PotionContents) as ComponentAccess;
myIItemStack.withPotionContents(myPotionContents);

Parameters:

contents Type: PotionContents

Return Type: ComponentAccess

withProfile(profile as ResolvableProfile) as ComponentAccess
Sets the &lt;componenttype:minecraft:profile&gt; of the ComponentAccess to have the given ResolvableProfile

Returns: The new instance with the modified data.

script.zs
// IItemStack.withProfile(profile as ResolvableProfile) as ComponentAccess;
myIItemStack.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
// IItemStack.withRarity(rarity as Rarity) as ComponentAccess;
myIItemStack.withRarity(<constant:minecraft:item/rarity:epic>);

Parameters:

rarity Type: Rarity - The rarity to set

Return Type: ComponentAccess

withRecipes(recipes as List<ResourceLocation>) as ComponentAccess
Sets the &lt;componenttype:minecraft:recipes&gt; of the ComponentAccess to have the given List<ResourceLocation>

Returns: The new instance with the modified data.

script.zs
// IItemStack.withRecipes(recipes as List<ResourceLocation>) as ComponentAccess;
myIItemStack.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
// IItemStack.withRepairCost(cost as int) as ComponentAccess;
myIItemStack.withRepairCost(20);

Parameters:

cost Type: int - The repair cost

Return Type: ComponentAccess

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

Returns: The new instance with the modified data.

script.zs
// IItemStack.withStoredEnchantments(enchantments as ItemEnchantments) as ComponentAccess;
myIItemStack.withStoredEnchantments(myItemEnchantments);

Parameters:

enchantments Type: ItemEnchantments

Return Type: ComponentAccess

withSuspiciousStewEffects(effects as List<Entry>) as ComponentAccess
Sets the &lt;componenttype:minecraft:suspicious_stew_effects&gt; of the ComponentAccess to have the given SuspiciousStewEffects
SuspiciousStewEffects.Entry is effectively a pair of Effect and duration.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withSuspiciousStewEffects(effects as List<SuspiciousStewEffectsEntry>) as ComponentAccess;
myIItemStack.withSuspiciousStewEffects(myList);

Parameters:

effects Type: List<SuspiciousStewEffectsEntry> - The list of effects to grant on consumption.

Return Type: ComponentAccess

withSuspiciousStewEffects(suspiciousStewEffects as SuspiciousStewEffects) as ComponentAccess
Sets the &lt;componenttype:minecraft:suspicious_stew_effects&gt; of the ComponentAccess to have the given SuspiciousStewEffects

Returns: The new instance with the modified data.

script.zs
// IItemStack.withSuspiciousStewEffects(suspiciousStewEffects as SuspiciousStewEffects) as ComponentAccess;
myIItemStack.withSuspiciousStewEffects(mySuspiciousStewEffects);

Parameters:

suspiciousStewEffects Type: SuspiciousStewEffects

Return Type: ComponentAccess

withTool(rules as List<Rule>, defaultMiningSpeed as float, damagePerBlock as int) as ComponentAccess
Sets the &lt;componenttype:minecraft:tool&gt; of the ComponentAccess to have the given data. A Tool instance is constructed from the parameters.

Returns: The new instance with the modified data.

script.zs
// IItemStack.withTool(rules as List<ToolRule>, defaultMiningSpeed as float, damagePerBlock as int) as ComponentAccess;
myIItemStack.withTool([ToolRule.minesAndDrops(<tag:blocks:minecraft:planks>, 6.0f)], 0.25f, 1);

Parameters:

rules Type: List<ToolRule> - The list of rules the new Tool instance will have
defaultMiningSpeed Type: float - The default mining speed of the new tool
damagePerBlock Type: int - The damage or durability that is dealt to the Tool after use.

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
// IItemStack.withTool(tool as Tool) as ComponentAccess;
myIItemStack.withTool(myTool);

Parameters:

tool Type: Tool

Return Type: ComponentAccess

withTrim(trim as ArmorTrim) as ComponentAccess
Sets the &lt;componenttype:minecraft:trim&gt; of the ComponentAccess to have the given ArmorTrim

Returns: The new instance with the modified data.

script.zs
// IItemStack.withTrim(trim as ArmorTrim) as ComponentAccess;
myIItemStack.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
// IItemStack.withUnbreakable(showInTooltip as bool = true) as ComponentAccess;
myIItemStack.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
// IItemStack.withUnbreakable(unbreakable as Unbreakable) as ComponentAccess;
myIItemStack.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
// IItemStack.withWritableBookContent(pages as List<Filterable<string>>) as ComponentAccess;
myIItemStack.withWritableBookContent(myList);

Parameters:

pages Type: List<Filterable<string>>

Return Type: ComponentAccess

withWritableBookContent(content as WritableBookContent) as ComponentAccess
Sets the &lt;componenttype:minecraft:writable_book_content&gt; of the ComponentAccess to have the given WritableBookContent

Returns: The new instance with the modified data.

script.zs
// IItemStack.withWritableBookContent(content as WritableBookContent) as ComponentAccess;
myIItemStack.withWritableBookContent(myWritableBookContent);

Parameters:

Return Type: ComponentAccess

withWrittenBookContent(content as WrittenBookContent) as ComponentAccess
Sets the &lt;componenttype:minecraft:written_book_content&gt; of the ComponentAccess to have the given WrittenBookContent

Returns: The new instance with the modified data.

script.zs
// IItemStack.withWrittenBookContent(content as WrittenBookContent) as ComponentAccess;
myIItemStack.withWrittenBookContent(myWrittenBookContent);

Parameters:

Return Type: ComponentAccess

Getter
Gets the data in &lt;componenttype:minecraft:writable_book_content&gt;
script.zs
// IItemStack.writableBookContent as WritableBookContent
myIItemStack.writableBookContent

Return Type: WritableBookContent

Getter
Gets the data in &lt;componenttype:minecraft:written_book_content&gt;
script.zs
// IItemStack.writtenBookContent as WrittenBookContent
myIItemStack.writtenBookContent

Return Type: WrittenBookContent