FabricItemStack
Importing the class
If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.
import crafttweaker.api.item.FabricItemStack;
Implements
FabricItemStack
implements the following interfaces:
IItemStack
,IIngredient
,IIngredientWithAmount
,DataComponentHolder
,ComponentAccess<IItemStack>
,CommandStringDisplayable
Operators
myIIngredient in myFabricItemStack
Parameters:
Return Type:
bool
// (FabricItemStack * (amount as int)) as IIngredientWithAmountmyFabricItemStack * myInt
Parameters:
amount: int
Type: int
Return Type:
IIngredientWithAmount
myFabricItemStack | myIIngredient
Parameters:
other: IIngredient
Type: IIngredient
Return Type:
IIngredientList
myFabricItemStack % myDouble
Parameters:
percentage: double
Type: double
Return Type:
Percentaged<IItemStack>
// (FabricItemStack * (amount as int)) as IItemStackmyFabricItemStack * myInt
Parameters:
amount: int
Type: int
- new amount
Return Type:
IItemStack
Members
Please use Item Components instead.
// FabricItemStack.addGlobalAttributeModifier(attribute as Attribute, id as ResourceLocation, value as double, operation as AttributeOperation, slotTypes as EquipmentSlot[]);myFabricItemStack.addGlobalAttributeModifier(myAttribute, myResourceLocation, myDouble, myOperation, myEquipmentSlot[]);
Parameters:
id: ResourceLocation
Type: ResourceLocation
value: double
Type: double
operation: AttributeOperation
Type: AttributeOperation
slotTypes: EquipmentSlot[]
Type: EquipmentSlot[]
// FabricItemStack.amount as intmyFabricItemStack.amount
Return Type:
int
// FabricItemStack.amount as intmyFabricItemStack.amount
Return Type:
int
myFabricItemStack.applyComponents(myDataComponentMap);
Parameters:
map: DataComponentMap
Type: DataComponentMap
Return Type:
IItemStack
myFabricItemStack.applyComponents(myDataComponentPatch);
Parameters:
patch: DataComponentPatch
Type: DataComponentPatch
Return Type:
IItemStack
myFabricItemStack.applyComponentsAndValidate(myDataComponentPatch);
Parameters:
patch: DataComponentPatch
Type: DataComponentPatch
Return Type:
IItemStack
myFabricItemStack.asIIngredientWithAmount();
Return Type:
IIngredientWithAmount
// FabricItemStack as IIngredientWithAmountmyFabricItemStack as IIngredientWithAmount
Return Type:
IIngredientWithAmount
// FabricItemStack as IIngredientWithAmountmyFabricItemStack as IIngredientWithAmount
Return Type:
IIngredientWithAmount
myFabricItemStack.asVanillaIngredient();
Return Type:
Ingredient
// FabricItemStack as IngredientmyFabricItemStack as Ingredient
Return Type:
Ingredient
myFabricItemStack as Percentaged<IItemStack>
Return Type:
Percentaged<IItemStack>
// FabricItemStack.attributeModifiers as ItemAttributeModifiersmyFabricItemStack.attributeModifiers
Return Type:
ItemAttributeModifiers
// FabricItemStack.bannerPatterns as BannerPatternLayersmyFabricItemStack.bannerPatterns
Return Type:
BannerPatternLayers
// FabricItemStack.BASE_ATTACK_DAMAGE_ID as ResourceLocationFabricItemStack.BASE_ATTACK_DAMAGE_ID
Return Type:
ResourceLocation
// FabricItemStack.BASE_ATTACK_SPEED_ID as ResourceLocationFabricItemStack.BASE_ATTACK_SPEED_ID
Return Type:
ResourceLocation
myFabricItemStack.bees
Return Type:
List<BeehiveBlockEntityOccupant>
// FabricItemStack.blockEntityData as CustomDatamyFabricItemStack.blockEntityData
Return Type:
CustomData
// FabricItemStack.blockState as BlockItemStatePropertiesmyFabricItemStack.blockState
Return Type:
BlockItemStateProperties
// FabricItemStack.bucketEntityData as CustomDatamyFabricItemStack.bucketEntityData
Return Type:
CustomData
// FabricItemStack.bundleContents as BundleContentsmyFabricItemStack.bundleContents
Return Type:
BundleContents
// FabricItemStack.burnTime = (time as int);myFabricItemStack.burnTime = myInt;
Parameters:
time: int
Type: int
- the new burn time // FabricItemStack.burnTime(time as int);myFabricItemStack.burnTime(500);
Parameters:
time: int
Type: int
- the new burn time // FabricItemStack.canBreak as AdventureModePredicatemyFabricItemStack.canBreak
Return Type:
AdventureModePredicate
// FabricItemStack.canPlaceOn as AdventureModePredicatemyFabricItemStack.canPlaceOn
Return Type:
AdventureModePredicate
// FabricItemStack.chargedProjectiles as ChargedProjectilesmyFabricItemStack.chargedProjectiles
Return Type:
ChargedProjectiles
// FabricItemStack.clearTooltip(leaveName as bool = false);myFabricItemStack.clearTooltip(myBool);
Parameters:
leaveName: bool
(optional) Type: bool
Default Value: false
// FabricItemStack.commandString as stringmyFabricItemStack.commandString
Return Type:
string
// FabricItemStack.commandString as stringmyFabricItemStack.commandString
Return Type:
string
// FabricItemStack.commandString() as string;myFabricItemStack.commandString();
Return Type:
string
// FabricItemStack.componentsPatch as DataComponentPatchmyFabricItemStack.componentsPatch
Return Type:
DataComponentPatch
myFabricItemStack.condition(myIIngredientCondition);
Parameters:
condition: IIngredientCondition
Type: IIngredientCondition
Return Type:
IIngredient
// FabricItemStack.container as ItemContainerContentsmyFabricItemStack.container
Return Type:
ItemContainerContents
// FabricItemStack.containerLoot as SeededContainerLootmyFabricItemStack.containerLoot
Return Type:
SeededContainerLoot
myFabricItemStack.contains((<item:minecraft:iron_ingot> | <item:minecraft:gold_ingot>));
Parameters:
Return Type:
bool
// FabricItemStack.CRAFTTWEAKER_DATA_KEY as stringFabricItemStack.CRAFTTWEAKER_DATA_KEY
Return Type:
string
// FabricItemStack.creativeSlotLock as boolmyFabricItemStack.creativeSlotLock
Return Type:
bool
// FabricItemStack.customData as CustomDatamyFabricItemStack.customData
Return Type:
CustomData
// FabricItemStack.customModelData as CustomModelDatamyFabricItemStack.customModelData
Return Type:
CustomModelData
// FabricItemStack.damage as intmyFabricItemStack.damage
Return Type:
int
// FabricItemStack.damageableItem as boolmyFabricItemStack.damageableItem
Return Type:
bool
// FabricItemStack.damaged as boolmyFabricItemStack.damaged
Return Type:
bool
// FabricItemStack.debugStickState as DebugStickStatemyFabricItemStack.debugStickState
Return Type:
DebugStickState
// FabricItemStack.definition as ItemDefinitionmyFabricItemStack.definition
Return Type:
ItemDefinition
// FabricItemStack as ItemDefinitionmyFabricItemStack as Item
Return Type:
ItemDefinition
// FabricItemStack.descriptionId as stringmyFabricItemStack.descriptionId
Return Type:
string
// FabricItemStack.dyedColor as DyedItemColormyFabricItemStack.dyedColor
Return Type:
DyedItemColor
// FabricItemStack.empty as boolmyFabricItemStack.empty
Return Type:
bool
Returns: true if empty, false otherwise
// FabricItemStack.empty() as bool;myFabricItemStack.empty();
Return Type:
bool
If it is present, it is first checked to determine whether there is special behaviour, otherwise the code checks for enchantments.
// FabricItemStack.enchantmentGlintOverride as boolmyFabricItemStack.enchantmentGlintOverride
Return Type:
bool
// FabricItemStack.enchantments as ItemEnchantmentsmyFabricItemStack.enchantments
Return Type:
ItemEnchantments
// FabricItemStack.entityData as CustomDatamyFabricItemStack.entityData
Return Type:
CustomData
// FabricItemStack.fireworkExplosion as FireworkExplosionmyFabricItemStack.fireworkExplosion
Return Type:
FireworkExplosion
// FabricItemStack.food as FoodPropertiesmyFabricItemStack.food
Return Type:
FoodProperties
Returns: A Map of Attribute to a List of AttributeModifier for the given EquipmentSlot.
myFabricItemStack.getAttributes(<constant:minecraft:equipmentslot:chest>);
Parameters:
Return Type:
List<AttributeModifier>[Attribute]
myFabricItemStack.getRemainingItem(<item:minecraft:iron_ingot>);
Parameters:
Return Type:
IItemStack
Returns: use duration
myFabricItemStack.getUseDuration(entity);
Parameters:
entity: LivingEntity
Type: LivingEntity
Return Type:
int
Returns: This IItemStack if mutable, a new one with the new amount otherwise.
myFabricItemStack.grow(2);
Parameters:
amount: int
(optional) Type: int
- The amount to grow by.
Default Value: 1
Return Type:
IItemStack
// FabricItemStack.hasAttributeModifiers as boolmyFabricItemStack.hasAttributeModifiers
Return Type:
bool
// FabricItemStack.hasBannerPatterns as boolmyFabricItemStack.hasBannerPatterns
Return Type:
bool
Used for shield colouring.
// FabricItemStack.hasBaseColor as boolmyFabricItemStack.hasBaseColor
Return Type:
bool
// FabricItemStack.hasBees as boolmyFabricItemStack.hasBees
Return Type:
bool
// FabricItemStack.hasBlockEntityData as boolmyFabricItemStack.hasBlockEntityData
Return Type:
bool
// FabricItemStack.hasBlockState as boolmyFabricItemStack.hasBlockState
Return Type:
bool
// FabricItemStack.hasBucketEntityData as boolmyFabricItemStack.hasBucketEntityData
Return Type:
bool
// FabricItemStack.hasBundleContents as boolmyFabricItemStack.hasBundleContents
Return Type:
bool
// FabricItemStack.hasCanBreak as boolmyFabricItemStack.hasCanBreak
Return Type:
bool
// FabricItemStack.hasCanPlaceOn as boolmyFabricItemStack.hasCanPlaceOn
Return Type:
bool
This component is used for crossbows.
// FabricItemStack.hasChargedProjectiles as boolmyFabricItemStack.hasChargedProjectiles
Return Type:
bool
// FabricItemStack.hasContainer as boolmyFabricItemStack.hasContainer
Return Type:
bool
// FabricItemStack.hasContainerLoot as boolmyFabricItemStack.hasContainerLoot
Return Type:
bool
// FabricItemStack.hasCustomData as boolmyFabricItemStack.hasCustomData
Return Type:
bool
// FabricItemStack.hasCustomModelData as boolmyFabricItemStack.hasCustomModelData
Return Type:
bool
// FabricItemStack.hasCustomName as boolmyFabricItemStack.hasCustomName
Return Type:
bool
// FabricItemStack.hasDamage as boolmyFabricItemStack.hasDamage
Return Type:
bool
// FabricItemStack.hasDebugStickState as boolmyFabricItemStack.hasDebugStickState
Return Type:
bool
// FabricItemStack.hasDyedColor as boolmyFabricItemStack.hasDyedColor
Return Type:
bool
// FabricItemStack.hasEnchantmentGlintOverride as boolmyFabricItemStack.hasEnchantmentGlintOverride
Return Type:
bool
// FabricItemStack.hasEnchantments as boolmyFabricItemStack.hasEnchantments
Return Type:
bool
// FabricItemStack.hasEntityData as boolmyFabricItemStack.hasEntityData
Return Type:
bool
// FabricItemStack.hasFireworkExplosion as boolmyFabricItemStack.hasFireworkExplosion
Return Type:
bool
// FabricItemStack.hasFireworks as boolmyFabricItemStack.hasFireworks
Return Type:
bool
Foil is the glint / effect that is added to enchanted ItemStacks (and other items).
// FabricItemStack.hasFoil as boolmyFabricItemStack.hasFoil
Return Type:
bool
// FabricItemStack.hasFood as boolmyFabricItemStack.hasFood
Return Type:
bool
// FabricItemStack.hasInstrument as boolmyFabricItemStack.hasInstrument
Return Type:
bool
// FabricItemStack.hasItemName as boolmyFabricItemStack.hasItemName
Return Type:
bool
// FabricItemStack.hasLock as boolmyFabricItemStack.hasLock
Return Type:
bool
// FabricItemStack.hasLodestoneTracker as boolmyFabricItemStack.hasLodestoneTracker
Return Type:
bool
// FabricItemStack.hasLore as boolmyFabricItemStack.hasLore
Return Type:
bool
// FabricItemStack.hasMapColor as boolmyFabricItemStack.hasMapColor
Return Type:
bool
MapDecorations are additional elements that render on a map, such as waypoints.
// FabricItemStack.hasMapDecorations as boolmyFabricItemStack.hasMapDecorations
Return Type:
bool
// FabricItemStack.hasMapId as boolmyFabricItemStack.hasMapId
Return Type:
bool
This componenet stores additional info on the map, such as the scale or whether to lock it.
// FabricItemStack.hasMapPostProcessing as boolmyFabricItemStack.hasMapPostProcessing
Return Type:
bool
// FabricItemStack.hasMaxDamage as boolmyFabricItemStack.hasMaxDamage
Return Type:
bool
// FabricItemStack.hasMaxStackSize as boolmyFabricItemStack.hasMaxStackSize
Return Type:
bool
// FabricItemStack.hasNoteBlockSound as boolmyFabricItemStack.hasNoteBlockSound
Return Type:
bool
// FabricItemStack.hasOminousBottleAmplifier as boolmyFabricItemStack.hasOminousBottleAmplifier
Return Type:
bool
// FabricItemStack.hasPotDecorations as boolmyFabricItemStack.hasPotDecorations
Return Type:
bool
Stores Potion Data on an item.
// FabricItemStack.hasPotionContents as boolmyFabricItemStack.hasPotionContents
Return Type:
bool
// FabricItemStack.hasProfile as boolmyFabricItemStack.hasProfile
Return Type:
bool
// FabricItemStack.hasRarity as boolmyFabricItemStack.hasRarity
Return Type:
bool
Used for Knowledge Books.
// FabricItemStack.hasRecipes as boolmyFabricItemStack.hasRecipes
Return Type:
bool
// FabricItemStack.hasRepairCost as boolmyFabricItemStack.hasRepairCost
Return Type:
bool
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 boolmyFabricItemStack.hasStoredEnchantments
Return Type:
bool
// FabricItemStack.hasSuspiciousStewEffects as boolmyFabricItemStack.hasSuspiciousStewEffects
Return Type:
bool
// FabricItemStack.hasTool as boolmyFabricItemStack.hasTool
Return Type:
bool
// FabricItemStack.hasTrim as boolmyFabricItemStack.hasTrim
Return Type:
bool
// FabricItemStack.hasUnbreakable as boolmyFabricItemStack.hasUnbreakable
Return Type:
bool
// FabricItemStack.hasWritableBookContent as boolmyFabricItemStack.hasWritableBookContent
Return Type:
bool
// FabricItemStack.hasWrittenBookContent as boolmyFabricItemStack.hasWrittenBookContent
Return Type:
bool
// FabricItemStack.hideAdditionalTooltip as boolmyFabricItemStack.hideAdditionalTooltip
Return Type:
bool
// FabricItemStack.hideTooltip as boolmyFabricItemStack.hideTooltip
Return Type:
bool
// FabricItemStack.ingredient as IIngredientmyFabricItemStack.ingredient
Return Type:
IIngredient
// FabricItemStack.instrument as InstrumentmyFabricItemStack.instrument
Return Type:
Instrument
// FabricItemStack.isEnchantable as boolmyFabricItemStack.isEnchantable
Return Type:
bool
// FabricItemStack.isFireResistant as boolmyFabricItemStack.isFireResistant
Return Type:
bool
// FabricItemStack.isImmutable as boolmyFabricItemStack.isImmutable
Return Type:
bool
// FabricItemStack.isImmutable() as bool;myFabricItemStack.isImmutable();
Return Type:
bool
// FabricItemStack.isIntangibleProjectile as boolmyFabricItemStack.isIntangibleProjectile
Return Type:
bool
// FabricItemStack.isMutable as boolmyFabricItemStack.isMutable
Return Type:
bool
// FabricItemStack.isMutable() as bool;myFabricItemStack.isMutable();
Return Type:
bool
myFabricItemStack.items
Return Type:
IItemStack[]
// FabricItemStack.lodestoneTracker as LodestoneTrackermyFabricItemStack.lodestoneTracker
Return Type:
LodestoneTracker
// FabricItemStack.mapColor as MapItemColormyFabricItemStack.mapColor
Return Type:
MapItemColor
// FabricItemStack.mapDecorations as MapDecorationsmyFabricItemStack.mapDecorations
Return Type:
MapDecorations
// FabricItemStack.mapPostProcessing as MapPostProcessingmyFabricItemStack.mapPostProcessing
Return Type:
MapPostProcessing
myFabricItemStack.matches(<item:minecraft:iron_ingot>);
Parameters:
Return Type:
bool
// FabricItemStack.maxDamage as intmyFabricItemStack.maxDamage
Return Type:
int
// FabricItemStack.maxDamage as intmyFabricItemStack.maxDamage
Return Type:
int
// FabricItemStack.maxStackSize as intmyFabricItemStack.maxStackSize
Return Type:
int
// FabricItemStack.modifyShiftTooltip(shiftedFunction as ITooltipFunction, unshiftedFunction as ITooltipFunction = null);myFabricItemStack.modifyShiftTooltip(myITooltipFunction, myITooltipFunction);
Parameters:
shiftedFunction: ITooltipFunction
Type: ITooltipFunction
myFabricItemStack.modifyTooltip(myITooltipFunction);
Parameters:
function: ITooltipFunction
Type: ITooltipFunction
myFabricItemStack.mul(myInt);
Parameters:
amount: int
Type: int
Return Type:
IIngredientWithAmount
// FabricItemStack.noteBlockSound as ResourceLocationmyFabricItemStack.noteBlockSound
Return Type:
ResourceLocation
// FabricItemStack.ominousBottleAmplifier as intmyFabricItemStack.ominousBottleAmplifier
Return Type:
int
myFabricItemStack.onlyDamagedAtLeast(myInt);
Parameters:
minDamage: int
Type: int
Return Type:
IIngredient
myFabricItemStack.onlyDamagedAtMost(myInt);
Parameters:
maxDamage: int
Type: int
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
// FabricItemStack.owner as stringmyFabricItemStack.owner
Return Type:
string
myFabricItemStack.percent(myDouble);
Parameters:
percentage: double
Type: double
Return Type:
Percentaged<IItemStack>
// FabricItemStack.potDecorations as PotDecorationsmyFabricItemStack.potDecorations
Return Type:
PotDecorations
// FabricItemStack.potionContents as PotionContentsmyFabricItemStack.potionContents
Return Type:
PotionContents
// FabricItemStack.potPattern as DecoratedPotPatternmyFabricItemStack.potPattern
Return Type:
DecoratedPotPattern
myFabricItemStack.potPatternId
Return Type:
ResourceKey<DecoratedPotPattern>
// FabricItemStack.profile as ResolvableProfilemyFabricItemStack.profile
Return Type:
ResolvableProfile
// FabricItemStack.prototype as DataComponentMapmyFabricItemStack.prototype
Return Type:
DataComponentMap
myFabricItemStack.recipes
Return Type:
List<ResourceLocation>
// FabricItemStack.registryName as ResourceLocationmyFabricItemStack.registryName
Return Type:
ResourceLocation
myFabricItemStack.remove<T>(myDataComponentType);
Parameters:
type: DataComponentType<T>
Type: DataComponentType<T>
Return Type:
IItemStack
Please use Item Components instead.
myFabricItemStack.removeGlobalAttribute(myAttribute, myEquipmentSlot[]);
Parameters:
slotTypes: EquipmentSlot[]
Type: EquipmentSlot[]
Please use Item Components instead.
myFabricItemStack.removeGlobalAttributeModifier(myString, myEquipmentSlot[]);
Parameters:
uuid: string
Type: string
slotTypes: EquipmentSlot[]
Type: EquipmentSlot[]
Please use Item Components instead.
myFabricItemStack.removeGlobalAttributeModifier(myUUID, myEquipmentSlot[]);
Parameters:
uuid: UUID
Type: UUID
slotTypes: EquipmentSlot[]
Type: EquipmentSlot[]
// FabricItemStack.removeTooltip(regex as string);myFabricItemStack.removeTooltip(myString);
Parameters:
regex: string
Type: string
// FabricItemStack.repairCost as intmyFabricItemStack.repairCost
Return Type:
int
Returns: This IItemStack if mutable, a new one with the new amount otherwise.
myFabricItemStack.shrink(2);
Parameters:
amount: int
(optional) Type: int
- The amount to shrink by.
Default Value: 1
Return Type:
IItemStack
// FabricItemStack.stackable as boolmyFabricItemStack.stackable
Return Type:
bool
// FabricItemStack.storedEnchantments as ItemEnchantmentsmyFabricItemStack.storedEnchantments
Return Type:
ItemEnchantments
// FabricItemStack.suspiciousStewEffects as SuspiciousStewEffectsmyFabricItemStack.suspiciousStewEffects
Return Type:
SuspiciousStewEffects
// FabricItemStack.transformCustom(uid as string, function as function(r as IItemStack) as IItemStack = null) as IIngredient;myFabricItemStack.transformCustom(myString, myFunction);
Parameters:
uid: string
Type: string
function: function(r as IItemStack) as IItemStack
(optional) Type: function(r as IItemStack) as IItemStack
Default Value: null
Return Type:
IIngredient
myFabricItemStack.transformDamage(myInt);
Parameters:
amount: int
(optional) Type: int
Default Value: 1
Return Type:
IIngredient
myFabricItemStack.transformReplace(myIItemStack);
Parameters:
replaceWith: IItemStack
Type: IItemStack
Return Type:
IIngredient
// FabricItemStack.unbreakable as UnbreakablemyFabricItemStack.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:
type: DataComponentType<T>
Type: DataComponentType<T>
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:
type: DataComponentType<T>
Type: DataComponentType<T>
defaultValue: T
Type: T
operator: UnaryOperator<T>
Type: UnaryOperator<T>
Return Type:
IItemStack
// FabricItemStack.useOnRelease as boolmyFabricItemStack.useOnRelease
Return Type:
bool
myFabricItemStack.with<T>(myDataComponentType, myT);
Parameters:
type: DataComponentType<T>
Type: DataComponentType<T>
value: T?
Type: T?
Return Type:
IItemStack
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(););
Parameters:
modifiers: ItemAttributeModifiers
Type: ItemAttributeModifiers
- The attributes to give to the item.
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
// FabricItemStack.withAttributeModifiers(modifier as ItemAttributeModifiersEntry, showInTooltip as bool = true) as ComponentAccess;myFabricItemStack.withAttributeModifiers(myEntry, myBool);
Parameters:
modifier: ItemAttributeModifiersEntry
Type: ItemAttributeModifiersEntry
showInTooltip: bool
(optional) Type: bool
Default Value: true
Return Type:
ComponentAccess
// FabricItemStack.withAttributeModifiers(modifiers as List<ItemAttributeModifiersEntry>, showInTooltip as bool = true) as ComponentAccess;myFabricItemStack.withAttributeModifiers(myList, myBool);
Parameters:
modifiers: List<ItemAttributeModifiersEntry>
Type: List<ItemAttributeModifiersEntry>
showInTooltip: bool
(optional) Type: bool
Default Value: true
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withBannerPatterns(myList);
Parameters:
layers: List<BannerPatternLayersLayer>
Type: List<BannerPatternLayersLayer>
Return Type:
ComponentAccess
BannerPatternLayers
Returns: The new instance with the modified data.
myFabricItemStack.withBannerPatterns(myBannerPatternLayers);
Parameters:
layers: BannerPatternLayers
Type: BannerPatternLayers
Return Type:
ComponentAccess
DyeColor
Returns: The new instance with the modified data.
myFabricItemStack.withBaseColor(myDyeColor);
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withBees(myList);
Parameters:
occupants: List<BeehiveBlockEntityOccupant>
Type: List<BeehiveBlockEntityOccupant>
Return Type:
ComponentAccess
MapData
Returns: The new instance with the modified data.
myFabricItemStack.withBlockEntityData(myMapData);
Return Type:
ComponentAccess
CustomData
Returns: The new instance with the modified data.
myFabricItemStack.withBlockEntityData(myCustomData);
Parameters:
data: CustomData
Type: CustomData
Return Type:
ComponentAccess
BlockItemStateProperties
Returns: The new instance with the modified data.
myFabricItemStack.withBlockState(myBlockItemStateProperties);
Parameters:
properties: BlockItemStateProperties
Type: BlockItemStateProperties
Return Type:
ComponentAccess
MapData
Returns: The new instance with the modified data.
myFabricItemStack.withBucketEntityData(myMapData);
Return Type:
ComponentAccess
CustomData
Returns: The new instance with the modified data.
myFabricItemStack.withBucketEntityData(myCustomData);
Parameters:
data: CustomData
Type: CustomData
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withBundleContents([<item:minecraft:diamond> * 64]);
Parameters:
Return Type:
ComponentAccess
BundleContents
Returns: The new instance with the modified data.
myFabricItemStack.withBundleContents(myBundleContents);
Parameters:
contents: BundleContents
Type: BundleContents
Return Type:
ComponentAccess
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:
predicates: List<BlockPredicate>
Type: List<BlockPredicate>
- The collection of predicates to test for showInTooltip: bool
(optional) Type: bool
- Whether to show the ability in the tooltip or not.
Default Value: true
Return Type:
ComponentAccess
AdventureModePredicate
Returns: The new instance with the modified data.
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
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:
predicates: List<BlockPredicate>
Type: List<BlockPredicate>
- The collection of predicates to test for showInTooltip: bool
(optional) Type: bool
- Whether to show the restriction in the tooltip or not.
Default Value: true
Return Type:
ComponentAccess
AdventureModePredicate
Returns: The new instance with the modified data.
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
IItemStack
Returns: The new instance with the modified data.
myFabricItemStack.withChargedProjectiles(<item:minecraft:arrow>);
Parameters:
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withChargedProjectiles([<item:minecraft:arrow>]);
Parameters:
Return Type:
ComponentAccess
ChargedProjectiles
Returns: The new instance with the modified data.
// FabricItemStack.withChargedProjectiles(chargedProjectiles as ChargedProjectiles) as ComponentAccess;myFabricItemStack.withChargedProjectiles(myChargedProjectiles);
Parameters:
chargedProjectiles: ChargedProjectiles
Type: ChargedProjectiles
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withContainer(myList);
Parameters:
contents: List<IItemStack>
Type: List<IItemStack>
Return Type:
ComponentAccess
ItemContainerContents
Returns: The new instance with the modified data.
myFabricItemStack.withContainer(myItemContainerContents);
Parameters:
contents: ItemContainerContents
Type: ItemContainerContents
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);
Parameters:
lootTable: ResourceKey<LootTable>
Type: ResourceKey<LootTable>
seed: long
Type: long
Return Type:
ComponentAccess
SeededContainerLoot
Returns: The new instance with the modified data.
myFabricItemStack.withContainerLoot(mySeededContainerLoot);
Parameters:
loot: SeededContainerLoot
Type: SeededContainerLoot
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withCreativeSlotLock();
Return Type:
ComponentAccess
MapData
Returns: The new instance with the modified data.
myFabricItemStack.withCustomData({custom_ammo_thing: 1, owner: "Benji"});
Return Type:
ComponentAccess
CustomData
Returns: The new instance with the modified data.
myFabricItemStack.withCustomData(myCustomData);
Parameters:
customData: CustomData
Type: CustomData
Return Type:
ComponentAccess
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);
Parameters:
data: CustomModelData
Type: CustomModelData
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withCustomName(Component.literal("Fancy Water"));
Return Type:
ComponentAccess
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
DebugStickState
Returns: The new instance with the modified data.
myFabricItemStack.withDebugStickState(myDebugStickState);
Parameters:
state: DebugStickState
Type: DebugStickState
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
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
DyedItemColor
Returns: The new instance with the modified data.
myFabricItemStack.withDyedColor(myDyedItemColor);
Parameters:
color: DyedItemColor
Type: DyedItemColor
Return Type:
ComponentAccess
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
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.
myFabricItemStack.withEnchantmentGlintOverride(true);
Parameters:
value: bool
Type: bool
- The value of the override, as described above
Return Type:
ComponentAccess
ItemEnchantments
Returns: The new instance with the modified data.
myFabricItemStack.withEnchantments(myItemEnchantments);
Parameters:
enchantments: ItemEnchantments
Type: ItemEnchantments
Return Type:
ComponentAccess
MapData
Returns: The new instance with the modified data.
myFabricItemStack.withEntityData(myMapData);
Return Type:
ComponentAccess
CustomData
Returns: The new instance with the modified data.
myFabricItemStack.withEntityData(myCustomData);
Parameters:
data: CustomData
Type: CustomData
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withFireResistant();
Return Type:
ComponentAccess
FireworkExplosion
Returns: The new instance with the modified data.
myFabricItemStack.withFireworkExplosion(myFireworkExplosion);
Parameters:
explosion: FireworkExplosion
Type: FireworkExplosion
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
explosions: List<FireworkExplosion>
Type: List<FireworkExplosion>
Return Type:
ComponentAccess
Fireworks
Returns: The new instance with the modified data.
myFabricItemStack.withFireworks(myFireworks);
Return Type:
ComponentAccess
FoodProperties
Returns: The new instance with the modified data.
myFabricItemStack.withFood(myFoodProperties);
Parameters:
food: FoodProperties
Type: FoodProperties
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withHideAdditionalTooltip();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withHideTooltip();
Return Type:
ComponentAccess
Instrument
Returns: The new instance with the modified data.
myFabricItemStack.withInstrument(myInstrument);
Parameters:
instrument: Instrument
Type: Instrument
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withIntangibleProjectile();
Return Type:
ComponentAccess
Component
Returns: The new instance with the modified data.
myFabricItemStack.withItemName(Component.literal("Fancy Water"));
Return Type:
ComponentAccess
myFabricItemStack.withJsonComponent(myDataComponentType, myIData);
Parameters:
type: DataComponentType<T>
Type: DataComponentType<T>
Return Type:
IItemStack
myFabricItemStack.withJsonComponents(myIData);
Return Type:
IItemStack
Returns: The new instance with the modified data.
myFabricItemStack.withLock(myString);
Parameters:
code: string
Type: string
Return Type:
ComponentAccess
LockCode
Returns: The new instance with the modified data.
myFabricItemStack.withLock(myLockCode);
Return Type:
ComponentAccess
LodestoneTracker
Returns: The new instance with the modified data.
myFabricItemStack.withLodestoneTracker(myLodestoneTracker);
Parameters:
tracker: LodestoneTracker
Type: LodestoneTracker
Return Type:
ComponentAccess
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:
Return Type:
ComponentAccess
myFabricItemStack.withLore(myComponent);
Return Type:
ComponentAccess
ItemLore
Returns: The new instance with the modified data.
myFabricItemStack.withLore(myItemLore);
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withMapColor(0xFF0000);
Parameters:
rgb: int
Type: int
- The new map colour
Return Type:
ComponentAccess
MapItemColor
Returns: The new instance with the modified data.
myFabricItemStack.withMapColor(myMapItemColor);
Parameters:
color: MapItemColor
Type: MapItemColor
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
// FabricItemStack.withMapDecorations(decorations as MapDecorationsEntry[string]) as ComponentAccess;myFabricItemStack.withMapDecorations(myMap);
Parameters:
decorations: MapDecorationsEntry[string]
Type: MapDecorationsEntry[string]
Return Type:
ComponentAccess
MapDecorations
Returns: The new instance with the modified data.
myFabricItemStack.withMapDecorations(myMapDecorations);
Parameters:
decorations: MapDecorations
Type: MapDecorations
Return Type:
ComponentAccess
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);
Parameters:
id: int
Type: int
Return Type:
ComponentAccess
MapId
Returns: The new instance with the modified data.
myFabricItemStack.withMapId(myMapId);
Return Type:
ComponentAccess
MapPostProcessing
Returns: The new instance with the modified data.
myFabricItemStack.withMapPostProcessing(myMapPostProcessing);
Parameters:
value: MapPostProcessing
Type: MapPostProcessing
Return Type:
ComponentAccess
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);
Parameters:
maxDamage: int
Type: int
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withMaxStackSize(16);
Parameters:
maxStackSize: int
Type: int
- The new maxStackSize of the ComponentAccess.
Return Type:
ComponentAccess
ResourceLocation
Returns: The new instance with the modified data.
myFabricItemStack.withNoteBlockSound(myResourceLocation);
Parameters:
sound: ResourceLocation
Type: ResourceLocation
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withOminousBottleAmplifier(myInt);
Parameters:
amplifier: int
Type: int
Return Type:
ComponentAccess
myFabricItemStack.without<T>(myDataComponentType);
Parameters:
type: DataComponentType<T>
Type: DataComponentType<T>
Return Type:
IItemStack
Returns: The new instance with the modified data.
myFabricItemStack.withoutAttributeModifiers();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutBannerPatterns();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutBaseColor();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutBees();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutBlockEntityData();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutBlockState();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutBucketEntityData();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutBundleContents();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutCanBreak();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutCanPlaceOn();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutChargedProjectiles();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutContainer();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutContainerLoot();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutCreativeSlotLock();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutCustomData();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutCustomModelData();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutCustomName();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutDamage();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutDebugStickState();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutDyedColor();
Return Type:
ComponentAccess
Enchantment
from the ComponentAccess.Returns: The new instance with the modified data.
myFabricItemStack.withoutEnchantment(<enchantment:minecraft:mending>);
Parameters:
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutEnchantmentGlintOverride();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutEnchantments();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutEntityDate();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutFireResistant();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutFireworkExplosion();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutFireworks();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutFood();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutHideAdditionalTooltip();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutHideTooltip();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutInstrument();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutIntangibleProjectile();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutItemName();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutLock();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutLodestoneTracker();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutLore();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutMapColor();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutMapDecorations();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutMapId();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutMapPostProcessing();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutMaxDamage();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutMaxStackSize();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutNoteBlockSound();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutOminousBottleAmplifier();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutPotDecorations();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutPotionContents();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutProfile();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutRarity();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutRecipes();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutRepairCost();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutStoredEnchantments();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutSuspiciousStewEffects();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutTool();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutTrim();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutUnbreakable();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutWritableBookContent();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withoutWrittenBookContent();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
// FabricItemStack.withPotDecorations(back as ItemDefinition, left as ItemDefinition, right as ItemDefinition, front as ItemDefinition) as ComponentAccess;myFabricItemStack.withPotDecorations(myItem, myItem, myItem, myItem);
Parameters:
back: ItemDefinition
Type: ItemDefinition
left: ItemDefinition
Type: ItemDefinition
right: ItemDefinition
Type: ItemDefinition
front: ItemDefinition
Type: ItemDefinition
Return Type:
ComponentAccess
PotDecorations
Returns: The new instance with the modified data.
myFabricItemStack.withPotDecorations(myPotDecorations);
Parameters:
decorations: PotDecorations
Type: PotDecorations
Return Type:
ComponentAccess
Potion
and no custom effects
Returns: The new instance with the modified data.
myFabricItemStack.withPotionContents(<potion:minecraft:swiftness>);
Return Type:
ComponentAccess
Potion
and the given
MobEffectInstance
effects.Returns: The new instance with the modified data.
// FabricItemStack.withPotionContents(potion as Potion, customEffects as List<MobEffectInstance>) as ComponentAccess;myFabricItemStack.withPotionContents(<potion:minecraft:swiftness>, [MobEffectInstance.of(<mobeffect:minecraft:strength>, 20 * 20, 1, false, false, true)]);
Parameters:
customEffects: List<MobEffectInstance>
Type: List<MobEffectInstance>
- The effects to grant upon consuming this potion.
Return Type:
ComponentAccess
Potion
and the given
MobEffectInstance
effects.Returns: The new instance with the modified data.
// FabricItemStack.withPotionContents(potion as Potion, customColor as int, customEffects as List<MobEffectInstance>) as ComponentAccess;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. customEffects: List<MobEffectInstance>
Type: List<MobEffectInstance>
- The effects to grant upon consuming this potion.
Return Type:
ComponentAccess
PotionContents
Returns: The new instance with the modified data.
myFabricItemStack.withPotionContents(myPotionContents);
Parameters:
contents: PotionContents
Type: PotionContents
Return Type:
ComponentAccess
ResolvableProfile
Returns: The new instance with the modified data.
myFabricItemStack.withProfile(myResolvableProfile);
Parameters:
profile: ResolvableProfile
Type: ResolvableProfile
Return Type:
ComponentAccess
Rarity
Returns: The new instance with the modified data.
myFabricItemStack.withRarity(<constant:minecraft:item/rarity:epic>);
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withRecipes(myList);
Parameters:
recipes: List<ResourceLocation>
Type: List<ResourceLocation>
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withRepairCost(20);
Parameters:
cost: int
Type: int
- The repair cost
Return Type:
ComponentAccess
ItemEnchantments
Returns: The new instance with the modified data.
myFabricItemStack.withStoredEnchantments(myItemEnchantments);
Parameters:
enchantments: ItemEnchantments
Type: ItemEnchantments
Return Type:
ComponentAccess
SuspiciousStewEffects
SuspiciousStewEffects.Entry is effectively a pair of Effect and duration.
Returns: The new instance with the modified data.
// FabricItemStack.withSuspiciousStewEffects(effects as List<SuspiciousStewEffectsEntry>) as ComponentAccess;myFabricItemStack.withSuspiciousStewEffects(myList);
Parameters:
effects: List<SuspiciousStewEffectsEntry>
Type: List<SuspiciousStewEffectsEntry>
- The list of effects to grant on consumption.
Return Type:
ComponentAccess
SuspiciousStewEffects
Returns: The new instance with the modified data.
// FabricItemStack.withSuspiciousStewEffects(suspiciousStewEffects as SuspiciousStewEffects) as ComponentAccess;myFabricItemStack.withSuspiciousStewEffects(mySuspiciousStewEffects);
Parameters:
suspiciousStewEffects: SuspiciousStewEffects
Type: SuspiciousStewEffects
Return Type:
ComponentAccess
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:
Return Type:
ComponentAccess
Tool
Returns: The new instance with the modified data.
myFabricItemStack.withTool(myTool);
Return Type:
ComponentAccess
ArmorTrim
Returns: The new instance with the modified data.
myFabricItemStack.withTrim(myArmorTrim);
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
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
Returns: The new instance with the modified data.
myFabricItemStack.withUnbreakable(myUnbreakable);
Parameters:
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myFabricItemStack.withWritableBookContent(myList);
Parameters:
pages: List<Filterable<string>>
Type: List<Filterable<string>>
Return Type:
ComponentAccess
WritableBookContent
Returns: The new instance with the modified data.
myFabricItemStack.withWritableBookContent(myWritableBookContent);
Parameters:
content: WritableBookContent
Type: WritableBookContent
Return Type:
ComponentAccess
WrittenBookContent
Returns: The new instance with the modified data.
myFabricItemStack.withWrittenBookContent(myWrittenBookContent);
Parameters:
content: WrittenBookContent
Type: WrittenBookContent
Return Type:
ComponentAccess
// FabricItemStack.writableBookContent as WritableBookContentmyFabricItemStack.writableBookContent
Return Type:
WritableBookContent
// FabricItemStack.writtenBookContent as WrittenBookContentmyFabricItemStack.writtenBookContent
Return Type:
WrittenBookContent