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. myFabricItemStack * myInt
Return Type:
IIngredientWithAmount
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 using a specific UUID. The id can be used to override an existing attribute on an ItemStack with this new modifier. You can use /ct hand attributes
to get the id 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 myFabricItemStack . addGlobalAttributeModifier( < attribute : minecraft:generic.attack_damage > , myResourceLocation, 10 , AttributeOperation . ADDITION, [ < constant : minecraft:equipmentslot:chest > ]);
Parameters:
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
myFabricItemStack . anyDamage();
Return Type:
IIngredient
myFabricItemStack . applyComponents(myDataComponentMap);
Return Type:
IItemStack
myFabricItemStack . applyComponents(myDataComponentPatch);
Return Type:
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
Used implicitly when a machine can accept more than one item but you only provide one. myFabricItemStack . asIIngredientWithAmount();
Return Type:
IIngredientWithAmount
Used implicitly when a machine can accept more than one item but you only provide one. myFabricItemStack as IIngredientWithAmount
Return Type:
IIngredientWithAmount
myFabricItemStack . asImmutable();
Return Type:
IItemStack
// FabricItemStack.asItemLike() as ItemLike ; myFabricItemStack . asItemLike();
Return Type:
ItemLike
myFabricItemStack as ItemLike
Return Type:
ItemLike
myFabricItemStack as MapData
Return Type:
MapData
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. myFabricItemStack as Ingredient
Return Type:
Ingredient
Gets the data in <componenttype:minecraft:attribute_modifiers> myFabricItemStack . attributeModifiers
Return Type:
ItemAttributeModifiers
Gets the data in <componenttype:minecraft:banner_patterns> myFabricItemStack . bannerPatterns
Return Type:
BannerPatternLayers
Gets the data in <componenttype:minecraft:base_color> // FabricItemStack.baseColor as DyeColor myFabricItemStack . baseColor
Return Type:
DyeColor
Gets the data in <componenttype:minecraft:block_entity_data> myFabricItemStack . blockEntityData
Return Type:
CustomData
Gets the data in <componenttype:minecraft:block_state> myFabricItemStack . blockState
Return Type:
BlockItemStateProperties
Gets the data in <componenttype:minecraft:bucket_entity_data> myFabricItemStack . bucketEntityData
Return Type:
CustomData
Gets the data in <componenttype:minecraft:bundle_contents> 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> myFabricItemStack . canBreak
Return Type:
AdventureModePredicate
Gets the data in <componenttype:minecraft:can_place_on> myFabricItemStack . canPlaceOn
Return Type:
AdventureModePredicate
Gets the data in <componenttype:minecraft:charged_projectiles> 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
Use this if you already have the condition from another ingredient myFabricItemStack . condition(myIIngredientCondition);
Return Type:
IIngredient
Gets the data in <componenttype:minecraft:container> myFabricItemStack . container
Return Type:
ItemContainerContents
Gets the data in <componenttype:minecraft:container_loot> 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 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> myFabricItemStack . customData
Return Type:
CustomData
Gets the data in <componenttype:minecraft:custom_model_data> 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. 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
Gets the data in <componenttype:minecraft:debug_stick_state> myFabricItemStack . debugStickState
Return Type:
DebugStickState
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 myFabricItemStack . displayName
Return Type:
Component
Gets the data in <componenttype:minecraft:dye_color> 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> myFabricItemStack . enchantments
Return Type:
ItemEnchantments
Gets the data in <componenttype:minecraft:entity_data> myFabricItemStack . entityData
Return Type:
CustomData
Gets the data in <componenttype:minecraft:firework_explosion> myFabricItemStack . fireworkExplosion
Return Type:
FireworkExplosion
Gets the data in <componenttype:minecraft:fireworks> myFabricItemStack . fireworks
Return Type:
Fireworks
Gets the data in <componenttype:minecraft:food>
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.
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. 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. myFabricItemStack . getRemainingItem( < item : minecraft:iron_ingot > );
Return Type:
IItemStack
Gets the use duration of the ItemStack for the given entity Returns : use duration
// FabricItemStack.getUseDuration(entity as LivingEntity ) as int; myFabricItemStack . getUseDuration(entity);
Return Type:
int
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
Checks whether the ComponentAccess has <componenttype:minecraft:banner_patterns> // FabricItemStack.hasBannerPatterns as bool
myFabricItemStack . hasBannerPatterns
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:base_color> Used for shield colouring. // FabricItemStack.hasBaseColor as bool
myFabricItemStack . hasBaseColor
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:bees> // FabricItemStack.hasBees as bool
myFabricItemStack . hasBees
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:block_entity_data> // FabricItemStack.hasBlockEntityData as bool
myFabricItemStack . hasBlockEntityData
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:block_state> // FabricItemStack.hasBlockState as bool
myFabricItemStack . hasBlockState
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:bucket_entity_data> // FabricItemStack.hasBucketEntityData as bool
myFabricItemStack . hasBucketEntityData
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:bundle_contents> // 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
Checks whether the ComponentAccess has <componenttype:minecraft:charged_projectiles> This component is used for crossbows. // FabricItemStack.hasChargedProjectiles as bool
myFabricItemStack . hasChargedProjectiles
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:container> // FabricItemStack.hasContainer as bool
myFabricItemStack . hasContainer
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:container_loot> // 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
Checks whether the ComponentAccess has <componenttype:minecraft:debug_stick_state> // FabricItemStack.hasDebugStickState as bool
myFabricItemStack . hasDebugStickState
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:dyed_color> // 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
Checks whether the ComponentAccess has <componenttype:minecraft:entity_data> // FabricItemStack.hasEntityData as bool
myFabricItemStack . hasEntityData
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:firework_explosion> // FabricItemStack.hasFireworkExplosion as bool
myFabricItemStack . hasFireworkExplosion
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:fireworks> // 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
Checks whether the ComponentAccess has <componenttype:minecraft:instrument> // 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
Checks whether the ComponentAccess has <componenttype:minecraft:lock> // FabricItemStack.hasLock as bool
myFabricItemStack . hasLock
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:lodestone_tracker> // 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
Checks whether the ComponentAccess has <componenttype:minecraft:map_color> // FabricItemStack.hasMapColor as bool
myFabricItemStack . hasMapColor
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:map_decorations> MapDecorations are additional elements that render on a map, such as waypoints. // FabricItemStack.hasMapDecorations as bool
myFabricItemStack . hasMapDecorations
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:map_id> // FabricItemStack.hasMapId as bool
myFabricItemStack . hasMapId
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:map_post_processing> This componenet stores additional info on the map, such as the scale or whether to lock it. // 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
Checks whether the ComponentAccess has <componenttype:minecraft:note_block_sound> // FabricItemStack.hasNoteBlockSound as bool
myFabricItemStack . hasNoteBlockSound
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:ominous_bottle_amplifier> // FabricItemStack.hasOminousBottleAmplifier as bool
myFabricItemStack . hasOminousBottleAmplifier
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:pot_decorations> // FabricItemStack.hasPotDecorations as bool
myFabricItemStack . hasPotDecorations
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:potion_contents> Stores Potion Data on an item. // FabricItemStack.hasPotionContents as bool
myFabricItemStack . hasPotionContents
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:profile> // 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
Checks whether the ComponentAccess has <componenttype:minecraft:recipes> Used for Knowledge Books. // 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
Checks whether the ComponentAccess has <componenttype:minecraft:stored_enchantments> 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. // FabricItemStack.hasStoredEnchantments as bool
myFabricItemStack . hasStoredEnchantments
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:suspicious_stew_effects> // 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
Checks whether the ComponentAccess has <componenttype:minecraft:trim> // 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
Checks whether the ComponentAccess has <componenttype:minecraft:writable_book_content> // FabricItemStack.hasWritableBookContent as bool
myFabricItemStack . hasWritableBookContent
Return Type:
bool
Checks whether the ComponentAccess has <componenttype:minecraft:written_book_content> // 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.
myFabricItemStack . hoverName
Return Type:
Component
The backing ingredient myFabricItemStack . ingredient
Return Type:
IIngredient
Gets the data in <componenttype:minecraft: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. myFabricItemStack . itemName
Return Type:
Component
Gets the data in <componenttype:minecraft:lock> // FabricItemStack.lockComponent as LockCode myFabricItemStack . lockComponent
Return Type:
LockCode
Gets the data in <componenttype:minecraft:lodestone_tracker> myFabricItemStack . lodestoneTracker
Return Type:
LodestoneTracker
Gets the data in the <componenttype:minecraft:lore>
Return Type:
ItemLore
Gets the data in <componenttype:minecraft:map_color> myFabricItemStack . mapColor
Return Type:
MapItemColor
Gets the data in <componenttype:minecraft:map_decorations> myFabricItemStack . mapDecorations
Return Type:
MapDecorations
Gets the data in <componenttype:minecraft:map_id> // FabricItemStack.mapId as MapId
Return Type:
MapId
Gets the data in <componenttype:minecraft:map_post_processing> 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
myFabricItemStack . modifyShiftTooltip(myITooltipFunction, myITooltipFunction);
myFabricItemStack . modifyTooltip(myITooltipFunction);
Use this in contexts where machines accept more than one item to state that fact. myFabricItemStack . mul(myInt);
Return Type:
IIngredientWithAmount
Gets the data in <componenttype:minecraft:note_block_sound> myFabricItemStack . noteBlockSound
Return Type:
ResourceLocation
Gets the data in <componenttype:minecraft:ominous_bottle_amplifier> // FabricItemStack.ominousBottleAmplifier as int
myFabricItemStack . ominousBottleAmplifier
Return Type:
int
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
myFabricItemStack . percent(myDouble);
Parameters:
percentage: double
Type: double
Return Type:
Percentaged <IItemStack >
Gets the data in <componenttype:minecraft:pot_decorations> myFabricItemStack . potDecorations
Return Type:
PotDecorations
Gets the data in <componenttype:minecraft:potion_contents> myFabricItemStack . potionContents
Return Type:
PotionContents
Gets the data in <componenttype:minecraft:profile> myFabricItemStack . profile
Return Type:
ResolvableProfile
Gets the data in the <componenttype:minecraft:rarity> // FabricItemStack.rarity as Rarity
Return Type:
Rarity
Gets the data in <componenttype:minecraft:recipes> myFabricItemStack . recipes
Return Type:
List <ResourceLocation >
Gets the registry name for the Item in this IItemStack myFabricItemStack . registryName
Return Type:
ResourceLocation
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. 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
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
Gets the data in <componenttype:minecraft:stored_enchantments> myFabricItemStack . storedEnchantments
Return Type:
ItemEnchantments
Gets the data in <componenttype:minecraft:suspicious_stew_effects> myFabricItemStack . suspiciousStewEffects
Return Type:
SuspiciousStewEffects
Gets the data in <componenttype:minecraft:tool> // FabricItemStack.tool as Tool
Return Type:
Tool
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
myFabricItemStack . transformReplace(myIItemStack);
Return Type:
IIngredient
Gets the data in <componenttype:minecraft:trim>
Return Type:
ArmorTrim
Gets the data in the <componenttype:minecraft: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
myFabricItemStack . update < T>(myDataComponentType, myT, myUnaryOperator);
Parameters:
defaultValue: T
Type: T
operator: UnaryOperator <T >
Type: UnaryOperator <T >
Return Type:
IItemStack
Returns true if this stack is considered a crossbow item // FabricItemStack.useOnRelease as bool
myFabricItemStack . useOnRelease
Return Type:
bool
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.
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.
myFabricItemStack . withAttributeModifiers(myEntry, myBool);
Parameters:
showInTooltip: bool
(optional) Type: bool
Default Value: true
Return Type:
ComponentAccess
myFabricItemStack . withAttributeModifiers(myList, myBool);
Parameters:
showInTooltip: bool
(optional) Type: bool
Default Value: true
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:banner_patterns> of the ComponentAccess to have the given List<BannerPatternLayers.Layer> Returns : The new instance with the modified data.
myFabricItemStack . withBannerPatterns(myList);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:banner_patterns> of the ComponentAccess to have the given BannerPatternLayers
Returns : The new instance with the modified data.
myFabricItemStack . withBannerPatterns(myBannerPatternLayers);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:base_color> of the ComponentAccess to have the given DyeColor
Returns : The new instance with the modified data.
myFabricItemStack . withBaseColor(myDyeColor);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:bees> of the ComponentAccess to have the given occupants Returns : The new instance with the modified data.
myFabricItemStack . withBees(myList);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:block_entity_data> of the ComponentAccess to have the given MapData
Returns : The new instance with the modified data.
myFabricItemStack . withBlockEntityData(myMapData);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:block_entity_data> of the ComponentAccess to have the given CustomData
Returns : The new instance with the modified data.
myFabricItemStack . withBlockEntityData(myCustomData);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:block_state> of the ComponentAccess to have the given BlockItemStateProperties
Returns : The new instance with the modified data.
myFabricItemStack . withBlockState(myBlockItemStateProperties);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:bucket_entity_data> of the ComponentAccess to have the given MapData
Returns : The new instance with the modified data.
myFabricItemStack . withBucketEntityData(myMapData);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:bucket_entity_data> of the ComponentAccess to have the given CustomData
Returns : The new instance with the modified data.
myFabricItemStack . withBucketEntityData(myCustomData);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:bundle_contents> of the ComponentAccess to have the given contents Returns : The new instance with the modified data.
myFabricItemStack . withBundleContents([ < item : minecraft:diamond > * 64 ]);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:bundle_contents> of the ComponentAccess to have the given BundleContents
Returns : The new instance with the modified data.
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.
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.
myFabricItemStack . withCanBreak(myAdventureModePredicate);
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.
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.
myFabricItemStack . withCanPlaceOn(myAdventureModePredicate);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:charged_projectiles> of the ComponentAccess to have the given IItemStack
Returns : The new instance with the modified data.
myFabricItemStack . withChargedProjectiles( < item : minecraft:arrow > );
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:charged_projectiles> of the ComponentAccess to have the given items. Returns : The new instance with the modified data.
myFabricItemStack . withChargedProjectiles([ < item : minecraft:arrow > ]);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:charged_projectiles> of the ComponentAccess to have the given ChargedProjectiles
Returns : The new instance with the modified data.
myFabricItemStack . withChargedProjectiles(myChargedProjectiles);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:container> of the ComponentAccess to have the given values. Returns : The new instance with the modified data.
myFabricItemStack . withContainer(myList);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:container> of the ComponentAccess to have the given ItemContainerContents
Returns : The new instance with the modified data.
myFabricItemStack . withContainer(myItemContainerContents);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:container_loot> of the ComponentAccess to have the given loot table and seed. Returns : The new instance with the modified data.
myFabricItemStack . withContainerLoot(myResourceKey, myLong);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:container_loot> of the ComponentAccess to have the given SeededContainerLoot
Returns : The new instance with the modified data.
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.
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.
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.
myFabricItemStack . withCustomData(myCustomData);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:custom_model_data> of the ComponentAccess to have the given value. Returns : The new instance with the modified data.
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.
myFabricItemStack . withCustomModelData(myCustomModelData);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:custom_name> of the ComponentAccess. Returns : The new instance with the modified data.
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. Using this on an item that has no maxDamage may have unforeseen issues. Returns : The new instance with the modified data.
myFabricItemStack . withDamage( 16 );
Parameters:
damage: int
Type: int
- The new damage of the ComponentAccess.
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:debug_stick_state> of the ComponentAccess to have the given DebugStickState
Returns : The new instance with the modified data.
myFabricItemStack . withDebugStickState(myDebugStickState);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:dyed_color> of the ComponentAccess. Returns : The new instance with the modified data.
// FabricItemStack.withDyedColor(rgb as int, showInTooltip as bool = true) as ComponentAccess ; myFabricItemStack . withDyedColor( 0xFFFF00 , true );
Parameters:
rgb: int
Type: int
- The colour to dye this item with
showInTooltip: bool
(optional) Type: bool
- Whether to show this information in a tooltip
Default Value: true
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:dyed_color> of the ComponentAccess to have the given DyedItemColor
Returns : The new instance with the modified data.
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.
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.
myFabricItemStack . withEnchantments(myItemEnchantments);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:entity_data> of the ComponentAccess to have the given MapData
Returns : The new instance with the modified data.
myFabricItemStack . withEntityData(myMapData);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:entity_data> of the ComponentAccess to have the given CustomData
Returns : The new instance with the modified data.
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.
myFabricItemStack . withFireResistant();
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:firework_explosion> of the ComponentAccess to have the given FireworkExplosion
Returns : The new instance with the modified data.
myFabricItemStack . withFireworkExplosion(myFireworkExplosion);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:fireworks> of the ComponentAccess to have the given duration and explosions. Returns : The new instance with the modified data.
myFabricItemStack . withFireworks(myInt, myList);
Parameters:
flightDuration: int
Type: int
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:fireworks> of the ComponentAccess to have the given Fireworks
Returns : The new instance with the modified data.
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.
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.
myFabricItemStack . withHideAdditionalTooltip();
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:hide_tooltip> of the ComponentAccess to exist. Returns : The new instance with the modified data.
myFabricItemStack . withHideTooltip();
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:instrument> of the ComponentAccess to have the given Instrument
Returns : The new instance with the modified data.
myFabricItemStack . withInstrument(myInstrument);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:intangible_projectile> of the ComponentAccess to exist. Returns : The new instance with the modified data.
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.
myFabricItemStack . withItemName( Component . literal( "Fancy Water" ));
Return Type:
ComponentAccess
myFabricItemStack . withJsonComponent(myDataComponentType, myIData);
Return Type:
IItemStack
myFabricItemStack . withJsonComponents(myIData);
Return Type:
IItemStack
Sets the <componenttype:minecraft:lock> of the ComponentAccess to have the given string. Returns : The new instance with the modified data.
myFabricItemStack . withLock(myString);
Parameters:
code: string
Type: string
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:lock> of the ComponentAccess to have the given LockCode
Returns : The new instance with the modified data.
myFabricItemStack . withLock(myLockCode);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:lodestone_tracker> of the ComponentAccess to have the given LodestoneTracker
Returns : The new instance with the modified data.
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.
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.
myFabricItemStack . withLore(myItemLore);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:map_color> of the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withMapColor( 0xFF0000 );
Parameters:
rgb: int
Type: int
- The new map colour
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:map_color> of the ComponentAccess to have the given MapItemColor
Returns : The new instance with the modified data.
myFabricItemStack . withMapColor(myMapItemColor);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:map_decorations> of the ComponentAccess to have the given values. Returns : The new instance with the modified data.
myFabricItemStack . withMapDecorations(myMap);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:map_decorations> of the ComponentAccess to have the given MapDecorations
Returns : The new instance with the modified data.
myFabricItemStack . withMapDecorations(myMapDecorations);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:map_id> 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.
myFabricItemStack . withMapId(myInt);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:map_id> of the ComponentAccess to have the given MapId
Returns : The new instance with the modified data.
myFabricItemStack . withMapId(myMapId);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:map_post_processing> of the ComponentAccess to have the given MapPostProcessing
Returns : The new instance with the modified data.
myFabricItemStack . withMapPostProcessing(myMapPostProcessing);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:max_damage> 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.
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
Sets the <componenttype:minecraft:note_block_sound> of the ComponentAccess to have the given ResourceLocation
Returns : The new instance with the modified data.
myFabricItemStack . withNoteBlockSound(myResourceLocation);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:ominous_bottle_amplifier> of the ComponentAccess to have the given amplifier. Returns : The new instance with the modified data.
// FabricItemStack.withOminousBottleAmplifier(amplifier as int) as ComponentAccess ; myFabricItemStack . withOminousBottleAmplifier(myInt);
Return Type:
ComponentAccess
myFabricItemStack . without < T>(myDataComponentType);
Return Type:
IItemStack
Removes the <componenttype:minecraft:attribute_modifiers> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutAttributeModifiers();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:banner_patterns> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutBannerPatterns();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:base_color> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutBaseColor();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:bees> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutBees();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:block_entity_data> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutBlockEntityData();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:block_state> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutBlockState();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:bucket_entity_data> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutBucketEntityData();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:bundle_contents> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutBundleContents();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:can_break> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutCanBreak();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:can_place_on> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutCanPlaceOn();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:charged_projectiles> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutChargedProjectiles();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:container> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutContainer();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:container_loot> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutContainerLoot();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:creative_slot_lock> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutCreativeSlotLock();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:custom_data> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutCustomData();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:custom_model_data> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutCustomModelData();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:custom_name> from the ComponentAccess Returns : The new instance with the modified data.
myFabricItemStack . withoutCustomName();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:damage> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutDamage();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:debug_stick_state> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutDebugStickState();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:dyed_color> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutDyedColor();
Return Type:
ComponentAccess
Removes the Enchantment
from the ComponentAccess. Returns : The new instance with the modified data.
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.
myFabricItemStack . withoutEnchantmentGlintOverride();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:enchantments> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutEnchantments();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:entity_data> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutEntityDate();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:fire_resistant> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutFireResistant();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:firework_explosion> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutFireworkExplosion();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:fireworks> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutFireworks();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:food> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutFood();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:hide_additional_tooltip> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutHideAdditionalTooltip();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:hide_tooltip> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutHideTooltip();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:instrument> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutInstrument();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:intangible_projectile> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutIntangibleProjectile();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:item_name> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutItemName();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:lock> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutLock();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:lodestone_tracker> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutLodestoneTracker();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:lore> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutLore();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:map_color> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutMapColor();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:map_decorations> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutMapDecorations();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:map_id> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutMapId();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:map_post_processing> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutMapPostProcessing();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:max_damage> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutMaxDamage();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:stack_size> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutMaxStackSize();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:note_block_sound> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutNoteBlockSound();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:ominous_bottle_amplifier> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutOminousBottleAmplifier();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:pot_decorations> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutPotDecorations();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:potion_contents> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutPotionContents();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:profile> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutProfile();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:rarity> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutRarity();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:recipes> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutRecipes();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:repair_cost> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutRepairCost();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:stored_enchantments> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutStoredEnchantments();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:suspicious_stew_effects> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutSuspiciousStewEffects();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:tool> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutTool();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:trim> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutTrim();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:unbreakable> from the ComponentAccess Returns : The new instance with the modified data.
myFabricItemStack . withoutUnbreakable();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:writable_book_content> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutWritableBookContent();
Return Type:
ComponentAccess
Removes the <componenttype:minecraft:written_book_content> from the ComponentAccess. Returns : The new instance with the modified data.
myFabricItemStack . withoutWrittenBookContent();
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:pot_decorations> of the ComponentAccess to have the given items. Returns : The new instance with the modified data.
myFabricItemStack . withPotDecorations(myItem, myItem, myItem, myItem);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:pot_decorations> of the ComponentAccess to have the given PotDecorations
Returns : The new instance with the modified data.
myFabricItemStack . withPotDecorations(myPotDecorations);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:potion_contents> of the ComponentAccess to have the given Potion
and no custom effects Returns : The new instance with the modified data.
myFabricItemStack . withPotionContents( < potion : minecraft:swiftness > );
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:potion_contents> of the ComponentAccess to have the given Potion
and the given MobEffectInstance
effects. Returns : The new instance with the modified data.
myFabricItemStack . withPotionContents( < potion : minecraft:swiftness > , [ MobEffectInstance . of( < mobeffect : minecraft:strength > , 20 * 20 , 1 , false , false , true )]);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:potion_contents> of the ComponentAccess to have the given Potion
and the given MobEffectInstance
effects. Returns : The new instance with the modified data.
myFabricItemStack . withPotionContents( < potion : minecraft:swiftness > , 0xFFFFFF00 , [ MobEffectInstance . of( < mobeffect : minecraft:strength > , 20 * 20 , 1 , false , false , true )]);
Parameters:
customColor: int
Type: int
- The ARGB color the potion will have.
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:potion_contents> of the ComponentAccess to have the given PotionContents
Returns : The new instance with the modified data.
myFabricItemStack . withPotionContents(myPotionContents);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:profile> of the ComponentAccess to have the given ResolvableProfile
Returns : The new instance with the modified data.
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.
myFabricItemStack . withRarity( < constant : minecraft:item/rarity:epic > );
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:recipes> of the ComponentAccess to have the given List<ResourceLocation> Returns : The new instance with the modified data.
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.
myFabricItemStack . withRepairCost( 20 );
Parameters:
cost: int
Type: int
- The repair cost
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:stored_enchantments> of the ComponentAccess to have the given ItemEnchantments
Returns : The new instance with the modified data.
myFabricItemStack . withStoredEnchantments(myItemEnchantments);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:suspicious_stew_effects> 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.
myFabricItemStack . withSuspiciousStewEffects(myList);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:suspicious_stew_effects> of the ComponentAccess to have the given SuspiciousStewEffects
Returns : The new instance with the modified data.
myFabricItemStack . withSuspiciousStewEffects(mySuspiciousStewEffects);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:tool> of the ComponentAccess to have the given data. A Tool
instance is constructed from the parameters. Returns : The new instance with the modified data.
// FabricItemStack.withTool(rules as List< ToolRule >, defaultMiningSpeed as float, damagePerBlock as int) as ComponentAccess ; myFabricItemStack . withTool([ ToolRule . minesAndDrops( < tag : blocks:minecraft:planks > , 6.0f )], 0.25f , 1 );
Parameters:
rules: List <ToolRule >
Type: List <ToolRule >
- The list of rules the new Tool instance will have defaultMiningSpeed: float
Type: float
- The default mining speed of the new tool
damagePerBlock: int
Type: int
- The damage or durability that is dealt to the Tool after use.
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:tool> of the ComponentAccess to have the given Tool
Returns : The new instance with the modified data.
myFabricItemStack . withTool(myTool);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:trim> of the ComponentAccess to have the given ArmorTrim
Returns : The new instance with the modified data.
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.
myFabricItemStack . withUnbreakable(myUnbreakable);
Return Type:
ComponentAccess
Returns : The new instance with the modified data.
myFabricItemStack . withWritableBookContent(myList);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:writable_book_content> of the ComponentAccess to have the given WritableBookContent
Returns : The new instance with the modified data.
myFabricItemStack . withWritableBookContent(myWritableBookContent);
Return Type:
ComponentAccess
Sets the <componenttype:minecraft:written_book_content> of the ComponentAccess to have the given WrittenBookContent
Returns : The new instance with the modified data.
myFabricItemStack . withWrittenBookContent(myWrittenBookContent);
Return Type:
ComponentAccess
Gets the data in <componenttype:minecraft:writable_book_content> myFabricItemStack . writableBookContent
Return Type:
WritableBookContent
Gets the data in <componenttype:minecraft:written_book_content> myFabricItemStack . writtenBookContent
Return Type:
WrittenBookContent