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.
import crafttweaker . api.item . FabricItemStack;
FabricItemStack
implements the following interfaces:
IItemStack
,IIngredient
,IIngredientWithAmount
,DataComponentHolder
,ComponentAccess <IItemStack >
,CommandStringDisplayable
Does the ingredient contain the given ingredient? // ((ingredient as IIngredient) in FabricItemStack) as bool
myIIngredient in myFabricItemStack
Return Type:
bool
Use this in contexts where machines accept more than one item to state that fact. // (FabricItemStack * (amount as int)) as IIngredientWithAmount
myFabricItemStack * myInt
Return Type:
IIngredientWithAmount
// (FabricItemStack | (other as IIngredient)) as IIngredientList
myFabricItemStack | myIIngredient
Return Type:
IIngredientList
// (FabricItemStack % (percentage as double)) as Percentaged<IItemStack>
myFabricItemStack % myDouble
Parameters:
percentage: double
Type: double
Return Type:
Percentaged <IItemStack >
Sets the amount of the ItemStack // (FabricItemStack * (amount as int)) as IItemStack
myFabricItemStack * myInt
Parameters:
amount: int
Type: int
- new amount
Return Type:
IItemStack
Adds an AttributeModifier to this IIngredient. Attributes added with this method appear on all ItemStacks that match this IIngredient, regardless of how or when the ItemStack was made, if you want to have the attribute on a single specific ItemStack (such as a specific Diamond Sword made in a recipe), then you should use IItemStack#withAttributeModifier // FabricItemStack.addGlobalAttributeModifier(attribute as Attribute, name as string, value as double, operation as Operation, slotTypes as EquipmentSlot[]);
myFabricItemStack . addGlobalAttributeModifier( < attribute : minecraft:generic.attack_damage > , "Extra Power" , 10 , AttributeOperation . ADDITION, [ < constant : minecraft:equipmentslot:chest > ]);
Parameters:
name: string
Type: string
- The name of the modifier.
value: double
Type: double
- The value of the modifier.
Adds an AttributeModifier to this IIngredient using a specific UUID. The UUID can be used to override an existing attribute on an ItemStack with this new modifier. You can use /ct hand attributes
to get the UUID of the attributes on an ItemStack. Attributes added with this method appear on all ItemStacks that match this IIngredient, regardless of how or when the ItemStack was made, if you want to have the attribute on a single specific ItemStack (such as a specific Diamond Sword made in a recipe), then you should use IItemStack#withAttributeModifier // FabricItemStack.addGlobalAttributeModifier(attribute as Attribute, uuid as string, name as string, value as double, operation as Operation, slotTypes as EquipmentSlot[]);
myFabricItemStack . addGlobalAttributeModifier( < attribute : minecraft:generic.attack_damage > , "8c1b5535-9f79-448b-87ae-52d81480aaa3" , "Extra Power" , 10 , AttributeOperation . ADDITION, [ < constant : minecraft:equipmentslot:chest > ]);
Parameters:
uuid: string
Type: string
- The unique identifier of the modifier to replace.
name: string
Type: string
- The name of the modifier.
value: double
Type: double
- The value of the modifier.
Adds an AttributeModifier to this IIngredient using a specific UUID. The UUID can be used to override an existing attribute on an ItemStack with this new modifier. You can use /ct hand attributes
to get the UUID of the attributes on an ItemStack. Attributes added with this method appear on all ItemStacks that match this IIngredient, regardless of how or when the ItemStack was made, if you want to have the attribute on a single specific ItemStack (such as a specific Diamond Sword made in a recipe), then you should use IItemStack#withAttributeModifier // FabricItemStack.addGlobalAttributeModifier(attribute as Attribute, uuid as UUID, name as string, value as double, operation as Operation, slotTypes as EquipmentSlot[]);
myFabricItemStack . addGlobalAttributeModifier( < attribute : minecraft:generic.attack_damage > , IItemStack . BASE_ATTACK_DAMAGE_UUID, "Extra Power" , 10 , AttributeOperation . ADDITION, [ < constant : minecraft:equipmentslot:chest > ]);
Parameters:
uuid: UUID
Type: UUID
- The unique identifier of the modifier to replace.
name: string
Type: string
- The name of the modifier.
value: double
Type: double
- The value of the modifier.
// FabricItemStack.addShiftTooltip(content as Component, showMessage as Component = null);
myFabricItemStack . addShiftTooltip(myComponent, myComponent);
// FabricItemStack.addTooltip(content as Component);
myFabricItemStack . addTooltip(myComponent);
Gets the amount of Items in the ItemStack // FabricItemStack.amount as int
Return Type:
int
Gets the amount of Items in the ItemStack // FabricItemStack.amount as int
Return Type:
int
// FabricItemStack.anyDamage() as IIngredient;
myFabricItemStack . anyDamage();
Return Type:
IIngredient
// FabricItemStack.applyComponents(map as DataComponentMap) as IItemStack;
myFabricItemStack . applyComponents(myDataComponentMap);
Return Type:
IItemStack
// FabricItemStack.applyComponents(patch as DataComponentPatch) as IItemStack;
myFabricItemStack . applyComponents(myDataComponentPatch);
Return Type:
IItemStack
// FabricItemStack.applyComponentsAndValidate(patch as DataComponentPatch) as IItemStack;
myFabricItemStack . applyComponentsAndValidate(myDataComponentPatch);
Return Type:
IItemStack
// FabricItemStack.asIData() as IData;
myFabricItemStack . asIData();
Return Type:
IData
// FabricItemStack as IData
myFabricItemStack as IData
Return Type:
IData
// FabricItemStack as IData
myFabricItemStack as IData
Return Type:
IData
// FabricItemStack.asIIngredientWithAmount() as IIngredientWithAmount;
myFabricItemStack . asIIngredientWithAmount();
Return Type:
IIngredientWithAmount
Used implicitly when a machine can accept more than one item but you only provide one. // FabricItemStack.asIIngredientWithAmount() as IIngredientWithAmount;
myFabricItemStack . asIIngredientWithAmount();
Return Type:
IIngredientWithAmount
// FabricItemStack as IIngredientWithAmount
myFabricItemStack as IIngredientWithAmount
Return Type:
IIngredientWithAmount
Used implicitly when a machine can accept more than one item but you only provide one. // FabricItemStack as IIngredientWithAmount
myFabricItemStack as IIngredientWithAmount
Return Type:
IIngredientWithAmount
// FabricItemStack.asImmutable() as IItemStack;
myFabricItemStack . asImmutable();
Return Type:
IItemStack
// FabricItemStack.asItemLike() as ItemLike;
myFabricItemStack . asItemLike();
Return Type:
ItemLike
// FabricItemStack as ItemLike
myFabricItemStack as ItemLike
Return Type:
ItemLike
// FabricItemStack as MapData
myFabricItemStack as MapData
Return Type:
MapData
// FabricItemStack.asMutable() as IItemStack;
myFabricItemStack . asMutable();
Return Type:
IItemStack
Create a Vanilla ingredient matching this one. // FabricItemStack.asVanillaIngredient() as Ingredient;
myFabricItemStack . asVanillaIngredient();
Return Type:
Ingredient
Create a Vanilla ingredient matching this one. // FabricItemStack as Ingredient
myFabricItemStack as Ingredient
Return Type:
Ingredient
// FabricItemStack as Percentaged<IItemStack>
myFabricItemStack as Percentaged < IItemStack>
Return Type:
Percentaged <IItemStack >
Gets the data in <componenttype:minecraft:attribute_modifiers> // FabricItemStack.attributeModifiers as ItemAttributeModifiers
myFabricItemStack . attributeModifiers
Return Type:
ItemAttributeModifiers
// FabricItemStack.bannerPatterns as BannerPatternLayers
myFabricItemStack . bannerPatterns
Return Type:
BannerPatternLayers
// FabricItemStack.BASE_ATTACK_DAMAGE_UUID as UUID
FabricItemStack . BASE_ATTACK_DAMAGE_UUID
Return Type:
UUID
// FabricItemStack.BASE_ATTACK_SPEED_UUID as UUID
FabricItemStack . BASE_ATTACK_SPEED_UUID
Return Type:
UUID
// FabricItemStack.baseColor as DyeColor
myFabricItemStack . baseColor
Return Type:
DyeColor
// FabricItemStack.blockEntityData as CustomData
myFabricItemStack . blockEntityData
Return Type:
CustomData
// FabricItemStack.blockState as BlockItemStateProperties
myFabricItemStack . blockState
Return Type:
BlockItemStateProperties
// FabricItemStack.bucketEntityData as CustomData
myFabricItemStack . bucketEntityData
Return Type:
CustomData
// FabricItemStack.bundleContents as BundleContents
myFabricItemStack . bundleContents
Return Type:
BundleContents
Sets the burn time of this ingredient, for use in the furnace and other machines // FabricItemStack.burnTime = (time as int);
myFabricItemStack . burnTime = myInt;
Parameters:
time: int
Type: int
- the new burn time
Sets the burn time of this ingredient, for use in the furnace and other machines // FabricItemStack.burnTime(time as int);
myFabricItemStack . burnTime( 500 );
Parameters:
time: int
Type: int
- the new burn time
Gets the data in <componenttype:minecraft:can_break> // FabricItemStack.canBreak as AdventureModePredicate
myFabricItemStack . canBreak
Return Type:
AdventureModePredicate
Gets the data in <componenttype:minecraft:can_place_on> // FabricItemStack.canPlaceOn as AdventureModePredicate
myFabricItemStack . canPlaceOn
Return Type:
AdventureModePredicate
// FabricItemStack.chargedProjectiles as ChargedProjectiles
myFabricItemStack . chargedProjectiles
Return Type:
ChargedProjectiles
// FabricItemStack.clearTooltip(leaveName as bool = false);
myFabricItemStack . clearTooltip(myBool);
Parameters:
leaveName: bool
(optional) Type: bool
Default Value: false
Returns the BEP to get this stack // FabricItemStack.commandString as string
myFabricItemStack . commandString
Return Type:
string
Returns the BEP to get this thingy // FabricItemStack.commandString as string
myFabricItemStack . commandString
Return Type:
string
Returns the BEP to get this thingy // FabricItemStack.commandString() as string;
myFabricItemStack . commandString();
Return Type:
string
// FabricItemStack.componentsPatch as DataComponentPatch
myFabricItemStack . componentsPatch
Return Type:
DataComponentPatch
Use this if you already have the condition from another ingredient // FabricItemStack.condition(condition as IIngredientCondition) as IIngredient;
myFabricItemStack . condition(myIIngredientCondition);
Return Type:
IIngredient
// FabricItemStack.container as ItemContainerContents
myFabricItemStack . container
Return Type:
ItemContainerContents
// FabricItemStack.containerLoot as SeededContainerLoot
myFabricItemStack . containerLoot
Return Type:
SeededContainerLoot
Does the ingredient contain the given ingredient? // FabricItemStack.contains(ingredient as IIngredient) as bool;
myFabricItemStack . contains(( < item : minecraft:iron_ingot > | < item : minecraft:gold_ingot > ));
Return Type:
bool
Creates a copy // FabricItemStack.copy() as IItemStack;
myFabricItemStack . copy();
Return Type:
IItemStack
// FabricItemStack.CRAFTTWEAKER_DATA_KEY as string
FabricItemStack . CRAFTTWEAKER_DATA_KEY
Return Type:
string
Gets the data in <componenttype:minecraft:creative_slot_lock> // FabricItemStack.creativeSlotLock as bool
myFabricItemStack . creativeSlotLock
Return Type:
bool
Gets the data in the <componenttype:minecraft:custom_data> // FabricItemStack.customData as CustomData
myFabricItemStack . customData
Return Type:
CustomData
Gets the data in <componenttype:minecraft:custom_model_data> // FabricItemStack.customModelData as CustomModelData
myFabricItemStack . customModelData
Return Type:
CustomModelData
Gets the data in the <componenttype:minecraft:custom_name> A custom name is generally displayed in italics and controlled by the user. // FabricItemStack.customName as Component
myFabricItemStack . customName
Return Type:
Component
Gets the data in the <componenttype:minecraft:damage> // FabricItemStack.damage as int
Return Type:
int
Returns if the ItemStack is damageable I.E Swords and tools are damageable, sticks are not. // FabricItemStack.damageableItem as bool
myFabricItemStack . damageableItem
Return Type:
bool
Returns if the ItemStack is damaged I.E a Swords that is no at full durability is damaged. // FabricItemStack.damaged as bool
myFabricItemStack . damaged
Return Type:
bool
// FabricItemStack.debugStickState as DebugStickState
myFabricItemStack . debugStickState
Return Type:
DebugStickState
// FabricItemStack.definition as Item
myFabricItemStack . definition
Return Type:
ItemDefinition
// FabricItemStack.definition() as Item;
myFabricItemStack . definition();
Return Type:
ItemDefinition
// FabricItemStack as Item
myFabricItemStack as Item
Return Type:
ItemDefinition
Returns the unlocalized Name of the Item in the ItemStack // FabricItemStack.descriptionId as string
myFabricItemStack . descriptionId
Return Type:
string
Gets the display name of the ItemStack // FabricItemStack.displayName as Component
myFabricItemStack . displayName
Return Type:
Component
// FabricItemStack.dyedColor as DyedItemColor
myFabricItemStack . dyedColor
Return Type:
DyedItemColor
Checks if this ingredient is empty. // FabricItemStack.empty as bool
Return Type:
bool
Checks if this ingredient is empty. Returns : true if empty, false otherwise
// FabricItemStack.empty() as bool;
myFabricItemStack . empty();
Return Type:
bool
Gets the data in <componenttype:minecraft:enchantment_glint_override> If it is present, it is first checked to determine whether there is special behaviour, otherwise the code checks for enchantments. // FabricItemStack.enchantmentGlintOverride as bool
myFabricItemStack . enchantmentGlintOverride
Return Type:
bool
Gets the data in <componenttype:minecraft:enchantments> // FabricItemStack.enchantments as ItemEnchantments
myFabricItemStack . enchantments
Return Type:
ItemEnchantments
// FabricItemStack.entityData as CustomData
myFabricItemStack . entityData
Return Type:
CustomData
// FabricItemStack.fireworkExplosion as FireworkExplosion
myFabricItemStack . fireworkExplosion
Return Type:
FireworkExplosion
// FabricItemStack.fireworks as Fireworks
myFabricItemStack . fireworks
Return Type:
Fireworks
Gets the data in <componenttype:minecraft:food> // FabricItemStack.food as FoodProperties
Return Type:
FoodProperties
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.
// FabricItemStack.getAttributes(slotType as EquipmentSlot) as List<AttributeModifier>[Attribute];
myFabricItemStack . getAttributes( < constant : minecraft:equipmentslot:chest > );
Return Type:
List <AttributeModifier > [Attribute ]
// FabricItemStack.getImmutableInternal() as ItemStack;
myFabricItemStack . getImmutableInternal();
Return Type:
ItemStack
Gets the internal ItemStack
for this IItemStack. Returns : internal ItemStack
// FabricItemStack.getInternal() as ItemStack;
myFabricItemStack . getInternal();
Return Type:
ItemStack
Gets the internal ItemStack
for this IItemStack. // FabricItemStack as ItemStack
myFabricItemStack as ItemStack
Return Type:
ItemStack
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. // FabricItemStack.getRemainingItem(stack as IItemStack) as IItemStack;
myFabricItemStack . getRemainingItem( < item : minecraft:iron_ingot > );
Return Type:
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.
// FabricItemStack.grow(amount as int = 1) as IItemStack;
myFabricItemStack . grow( 2 );
Parameters:
amount: int
(optional) Type: int
- The amount to grow by.
Default Value: 1
Return Type:
IItemStack
Checks whether the ComponentAccess has <componenttype:minecraft:attribute_modifiers> // FabricItemStack.hasAttributeModifiers as bool
myFabricItemStack . hasAttributeModifiers
Return Type:
bool
// FabricItemStack.hasBannerPatterns as bool
myFabricItemStack . hasBannerPatterns
Return Type:
bool
// FabricItemStack.hasBaseColor as bool
myFabricItemStack . hasBaseColor
Return Type:
bool
// FabricItemStack.hasBees as bool
myFabricItemStack . hasBees
Return Type:
bool
// FabricItemStack.hasBlockEntityData as bool
myFabricItemStack . hasBlockEntityData
Return Type:
bool
// FabricItemStack.hasBlockState as bool
myFabricItemStack . hasBlockState
Return Type:
bool
// FabricItemStack.hasBucketEntityData as bool
myFabricItemStack . hasBucketEntityData
Return Type:
bool
// FabricItemStack.hasBundleContents as bool
myFabricItemStack . hasBundleContents
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:can_break> // FabricItemStack.hasCanBreak as bool
myFabricItemStack . hasCanBreak
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:can_place_on> // FabricItemStack.hasCanPlaceOn as bool
myFabricItemStack . hasCanPlaceOn
Return Type:
bool
// FabricItemStack.hasChargedProjectiles as bool
myFabricItemStack . hasChargedProjectiles
Return Type:
bool
// FabricItemStack.hasContainer as bool
myFabricItemStack . hasContainer
Return Type:
bool
// FabricItemStack.hasContainerLoot as bool
myFabricItemStack . hasContainerLoot
Return Type:
bool
Checks whether the ComponentAccess has the <componenttype:minecraft:custom_data> // FabricItemStack.hasCustomData as bool
myFabricItemStack . hasCustomData
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:custom_model_data> // FabricItemStack.hasCustomModelData as bool
myFabricItemStack . hasCustomModelData
Return Type:
bool
Checks whether the ComponentAccess has the <componenttype:minecraft:custom_name> // FabricItemStack.hasCustomName as bool
myFabricItemStack . hasCustomName
Return Type:
bool
Checks whether the ComponentAccess has the <componenttype:minecraft:damage> // FabricItemStack.hasDamage as bool
myFabricItemStack . hasDamage
Return Type:
bool
// FabricItemStack.hasDebugStickState as bool
myFabricItemStack . hasDebugStickState
Return Type:
bool
// FabricItemStack.hasDyedColor as bool
myFabricItemStack . hasDyedColor
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:enchantment_glint_override> // FabricItemStack.hasEnchantmentGlintOverride as bool
myFabricItemStack . hasEnchantmentGlintOverride
Return Type:
bool
Checks whether the ComponentAccess has the <componenttype:minecraft:enchantments> // FabricItemStack.hasEnchantments as bool
myFabricItemStack . hasEnchantments
Return Type:
bool
// FabricItemStack.hasEntityData as bool
myFabricItemStack . hasEntityData
Return Type:
bool
// FabricItemStack.hasFireworkExplosion as bool
myFabricItemStack . hasFireworkExplosion
Return Type:
bool
// FabricItemStack.hasFireworks as bool
myFabricItemStack . hasFireworks
Return Type:
bool
Returns true if this ItemStack has a foil effect. Foil is the glint / effect that is added to enchanted ItemStacks (and other items). // FabricItemStack.hasFoil as bool
myFabricItemStack . hasFoil
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:food> // FabricItemStack.hasFood as bool
myFabricItemStack . hasFood
Return Type:
bool
// FabricItemStack.hasInstrument as bool
myFabricItemStack . hasInstrument
Return Type:
bool
Checks whether the ComponentAccess has the <componenttype:minecraft:item_namegt; // FabricItemStack.hasItemName as bool
myFabricItemStack . hasItemName
Return Type:
bool
// FabricItemStack.hasLock as bool
myFabricItemStack . hasLock
Return Type:
bool
// FabricItemStack.hasLodestoneTracker as bool
myFabricItemStack . hasLodestoneTracker
Return Type:
bool
Checks whether the ComponentAccess has the <componenttype:minecraft:lore> // FabricItemStack.hasLore as bool
myFabricItemStack . hasLore
Return Type:
bool
// FabricItemStack.hasMapColor as bool
myFabricItemStack . hasMapColor
Return Type:
bool
// FabricItemStack.hasMapDecorations as bool
myFabricItemStack . hasMapDecorations
Return Type:
bool
// FabricItemStack.hasMapId as bool
myFabricItemStack . hasMapId
Return Type:
bool
// FabricItemStack.hasMapPostProcessing as bool
myFabricItemStack . hasMapPostProcessing
Return Type:
bool
Checks whether the ComponentAccess has the <componenttype:minecraft:max_damage> // FabricItemStack.hasMaxDamage as bool
myFabricItemStack . hasMaxDamage
Return Type:
bool
Checks whether the ComponentAccess has the <componenttype:minecraft:max_stack_size> // FabricItemStack.hasMaxStackSize as bool
myFabricItemStack . hasMaxStackSize
Return Type:
bool
// FabricItemStack.hasNoteBlockSound as bool
myFabricItemStack . hasNoteBlockSound
Return Type:
bool
// FabricItemStack.hasOminousBottleAmplifier as bool
myFabricItemStack . hasOminousBottleAmplifier
Return Type:
bool
// FabricItemStack.hasPotDecorations as bool
myFabricItemStack . hasPotDecorations
Return Type:
bool
// FabricItemStack.hasPotionContents as bool
myFabricItemStack . hasPotionContents
Return Type:
bool
// FabricItemStack.hasProfile as bool
myFabricItemStack . hasProfile
Return Type:
bool
Checks whether the ComponentAccess has the <componenttype:minecraft:rarity> // FabricItemStack.hasRarity as bool
myFabricItemStack . hasRarity
Return Type:
bool
// FabricItemStack.hasRecipes as bool
myFabricItemStack . hasRecipes
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:repair_cost> // FabricItemStack.hasRepairCost as bool
myFabricItemStack . hasRepairCost
Return Type:
bool
// FabricItemStack.hasStoredEnchantments as bool
myFabricItemStack . hasStoredEnchantments
Return Type:
bool
// FabricItemStack.hasSuspiciousStewEffects as bool
myFabricItemStack . hasSuspiciousStewEffects
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:tool> // FabricItemStack.hasTool as bool
myFabricItemStack . hasTool
Return Type:
bool
// FabricItemStack.hasTrim as bool
myFabricItemStack . hasTrim
Return Type:
bool
Checks whether the ComponentAccess has the <componenttype:minecraft:unbreakable> // FabricItemStack.hasUnbreakable as bool
myFabricItemStack . hasUnbreakable
Return Type:
bool
// FabricItemStack.hasWritableBookContent as bool
myFabricItemStack . hasWritableBookContent
Return Type:
bool
// FabricItemStack.hasWrittenBookContent as bool
myFabricItemStack . hasWrittenBookContent
Return Type:
bool
Gets the data in <componenttype:minecraft:hide_additional_tooltip> // FabricItemStack.hideAdditionalTooltip as bool
myFabricItemStack . hideAdditionalTooltip
Return Type:
bool
Gets the data in <componenttype:minecraft:hide_tooltip> // FabricItemStack.hideTooltip as bool
myFabricItemStack . hideTooltip
Return Type:
bool
Gets the hover name of the ItemStack. This will give the raw name without the formatting that 'displayName' applies.
// FabricItemStack.hoverName as Component
myFabricItemStack . hoverName
Return Type:
Component
The backing ingredient // FabricItemStack.ingredient as IIngredient
myFabricItemStack . ingredient
Return Type:
IIngredient
// FabricItemStack.instrument as Instrument
myFabricItemStack . instrument
Return Type:
Instrument
Can this ItemStack be enchanted? // FabricItemStack.isEnchantable as bool
myFabricItemStack . isEnchantable
Return Type:
bool
Gets the data in <componenttype:minecraft:fire_resistant> // FabricItemStack.isFireResistant as bool
myFabricItemStack . isFireResistant
Return Type:
bool
// FabricItemStack.isImmutable as bool
myFabricItemStack . isImmutable
Return Type:
bool
// FabricItemStack.isImmutable() as bool;
myFabricItemStack . isImmutable();
Return Type:
bool
Gets the data in <componenttype:minecraft:intangible_projectile> // FabricItemStack.isIntangibleProjectile as bool
myFabricItemStack . isIntangibleProjectile
Return Type:
bool
// FabricItemStack.isMutable as bool
myFabricItemStack . isMutable
Return Type:
bool
// FabricItemStack.isMutable() as bool;
myFabricItemStack . isMutable();
Return Type:
bool
Gets the data in the <componenttype:minecraft:custom_name> 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. // FabricItemStack.itemName as Component
myFabricItemStack . itemName
Return Type:
Component
// FabricItemStack.items as IItemStack[]
Return Type:
IItemStack []
// FabricItemStack.lockComponent as LockCode
myFabricItemStack . lockComponent
Return Type:
LockCode
// FabricItemStack.lodestoneTracker as LodestoneTracker
myFabricItemStack . lodestoneTracker
Return Type:
LodestoneTracker
Gets the data in the <componenttype:minecraft:lore> // FabricItemStack.lore as ItemLore
Return Type:
ItemLore
// FabricItemStack.mapColor as MapItemColor
myFabricItemStack . mapColor
Return Type:
MapItemColor
// FabricItemStack.mapDecorations as MapDecorations
myFabricItemStack . mapDecorations
Return Type:
MapDecorations
// FabricItemStack.mapId as MapId
Return Type:
MapId
// FabricItemStack.mapPostProcessing as MapPostProcessing
myFabricItemStack . mapPostProcessing
Return Type:
MapPostProcessing
Does the given stack match the ingredient? // FabricItemStack.matches(stack as IItemStack) as bool;
myFabricItemStack . matches( < item : minecraft:iron_ingot > );
Return Type:
bool
Returns the max damage of the ItemStack This is the max durability of the ItemStack. // FabricItemStack.maxDamage as int
myFabricItemStack . maxDamage
Return Type:
int
Gets the data in the <componenttype:minecraft:max_damage> // FabricItemStack.maxDamage as int
myFabricItemStack . maxDamage
Return Type:
int
Gets the data in the <componenttype:minecraft:max_stack_size> // FabricItemStack.maxStackSize as int
myFabricItemStack . maxStackSize
Return Type:
int
// FabricItemStack.modifyShiftTooltip(shiftedFunction as ITooltipFunction, unshiftedFunction as ITooltipFunction = null);
myFabricItemStack . modifyShiftTooltip(myITooltipFunction, myITooltipFunction);
// FabricItemStack.modifyTooltip(function as ITooltipFunction);
myFabricItemStack . modifyTooltip(myITooltipFunction);
Use this in contexts where machines accept more than one item to state that fact. // FabricItemStack.mul(amount as int) as IIngredientWithAmount;
myFabricItemStack . mul(myInt);
Return Type:
IIngredientWithAmount
// FabricItemStack.noteBlockSound as ResourceLocation
myFabricItemStack . noteBlockSound
Return Type:
ResourceLocation
// FabricItemStack.ominousBottleAmplifier as int
myFabricItemStack . ominousBottleAmplifier
Return Type:
int
// FabricItemStack.onlyDamaged() as IIngredient;
myFabricItemStack . onlyDamaged();
Return Type:
IIngredient
// FabricItemStack.onlyDamagedAtLeast(minDamage as int) as IIngredient;
myFabricItemStack . onlyDamagedAtLeast(myInt);
Return Type:
IIngredient
// FabricItemStack.onlyDamagedAtMost(maxDamage as int) as IIngredient;
myFabricItemStack . onlyDamagedAtMost(myInt);
Return Type:
IIngredient
// FabricItemStack.onlyIf(uid as string, function as function(t as IItemStack) as bool = null) as IIngredient;
myFabricItemStack . onlyIf(myString, myPredicate);
Parameters:
uid: string
Type: string
function: function(t as IItemStack ) as bool
(optional) Type: function(t as IItemStack ) as bool
Default Value: null
Return Type:
IIngredient
Gets owning mod for the Item in this IItemStack // FabricItemStack.owner as string
Return Type:
string
// FabricItemStack.percent(percentage as double) as Percentaged<IItemStack>;
myFabricItemStack . percent(myDouble);
Parameters:
percentage: double
Type: double
Return Type:
Percentaged <IItemStack >
// FabricItemStack.potDecorations as PotDecorations
myFabricItemStack . potDecorations
Return Type:
PotDecorations
// FabricItemStack.potionContents as PotionContents
myFabricItemStack . potionContents
Return Type:
PotionContents
// FabricItemStack.profile as ResolvableProfile
myFabricItemStack . profile
Return Type:
ResolvableProfile
// FabricItemStack.prototype as DataComponentMap
myFabricItemStack . prototype
Return Type:
DataComponentMap
Gets the data in the <componenttype:minecraft:rarity> // FabricItemStack.rarity as Rarity
Return Type:
Rarity
// FabricItemStack.recipes as List<ResourceLocation>
myFabricItemStack . recipes
Return Type:
List <ResourceLocation >
Gets the registry name for the Item in this IItemStack // FabricItemStack.registryName as ResourceLocation
myFabricItemStack . registryName
Return Type:
ResourceLocation
// FabricItemStack.remove<T>(type as DataComponentType<T>) as IItemStack;
myFabricItemStack . remove < T>(myDataComponentType);
Return Type:
IItemStack
Removes all AttributeModifiers that use the given Attribute from this IIngredient. Attributes removed with this method are removed from ItemStacks that match this IIngredient, regardless of how or when the ItemStack was made, if you want to remove the attribute on a single specific ItemStack (such as a specific Diamond Sword made in a recipe), then you should use IItemStack#withoutAttribute. This method can only remove default Attributes from an ItemStack, it is still possible that an ItemStack can override it. // FabricItemStack.removeGlobalAttribute(attribute as Attribute, slotTypes as EquipmentSlot[]);
myFabricItemStack . removeGlobalAttribute( < attribute : minecraft:generic.attack_damage > , [ < constant : minecraft:equipmentslot:chest > ]);
Removes all AttributeModifiers who's ID is the same as the given uuid from this IIngredient. // FabricItemStack.removeGlobalAttributeModifier(uuid as string, slotTypes as EquipmentSlot[]);
myFabricItemStack . removeGlobalAttributeModifier( "8c1b5535-9f79-448b-87ae-52d81480aaa3" , [ < constant : minecraft:equipmentslot:chest > ]);
Parameters:
uuid: string
Type: string
- The unique id of the AttributeModifier to remove.
Removes all AttributeModifiers who's ID is the same as the given uuid from this IIngredient. // FabricItemStack.removeGlobalAttributeModifier(uuid as UUID, slotTypes as EquipmentSlot[]);
myFabricItemStack . removeGlobalAttributeModifier( IItemStack . BASE_ATTACK_DAMAGE_UUID, [ < constant : minecraft:equipmentslot:chest > ]);
Parameters:
uuid: UUID
Type: UUID
- The unique id of the AttributeModifier to remove.
// FabricItemStack.removeTooltip(regex as string);
myFabricItemStack . removeTooltip(myString);
Parameters:
regex: string
Type: string
Gets the data in <componenttype:minecraft:repair_cost> // FabricItemStack.repairCost as int
myFabricItemStack . repairCost
Return Type:
int
// FabricItemStack.reuse() as IIngredient;
myFabricItemStack . reuse();
Return Type:
IIngredient
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.
// FabricItemStack.shrink(amount as int = 1) as IItemStack;
myFabricItemStack . shrink( 2 );
Parameters:
amount: int
(optional) Type: int
- The amount to shrink by.
Default Value: 1
Return Type:
IItemStack
Returns if the ItemStack can have an amount greater than 1 I.E Swords and tools are not stackable, sticks are. // FabricItemStack.stackable as bool
myFabricItemStack . stackable
Return Type:
bool
// FabricItemStack.storedEnchantments as ItemEnchantments
myFabricItemStack . storedEnchantments
Return Type:
ItemEnchantments
// FabricItemStack.suspiciousStewEffects as SuspiciousStewEffects
myFabricItemStack . suspiciousStewEffects
Return Type:
SuspiciousStewEffects
Gets the data in <componenttype:minecraft:tool> // FabricItemStack.tool as Tool
Return Type:
Tool
// FabricItemStack.transformCustom(uid as string, function as function(r as IItemStack) as IItemStack = null) as IIngredient;
myFabricItemStack . transformCustom(myString, myFunction);
Return Type:
IIngredient
// FabricItemStack.transformDamage(amount as int = 1) as IIngredient;
myFabricItemStack . transformDamage(myInt);
Parameters:
amount: int
(optional) Type: int
Default Value: 1
Return Type:
IIngredient
// FabricItemStack.transformReplace(replaceWith as IItemStack) as IIngredient;
myFabricItemStack . transformReplace(myIItemStack);
Return Type:
IIngredient
// FabricItemStack.trim as ArmorTrim
Return Type:
ArmorTrim
Gets the data in the <componenttype:minecraft:unbreakable> // FabricItemStack.unbreakable as Unbreakable
myFabricItemStack . unbreakable
Return Type:
Unbreakable
// FabricItemStack.update<T, U>(type as DataComponentType<T>, defaultValue as T, data as U, operator as BiFunction<T, T, U>) as IItemStack;
myFabricItemStack . update < T, U>(myDataComponentType, myT, myU, myBiFunction);
Parameters:
defaultValue: T
Type: T
data: U
Type: U
operator: BiFunction <T , T , U >
Type: BiFunction <T , T , U >
Return Type:
IItemStack
// FabricItemStack.update<T>(type as DataComponentType<T>, defaultValue as T, operator as UnaryOperator<T>) as IItemStack;
myFabricItemStack . update < T>(myDataComponentType, myT, myUnaryOperator);
Parameters:
defaultValue: T
Type: T
operator: UnaryOperator <T >
Type: UnaryOperator <T >
Return Type:
IItemStack
Gets the use duration of the ItemStack // FabricItemStack.useDuration as int
myFabricItemStack . useDuration
Return Type:
int
Returns true if this stack is considered a crossbow item // FabricItemStack.useOnRelease as bool
myFabricItemStack . useOnRelease
Return Type:
bool
// FabricItemStack.with<T>(type as DataComponentType<T>, value as T?) as IItemStack;
myFabricItemStack . with < T>(myDataComponentType, myT);
Return Type:
IItemStack
Sets the <componenttype:minecraft:attribute_modifiers> of the ComponentAccess to have the given ItemAttributeModifiers
Returns : The new instance with the modified data.
// FabricItemStack.withAttributeModifiers(modifiers as ItemAttributeModifiers) as ComponentAccess;
myFabricItemStack . withAttributeModifiers( ItemAttributeModifiers . builder().add( < attribute : minecraft:player.block_break_speed > ,
AttributeModifier . create( "test" , 2.0 , < constant : minecraft:attribute/operation:add_value > , "596e0826-7c66-42c6-b3da-45a6d667ccf7" ),
< constant : minecraft:equipmentslot/group:mainhand > ).build(););
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withAttributeModifiers(modifier as Entry, showInTooltip as bool = true) as ComponentAccess;
myFabricItemStack . withAttributeModifiers(myEntry, myBool);
Parameters:
showInTooltip: bool
(optional) Type: bool
Default Value: true
Return Type:
ComponentAccess
// FabricItemStack.withAttributeModifiers(modifiers as List<Entry>, showInTooltip as bool = true) as ComponentAccess;
myFabricItemStack . withAttributeModifiers(myList, myBool);
Parameters:
showInTooltip: bool
(optional) Type: bool
Default Value: true
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withBannerPatterns(layers as List<Layer>) as ComponentAccess;
myFabricItemStack . withBannerPatterns(myList);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withBannerPatterns(layers as BannerPatternLayers) as ComponentAccess;
myFabricItemStack . withBannerPatterns(myBannerPatternLayers);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withBaseColor(color as DyeColor) as ComponentAccess;
myFabricItemStack . withBaseColor(myDyeColor);
Parameters:
color: DyeColor
Type: DyeColor
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withBees(occupants as List<Occupant>) as ComponentAccess;
myFabricItemStack . withBees(myList);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withBlockEntityData(data as MapData) as ComponentAccess;
myFabricItemStack . withBlockEntityData(myMapData);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withBlockEntityData(data as CustomData) as ComponentAccess;
myFabricItemStack . withBlockEntityData(myCustomData);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withBlockState(properties as BlockItemStateProperties) as ComponentAccess;
myFabricItemStack . withBlockState(myBlockItemStateProperties);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withBucketEntityData(data as MapData) as ComponentAccess;
myFabricItemStack . withBucketEntityData(myMapData);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withBucketEntityData(data as CustomData) as ComponentAccess;
myFabricItemStack . withBucketEntityData(myCustomData);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withBundleContents(contents as List<IItemStack>) as ComponentAccess;
myFabricItemStack . withBundleContents(myList);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withBundleContents(contents as BundleContents) as ComponentAccess;
myFabricItemStack . withBundleContents(myBundleContents);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:can_break> 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.
// FabricItemStack.withCanBreak(predicates as List<BlockPredicate>, showInTooltip as bool = true) as ComponentAccess;
myFabricItemStack . withCanBreak( BlockPredicate . create().of( < block : minecraft:diamond_ore > ).build(), true );
Parameters:
showInTooltip: bool
(optional) Type: bool
- Whether to show the ability in the tooltip or not.
Default Value: true
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:can_break> of the ComponentAccess to have the given AdventureModePredicate Returns : The new instance with the modified data.
// FabricItemStack.withCanBreak(predicate as AdventureModePredicate) as ComponentAccess;
myFabricItemStack . withCanBreak(myAdventureModePredicate);
Parameters:
predicate: AdventureModePredicate
Type: AdventureModePredicate
- The adventure mode predicate to use to determine whether the item can be used to break a block.
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:can_place_on> 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.
// FabricItemStack.withCanPlaceOn(predicates as List<BlockPredicate>, showInTooltip as bool = true) as ComponentAccess;
myFabricItemStack . withCanPlaceOn( BlockPredicate . create().of( < block : minecraft:dirt > ).build(), myBool);
Parameters:
showInTooltip: bool
(optional) Type: bool
- Whether to show the restriction in the tooltip or not.
Default Value: true
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:can_place_on> of the ComponentAccess to have the given AdventureModePredicate Returns : The new instance with the modified data.
// FabricItemStack.withCanPlaceOn(predicate as AdventureModePredicate) as ComponentAccess;
myFabricItemStack . withCanPlaceOn(myAdventureModePredicate);
Parameters:
predicate: AdventureModePredicate
Type: AdventureModePredicate
- The adventure mode predicate to use to determine whether the current block can be placed on another block.
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withChargedProjectiles(item as IItemStack) as ComponentAccess;
myFabricItemStack . withChargedProjectiles(myIItemStack);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withChargedProjectiles(items as List<IItemStack>) as ComponentAccess;
myFabricItemStack . withChargedProjectiles(myList);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withChargedProjectiles(chargedProjectiles as ChargedProjectiles) as ComponentAccess;
myFabricItemStack . withChargedProjectiles(myChargedProjectiles);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withContainer(contents as List<IItemStack>) as ComponentAccess;
myFabricItemStack . withContainer(myList);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withContainer(contents as ItemContainerContents) as ComponentAccess;
myFabricItemStack . withContainer(myItemContainerContents);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withContainerLoot(lootTable as ResourceKey<LootTable>, seed as long) as ComponentAccess;
myFabricItemStack . withContainerLoot(myResourceKey, myLong);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withContainerLoot(loot as SeededContainerLoot) as ComponentAccess;
myFabricItemStack . withContainerLoot(mySeededContainerLoot);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:creative_slot_lock> of the ComponentAccess to exist. Returns : The new instance with the modified data.
// FabricItemStack.withCreativeSlotLock() as ComponentAccess;
myFabricItemStack . withCreativeSlotLock();
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:custom_data> of the ComponentAccess to have the given MapData
Returns : The new instance with the modified data.
// FabricItemStack.withCustomData(customData as MapData) as ComponentAccess;
myFabricItemStack . withCustomData({custom_ammo_thing: 1 , owner: "Benji" });
Parameters:
customData: MapData
Type: MapData
- The MapData to set the component to.
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:custom_data> of the ComponentAccess to have the given CustomData
Returns : The new instance with the modified data.
// FabricItemStack.withCustomData(customData as CustomData) as ComponentAccess;
myFabricItemStack . withCustomData(myCustomData);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:custom_data> of the ComponentAccess to have the given CustomData
Returns : The new instance with the modified data.
// FabricItemStack.withCustomModelData(value as int) as ComponentAccess;
myFabricItemStack . withCustomModelData( 2 );
Parameters:
value: int
Type: int
- The value to set the CustomModelData to
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withCustomModelData(data as CustomModelData) as ComponentAccess;
myFabricItemStack . withCustomModelData(myCustomModelData);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:custom_name> of the ComponentAccess. Returns : The new instance with the modified data.
// FabricItemStack.withCustomName(name as Component) as ComponentAccess;
myFabricItemStack . withCustomName( Component . literal( "Fancy Water" ));
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:damage> of the ComponentAccess to have the given value. Damage is related to durability. Returns : The new instance with the modified data.
// FabricItemStack.withDamage(damage as int) as ComponentAccess;
myFabricItemStack . withDamage( 16 );
Parameters:
damage: int
Type: int
- The new damage of the ComponentAccess.
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withDebugStickState(state as DebugStickState) as ComponentAccess;
myFabricItemStack . withDebugStickState(myDebugStickState);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withDyedColor(rgb as int, showInTooltip as bool = true) as ComponentAccess;
myFabricItemStack . withDyedColor(myInt, myBool);
Parameters:
rgb: int
Type: int
showInTooltip: bool
(optional) Type: bool
Default Value: true
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withDyedColor(color as DyedItemColor) as ComponentAccess;
myFabricItemStack . withDyedColor(myDyedItemColor);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:enchantments> of the ComponentAccess to have the given Enchantment
and level. Returns : The new instance with the modified data.
// FabricItemStack.withEnchantment(enchantment as Enchantment, level as int = 1) as ComponentAccess;
myFabricItemStack . withEnchantment( < enchantment : minecraft:efficiency > , 4 );
Parameters:
level: int
(optional) Type: int
- The level of the enchantment to set
Default Value: 1
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:enchantment_glint_override> 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.
// FabricItemStack.withEnchantmentGlintOverride(value as bool) as ComponentAccess;
myFabricItemStack . withEnchantmentGlintOverride( true );
Parameters:
value: bool
Type: bool
- The value of the override, as described above
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:enchantments> of the ComponentAccess to have the given ItemEnchantments
Returns : The new instance with the modified data.
// FabricItemStack.withEnchantments(enchantments as ItemEnchantments) as ComponentAccess;
myFabricItemStack . withEnchantments(myItemEnchantments);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withEntityData(data as MapData) as ComponentAccess;
myFabricItemStack . withEntityData(myMapData);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withEntityData(data as CustomData) as ComponentAccess;
myFabricItemStack . withEntityData(myCustomData);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:fire_resistant> of the ComponentAccess to exist. Returns : The new instance with the modified data.
// FabricItemStack.withFireResistant() as ComponentAccess;
myFabricItemStack . withFireResistant();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withFireworkExplosion(explosion as FireworkExplosion) as ComponentAccess;
myFabricItemStack . withFireworkExplosion(myFireworkExplosion);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withFireworks(flightDuration as int, explosions as List<FireworkExplosion>) as ComponentAccess;
myFabricItemStack . withFireworks(myInt, myList);
Parameters:
flightDuration: int
Type: int
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withFireworks(fireworks as Fireworks) as ComponentAccess;
myFabricItemStack . withFireworks(myFireworks);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:food> of the ComponentAccess to have the given FoodProperties
Returns : The new instance with the modified data.
// FabricItemStack.withFood(food as FoodProperties) as ComponentAccess;
myFabricItemStack . withFood(myFoodProperties);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:hide_additional_tooltip> of the ComponentAccess to exist. Returns : The new instance with the modified data.
// FabricItemStack.withHideAdditionalTooltip() as ComponentAccess;
myFabricItemStack . withHideAdditionalTooltip();
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:hide_tooltip> of the ComponentAccess to exist. Returns : The new instance with the modified data.
// FabricItemStack.withHideTooltip() as ComponentAccess;
myFabricItemStack . withHideTooltip();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withInstrument(instrument as Instrument) as ComponentAccess;
myFabricItemStack . withInstrument(myInstrument);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:intangible_projectile> of the ComponentAccess to have exist. Returns : The new instance with the modified data.
// FabricItemStack.withIntangibleProjectile() as ComponentAccess;
myFabricItemStack . withIntangibleProjectile();
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:item_name> of the ComponentAccess to have the given Component
Returns : The new instance with the modified data.
// FabricItemStack.withItemName(name as Component) as ComponentAccess;
myFabricItemStack . withItemName( Component . literal( "Fancy Water" ));
Return Type:
ComponentAccess
// FabricItemStack.withJsonComponent(type as DataComponentType<T>, value as IData) as IItemStack;
myFabricItemStack . withJsonComponent(myDataComponentType, myIData);
Return Type:
IItemStack
// FabricItemStack.withJsonComponents(value as IData) as IItemStack;
myFabricItemStack . withJsonComponents(myIData);
Return Type:
IItemStack
Returns : The new instance with the modified data.
// FabricItemStack.withLock(code as string) as ComponentAccess;
myFabricItemStack . withLock(myString);
Parameters:
code: string
Type: string
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withLock(lock as LockCode) as ComponentAccess;
myFabricItemStack . withLock(myLockCode);
Parameters:
lock: LockCode
Type: LockCode
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withLodestoneTracker(tracker as LodestoneTracker) as ComponentAccess;
myFabricItemStack . withLodestoneTracker(myLodestoneTracker);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:lore> of the ComponentAccess to have the given stdlib.List< Component
> Returns : The new instance with the modified data.
// FabricItemStack.withLore(components as List<Component>) as ComponentAccess;
myFabricItemStack . withLore([ Component . literal( "Found in a dark cave" ), Component . translatable( "Belonged to a Dragon" )]);
Parameters:
components: List <Component >
Type: List <Component >
- The list of Components to add as lore.
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:lore> of the ComponentAccess to have the given ItemLore
Returns : The new instance with the modified data.
// FabricItemStack.withLore(lore as ItemLore) as ComponentAccess;
myFabricItemStack . withLore(myItemLore);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withMapColor(rgb as int) as ComponentAccess;
myFabricItemStack . withMapColor(myInt);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withMapColor(color as MapItemColor) as ComponentAccess;
myFabricItemStack . withMapColor(myMapItemColor);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withMapDecorations(decorations as Entry[string]) as ComponentAccess;
myFabricItemStack . withMapDecorations(myMap);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withMapDecorations(decorations as MapDecorations) as ComponentAccess;
myFabricItemStack . withMapDecorations(myMapDecorations);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withMapId(id as int) as ComponentAccess;
myFabricItemStack . withMapId(myInt);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withMapId(mapId as MapId) as ComponentAccess;
myFabricItemStack . withMapId(myMapId);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withMapPostProcessing(value as MapPostProcessing) as ComponentAccess;
myFabricItemStack . withMapPostProcessing(myMapPostProcessing);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:max_damage> of the ComponentAccess to have the given value. Returns : The new instance with the modified data.
// FabricItemStack.withMaxDamage(maxDamage as int) as ComponentAccess;
myFabricItemStack . withMaxDamage( 1024 );
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:stack_size> 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.
// FabricItemStack.withMaxStackSize(maxStackSize as int) as ComponentAccess;
myFabricItemStack . withMaxStackSize( 16 );
Parameters:
maxStackSize: int
Type: int
- The new maxStackSize of the ComponentAccess.
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withNoteBlockSound(sound as ResourceLocation) as ComponentAccess;
myFabricItemStack . withNoteBlockSound(myResourceLocation);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withOminousBottleAmplifier(amplifier as int) as ComponentAccess;
myFabricItemStack . withOminousBottleAmplifier(myInt);
Return Type:
ComponentAccess
// FabricItemStack.without<T>(type as DataComponentType<T>) as IItemStack;
myFabricItemStack . without < T>(myDataComponentType);
Return Type:
IItemStack
Removes the <componenttype:minecraft:attribute_modifiers> from the ComponentAccess. Returns : The new instance with the modified data.
// FabricItemStack.withoutAttributeModifiers() as ComponentAccess;
myFabricItemStack . withoutAttributeModifiers();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutBannerPatterns() as ComponentAccess;
myFabricItemStack . withoutBannerPatterns();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutBaseColor() as ComponentAccess;
myFabricItemStack . withoutBaseColor();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutBees() as ComponentAccess;
myFabricItemStack . withoutBees();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutBlockEntityData() as ComponentAccess;
myFabricItemStack . withoutBlockEntityData();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutBlockState() as ComponentAccess;
myFabricItemStack . withoutBlockState();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutBucketEntityData() as ComponentAccess;
myFabricItemStack . withoutBucketEntityData();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutBundleContents() as ComponentAccess;
myFabricItemStack . withoutBundleContents();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:can_break> from the ComponentAccess. Returns : The new instance with the modified data.
// FabricItemStack.withoutCanBreak() as ComponentAccess;
myFabricItemStack . withoutCanBreak();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:can_place_on> from the ComponentAccess. Returns : The new instance with the modified data.
// FabricItemStack.withoutCanPlaceOn() as ComponentAccess;
myFabricItemStack . withoutCanPlaceOn();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutChargedProjectiles() as ComponentAccess;
myFabricItemStack . withoutChargedProjectiles();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutContainer() as ComponentAccess;
myFabricItemStack . withoutContainer();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutContainerLoot() as ComponentAccess;
myFabricItemStack . withoutContainerLoot();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:creative_slot_lock> from the ComponentAccess. Returns : The new instance with the modified data.
// FabricItemStack.withoutCreativeSlotLock() as ComponentAccess;
myFabricItemStack . withoutCreativeSlotLock();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:custom_data> from the ComponentAccess. Returns : The new instance with the modified data.
// FabricItemStack.withoutCustomData() as ComponentAccess;
myFabricItemStack . withoutCustomData();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:custom_model_data> from the ComponentAccess. Returns : The new instance with the modified data.
// FabricItemStack.withoutCustomModelData() as ComponentAccess;
myFabricItemStack . withoutCustomModelData();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:custom_name> from the ComponentAccess Returns : The new instance with the modified data.
// FabricItemStack.withoutCustomName() as ComponentAccess;
myFabricItemStack . withoutCustomName();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:damage> from the ComponentAccess. Returns : The new instance with the modified data.
// FabricItemStack.withoutDamage() as ComponentAccess;
myFabricItemStack . withoutDamage();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutDebugStickState() as ComponentAccess;
myFabricItemStack . withoutDebugStickState();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutDyedColor() as ComponentAccess;
myFabricItemStack . withoutDyedColor();
Return Type:
ComponentAccess
Removes the Enchantment
from the ComponentAccess. Returns : The new instance with the modified data.
// FabricItemStack.withoutEnchantment(enchantment as Enchantment) as ComponentAccess;
myFabricItemStack . withoutEnchantment( < enchantment : minecraft:mending > );
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:enchantment_glint_override> from the ComponentAccess. Returns : The new instance with the modified data.
// FabricItemStack.withoutEnchantmentGlintOverride() as ComponentAccess;
myFabricItemStack . withoutEnchantmentGlintOverride();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:enchantments> from the ComponentAccess. Returns : The new instance with the modified data.
// FabricItemStack.withoutEnchantments() as ComponentAccess;
myFabricItemStack . withoutEnchantments();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutEntityDate() as ComponentAccess;
myFabricItemStack . withoutEntityDate();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:fire_resistant> from the ComponentAccess. Returns : The new instance with the modified data.
// FabricItemStack.withoutFireResistant() as ComponentAccess;
myFabricItemStack . withoutFireResistant();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutFireworkExplosion() as ComponentAccess;
myFabricItemStack . withoutFireworkExplosion();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutFireworks() as ComponentAccess;
myFabricItemStack . withoutFireworks();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:food> from the ComponentAccess. Returns : The new instance with the modified data.
// FabricItemStack.withoutFood() as ComponentAccess;
myFabricItemStack . withoutFood();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:hide_additional_tooltip> from the ComponentAccess. Returns : The new instance with the modified data.
// FabricItemStack.withoutHideAdditionalTooltip() as ComponentAccess;
myFabricItemStack . withoutHideAdditionalTooltip();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:hide_tooltip> from the ComponentAccess. Returns : The new instance with the modified data.
// FabricItemStack.withoutHideTooltip() as ComponentAccess;
myFabricItemStack . withoutHideTooltip();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutInstrument() as ComponentAccess;
myFabricItemStack . withoutInstrument();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:intangible_projectile> from the ComponentAccess. Returns : The new instance with the modified data.
// FabricItemStack.withoutIntangibleProjectile() as ComponentAccess;
myFabricItemStack . withoutIntangibleProjectile();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:item_name> from the ComponentAccess. Returns : The new instance with the modified data.
// FabricItemStack.withoutItemName() as ComponentAccess;
myFabricItemStack . withoutItemName();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutLock() as ComponentAccess;
myFabricItemStack . withoutLock();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutLodestoneTracker() as ComponentAccess;
myFabricItemStack . withoutLodestoneTracker();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:lore> from the ComponentAccess. Returns : The new instance with the modified data.
// FabricItemStack.withoutLore() as ComponentAccess;
myFabricItemStack . withoutLore();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutMapColor() as ComponentAccess;
myFabricItemStack . withoutMapColor();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutMapDecorations() as ComponentAccess;
myFabricItemStack . withoutMapDecorations();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutMapId() as ComponentAccess;
myFabricItemStack . withoutMapId();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutMapPostProcessing() as ComponentAccess;
myFabricItemStack . withoutMapPostProcessing();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:max_damage> from the ComponentAccess. Returns : The new instance with the modified data.
// FabricItemStack.withoutMaxDamage() as ComponentAccess;
myFabricItemStack . withoutMaxDamage();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:stack_size> from the ComponentAccess. Returns : The new instance with the modified data.
// FabricItemStack.withoutMaxStackSize() as ComponentAccess;
myFabricItemStack . withoutMaxStackSize();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutNoteBlockSound() as ComponentAccess;
myFabricItemStack . withoutNoteBlockSound();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutOminousBottleAmplifier() as ComponentAccess;
myFabricItemStack . withoutOminousBottleAmplifier();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutPotDecorations() as ComponentAccess;
myFabricItemStack . withoutPotDecorations();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutPotionContents() as ComponentAccess;
myFabricItemStack . withoutPotionContents();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutProfile() as ComponentAccess;
myFabricItemStack . withoutProfile();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:rarity> from the ComponentAccess. Returns : The new instance with the modified data.
// FabricItemStack.withoutRarity() as ComponentAccess;
myFabricItemStack . withoutRarity();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutRecipes() as ComponentAccess;
myFabricItemStack . withoutRecipes();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:repair_cost> from the ComponentAccess. Returns : The new instance with the modified data.
// FabricItemStack.withoutRepairCost() as ComponentAccess;
myFabricItemStack . withoutRepairCost();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutStoredEnchantments() as ComponentAccess;
myFabricItemStack . withoutStoredEnchantments();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutSuspiciousStewEffects() as ComponentAccess;
myFabricItemStack . withoutSuspiciousStewEffects();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:tool> from the ComponentAccess. Returns : The new instance with the modified data.
// FabricItemStack.withoutTool() as ComponentAccess;
myFabricItemStack . withoutTool();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutTrim() as ComponentAccess;
myFabricItemStack . withoutTrim();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:unbreakable> from the ComponentAccess Returns : The new instance with the modified data.
// FabricItemStack.withoutUnbreakable() as ComponentAccess;
myFabricItemStack . withoutUnbreakable();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutWritableBookContent() as ComponentAccess;
myFabricItemStack . withoutWritableBookContent();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withoutWrittenBookContent() as ComponentAccess;
myFabricItemStack . withoutWrittenBookContent();
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withPotDecorations(back as Item, left as Item, right as Item, front as Item) as ComponentAccess;
myFabricItemStack . withPotDecorations(myItem, myItem, myItem, myItem);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withPotDecorations(decorations as PotDecorations) as ComponentAccess;
myFabricItemStack . withPotDecorations(myPotDecorations);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withPotionContents(potion as Potion) as ComponentAccess;
myFabricItemStack . withPotionContents(myPotion);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withPotionContents(potion as Potion, customEffects as List<MobEffectInstance>) as ComponentAccess;
myFabricItemStack . withPotionContents(myPotion, myList);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withPotionContents(potion as Potion, customColor as int, customEffects as List<MobEffectInstance>) as ComponentAccess;
myFabricItemStack . withPotionContents(myPotion, myInt, myList);
Parameters:
customColor: int
Type: int
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withPotionContents(contents as PotionContents) as ComponentAccess;
myFabricItemStack . withPotionContents(myPotionContents);
Parameters:
contents: PotionContents
Type: PotionContents
Return Type:
ComponentAccess
// FabricItemStack.withProfile(profile as ResolvableProfile) as ComponentAccess;
myFabricItemStack . withProfile(myResolvableProfile);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:rarity> of the ComponentAccess to have the given Rarity
Returns : The new instance with the modified data.
// FabricItemStack.withRarity(rarity as Rarity) as ComponentAccess;
myFabricItemStack . withRarity( < constant : minecraft:item/rarity:epic > );
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withRecipes(recipes as List<ResourceLocation>) as ComponentAccess;
myFabricItemStack . withRecipes(myList);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:repair_cost> of the ComponentAccess to have the given value. Returns : The new instance with the modified data.
// FabricItemStack.withRepairCost(cost as int) as ComponentAccess;
myFabricItemStack . withRepairCost( 20 );
Parameters:
cost: int
Type: int
- The repair cost
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withStoredEnchantments(enchantments as ItemEnchantments) as ComponentAccess;
myFabricItemStack . withStoredEnchantments(myItemEnchantments);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withSuspiciousStewEffects(effects as List<Entry>) as ComponentAccess;
myFabricItemStack . withSuspiciousStewEffects(myList);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withSuspiciousStewEffects(suspiciousStewEffects as SuspiciousStewEffects) as ComponentAccess;
myFabricItemStack . withSuspiciousStewEffects(mySuspiciousStewEffects);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withTool(rules as List<Rule>, defaultMiningSpeed as float, damagePerBlock as int) as ComponentAccess;
myFabricItemStack . withTool(myList, myFloat, myInt);
Parameters:
defaultMiningSpeed: float
Type: float
damagePerBlock: int
Type: int
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:tool> of the ComponentAccess to have the given Tool
Returns : The new instance with the modified data.
// FabricItemStack.withTool(tool as Tool) as ComponentAccess;
myFabricItemStack . withTool(myTool);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withTrim(trim as ArmorTrim) as ComponentAccess;
myFabricItemStack . withTrim(myArmorTrim);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:unbreakable> of the ComponentAccess. The existance of the component makes the ComponentAccess unbreakable. Returns : The new instance with the modified data.
// FabricItemStack.withUnbreakable(showInTooltip as bool = true) as ComponentAccess;
myFabricItemStack . withUnbreakable(myBool);
Parameters:
showInTooltip: bool
(optional) Type: bool
- Whether to show that the ComponentAccess is unbreakable in a tooltip.
Default Value: true
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:unbreakable> of the ComponentAccess. The existance of the component makes the ComponentAccess unbreakable. Returns : The new instance with the modified data.
// FabricItemStack.withUnbreakable(unbreakable as Unbreakable) as ComponentAccess;
myFabricItemStack . withUnbreakable(myUnbreakable);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withWritableBookContent(pages as List<Filterable<string>>) as ComponentAccess;
myFabricItemStack . withWritableBookContent(myList);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withWritableBookContent(content as WritableBookContent) as ComponentAccess;
myFabricItemStack . withWritableBookContent(myWritableBookContent);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
// FabricItemStack.withWrittenBookContent(content as WrittenBookContent) as ComponentAccess;
myFabricItemStack . withWrittenBookContent(myWrittenBookContent);
Return Type:
ComponentAccess
// FabricItemStack.writableBookContent as WritableBookContent
myFabricItemStack . writableBookContent
Return Type:
WritableBookContent
// FabricItemStack.writtenBookContent as WrittenBookContent
myFabricItemStack . writtenBookContent
Return Type:
WrittenBookContent