MCItemStack
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.MCItemStack;
Implements
MCItemStack
implements the following interfaces:
NeoForgeItemStack
,IItemStack
,IIngredient
,IIngredientWithAmount
,DataComponentHolder
,ComponentAccess<IItemStack>
,CommandStringDisplayable
Undocumented Interfaces
IDataComponentHolderExtension
Operators
myIIngredient in myMCItemStack
Parameters:
Return Type:
bool
// (MCItemStack == (o as Object)) as boolmyMCItemStack == myObject
Parameters:
o: Object
Type: Object
Return Type:
bool
// (MCItemStack * (amount as int)) as IIngredientWithAmountmyMCItemStack * myInt
Parameters:
amount: int
Type: int
Return Type:
IIngredientWithAmount
myMCItemStack | myIIngredient
Parameters:
other: IIngredient
Type: IIngredient
Return Type:
IIngredientList
myMCItemStack % myDouble
Parameters:
percentage: double
Type: double
Return Type:
Percentaged<IItemStack>
// (MCItemStack * (amount as int)) as IItemStackmyMCItemStack * myInt
Parameters:
amount: int
Type: int
- new amount
Return Type:
IItemStack
Members
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
// MCItemStack.addGlobalAttributeModifier(attribute as Attribute, id as ResourceLocation, value as double, operation as AttributeOperation, slotTypes as EquipmentSlot[]);myMCItemStack.addGlobalAttributeModifier(<attribute:minecraft:generic.attack_damage>, myResourceLocation, 10, AttributeOperation.ADDITION, [<constant:minecraft:equipmentslot:chest>]);
Parameters:
value: double
Type: double
- The value of the modifier. // MCItemStack.amount as intmyMCItemStack.amount
Return Type:
int
// MCItemStack.amount as intmyMCItemStack.amount
Return Type:
int
myMCItemStack.applyComponents(myDataComponentMap);
Parameters:
map: DataComponentMap
Type: DataComponentMap
Return Type:
IItemStack
myMCItemStack.applyComponents(myDataComponentPatch);
Parameters:
patch: DataComponentPatch
Type: DataComponentPatch
Return Type:
IItemStack
myMCItemStack.applyComponentsAndValidate(myDataComponentPatch);
Parameters:
patch: DataComponentPatch
Type: DataComponentPatch
Return Type:
IItemStack
myMCItemStack.asIIngredientWithAmount();
Return Type:
IIngredientWithAmount
// MCItemStack as IIngredientWithAmountmyMCItemStack as IIngredientWithAmount
Return Type:
IIngredientWithAmount
// MCItemStack as IIngredientWithAmountmyMCItemStack as IIngredientWithAmount
Return Type:
IIngredientWithAmount
myMCItemStack.asVanillaIngredient();
Return Type:
Ingredient
// MCItemStack as IngredientmyMCItemStack as Ingredient
Return Type:
Ingredient
myMCItemStack as Percentaged<IItemStack>
Return Type:
Percentaged<IItemStack>
// MCItemStack.attributeModifiers as ItemAttributeModifiersmyMCItemStack.attributeModifiers
Return Type:
ItemAttributeModifiers
// MCItemStack.bannerPatterns as BannerPatternLayersmyMCItemStack.bannerPatterns
Return Type:
BannerPatternLayers
// MCItemStack.BASE_ATTACK_DAMAGE_ID as ResourceLocationMCItemStack.BASE_ATTACK_DAMAGE_ID
Return Type:
ResourceLocation
// MCItemStack.BASE_ATTACK_SPEED_ID as ResourceLocationMCItemStack.BASE_ATTACK_SPEED_ID
Return Type:
ResourceLocation
myMCItemStack.bees
Return Type:
List<BeehiveBlockEntityOccupant>
// MCItemStack.blockEntityData as CustomDatamyMCItemStack.blockEntityData
Return Type:
CustomData
// MCItemStack.blockState as BlockItemStatePropertiesmyMCItemStack.blockState
Return Type:
BlockItemStateProperties
// MCItemStack.bucketEntityData as CustomDatamyMCItemStack.bucketEntityData
Return Type:
CustomData
// MCItemStack.bundleContents as BundleContentsmyMCItemStack.bundleContents
Return Type:
BundleContents
// MCItemStack.burnTime as intmyMCItemStack.burnTime
Return Type:
int
// MCItemStack.burnTime = (time as int);myMCItemStack.burnTime = myInt;
Parameters:
time: int
Type: int
- the new burn time // MCItemStack.burnTime(time as int);myMCItemStack.burnTime(500);
Parameters:
time: int
Type: int
- the new burn time // MCItemStack.canBreak as AdventureModePredicatemyMCItemStack.canBreak
Return Type:
AdventureModePredicate
// MCItemStack.canPlaceOn as AdventureModePredicatemyMCItemStack.canPlaceOn
Return Type:
AdventureModePredicate
// MCItemStack.chargedProjectiles as ChargedProjectilesmyMCItemStack.chargedProjectiles
Return Type:
ChargedProjectiles
// MCItemStack.clearTooltip(leaveName as bool = false);myMCItemStack.clearTooltip(myBool);
Parameters:
leaveName: bool
(optional) Type: bool
Default Value: false
// MCItemStack.commandString as stringmyMCItemStack.commandString
Return Type:
string
// MCItemStack.commandString as stringmyMCItemStack.commandString
Return Type:
string
// MCItemStack.commandString() as string;myMCItemStack.commandString();
Return Type:
string
// MCItemStack.componentsPatch as DataComponentPatchmyMCItemStack.componentsPatch
Return Type:
DataComponentPatch
myMCItemStack.condition(myIIngredientCondition);
Parameters:
condition: IIngredientCondition
Type: IIngredientCondition
Return Type:
IIngredient
// MCItemStack.container as ItemContainerContentsmyMCItemStack.container
Return Type:
ItemContainerContents
// MCItemStack.containerLoot as SeededContainerLootmyMCItemStack.containerLoot
Return Type:
SeededContainerLoot
myMCItemStack.contains((<item:minecraft:iron_ingot> | <item:minecraft:gold_ingot>));
Parameters:
Return Type:
bool
// MCItemStack.CRAFTTWEAKER_DATA_KEY as stringMCItemStack.CRAFTTWEAKER_DATA_KEY
Return Type:
string
// MCItemStack.creativeSlotLock as boolmyMCItemStack.creativeSlotLock
Return Type:
bool
// MCItemStack.customData as CustomDatamyMCItemStack.customData
Return Type:
CustomData
// MCItemStack.customModelData as CustomModelDatamyMCItemStack.customModelData
Return Type:
CustomModelData
// MCItemStack.damage as intmyMCItemStack.damage
Return Type:
int
// MCItemStack.damageableItem as boolmyMCItemStack.damageableItem
Return Type:
bool
// MCItemStack.damaged as boolmyMCItemStack.damaged
Return Type:
bool
// MCItemStack.debugStickState as DebugStickStatemyMCItemStack.debugStickState
Return Type:
DebugStickState
// MCItemStack.definition as ItemDefinitionmyMCItemStack.definition
Return Type:
ItemDefinition
// MCItemStack as ItemDefinitionmyMCItemStack as Item
Return Type:
ItemDefinition
// MCItemStack.descriptionId as stringmyMCItemStack.descriptionId
Return Type:
string
// MCItemStack.dyedColor as DyedItemColormyMCItemStack.dyedColor
Return Type:
DyedItemColor
// MCItemStack.empty as boolmyMCItemStack.empty
Return Type:
bool
Returns: true if empty, false otherwise
// MCItemStack.empty() as bool;myMCItemStack.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.
// MCItemStack.enchantmentGlintOverride as boolmyMCItemStack.enchantmentGlintOverride
Return Type:
bool
// MCItemStack.enchantments as ItemEnchantmentsmyMCItemStack.enchantments
Return Type:
ItemEnchantments
// MCItemStack.entityData as CustomDatamyMCItemStack.entityData
Return Type:
CustomData
// MCItemStack.fireworkExplosion as FireworkExplosionmyMCItemStack.fireworkExplosion
Return Type:
FireworkExplosion
// MCItemStack.food as FoodPropertiesmyMCItemStack.food
Return Type:
FoodProperties
Returns: A Map of Attribute to a List of AttributeModifier for the given EquipmentSlot.
myMCItemStack.getAttributes(<constant:minecraft:equipmentslot:chest>);
Parameters:
Return Type:
List<AttributeModifier>[Attribute]
myMCItemStack.getBurnTime(myIRecipeManager);
Parameters:
manager: IRecipeManager<Recipe>
Type: IRecipeManager<Recipe>
Return Type:
int
myMCItemStack.getRemainingItem(<item:minecraft:iron_ingot>);
Parameters:
Return Type:
IItemStack
Returns: use duration
myMCItemStack.getUseDuration(entity);
Parameters:
entity: LivingEntity
Type: LivingEntity
Return Type:
int
Returns: This IItemStack if mutable, a new one with the new amount otherwise.
myMCItemStack.grow(2);
Parameters:
amount: int
(optional) Type: int
- The amount to grow by.
Default Value: 1
Return Type:
IItemStack
// MCItemStack.hasAttributeModifiers as boolmyMCItemStack.hasAttributeModifiers
Return Type:
bool
// MCItemStack.hasBannerPatterns as boolmyMCItemStack.hasBannerPatterns
Return Type:
bool
Used for shield colouring.
// MCItemStack.hasBaseColor as boolmyMCItemStack.hasBaseColor
Return Type:
bool
// MCItemStack.hasBees as boolmyMCItemStack.hasBees
Return Type:
bool
// MCItemStack.hasBlockEntityData as boolmyMCItemStack.hasBlockEntityData
Return Type:
bool
// MCItemStack.hasBlockState as boolmyMCItemStack.hasBlockState
Return Type:
bool
// MCItemStack.hasBucketEntityData as boolmyMCItemStack.hasBucketEntityData
Return Type:
bool
// MCItemStack.hasBundleContents as boolmyMCItemStack.hasBundleContents
Return Type:
bool
// MCItemStack.hasCanBreak as boolmyMCItemStack.hasCanBreak
Return Type:
bool
// MCItemStack.hasCanPlaceOn as boolmyMCItemStack.hasCanPlaceOn
Return Type:
bool
This component is used for crossbows.
// MCItemStack.hasChargedProjectiles as boolmyMCItemStack.hasChargedProjectiles
Return Type:
bool
// MCItemStack.hasContainer as boolmyMCItemStack.hasContainer
Return Type:
bool
// MCItemStack.hasContainerLoot as boolmyMCItemStack.hasContainerLoot
Return Type:
bool
// MCItemStack.hasCustomData as boolmyMCItemStack.hasCustomData
Return Type:
bool
// MCItemStack.hasCustomModelData as boolmyMCItemStack.hasCustomModelData
Return Type:
bool
// MCItemStack.hasCustomName as boolmyMCItemStack.hasCustomName
Return Type:
bool
// MCItemStack.hasDamage as boolmyMCItemStack.hasDamage
Return Type:
bool
// MCItemStack.hasDebugStickState as boolmyMCItemStack.hasDebugStickState
Return Type:
bool
// MCItemStack.hasDyedColor as boolmyMCItemStack.hasDyedColor
Return Type:
bool
// MCItemStack.hasEnchantmentGlintOverride as boolmyMCItemStack.hasEnchantmentGlintOverride
Return Type:
bool
// MCItemStack.hasEnchantments as boolmyMCItemStack.hasEnchantments
Return Type:
bool
// MCItemStack.hasEntityData as boolmyMCItemStack.hasEntityData
Return Type:
bool
// MCItemStack.hasFireworkExplosion as boolmyMCItemStack.hasFireworkExplosion
Return Type:
bool
// MCItemStack.hasFireworks as boolmyMCItemStack.hasFireworks
Return Type:
bool
Foil is the glint / effect that is added to enchanted ItemStacks (and other items).
// MCItemStack.hasFoil as boolmyMCItemStack.hasFoil
Return Type:
bool
// MCItemStack.hasFood as boolmyMCItemStack.hasFood
Return Type:
bool
// MCItemStack.hasInstrument as boolmyMCItemStack.hasInstrument
Return Type:
bool
// MCItemStack.hasItemName as boolmyMCItemStack.hasItemName
Return Type:
bool
// MCItemStack.hasLock as boolmyMCItemStack.hasLock
Return Type:
bool
// MCItemStack.hasLodestoneTracker as boolmyMCItemStack.hasLodestoneTracker
Return Type:
bool
// MCItemStack.hasLore as boolmyMCItemStack.hasLore
Return Type:
bool
// MCItemStack.hasMapColor as boolmyMCItemStack.hasMapColor
Return Type:
bool
MapDecorations are additional elements that render on a map, such as waypoints.
// MCItemStack.hasMapDecorations as boolmyMCItemStack.hasMapDecorations
Return Type:
bool
// MCItemStack.hasMapId as boolmyMCItemStack.hasMapId
Return Type:
bool
This componenet stores additional info on the map, such as the scale or whether to lock it.
// MCItemStack.hasMapPostProcessing as boolmyMCItemStack.hasMapPostProcessing
Return Type:
bool
// MCItemStack.hasMaxDamage as boolmyMCItemStack.hasMaxDamage
Return Type:
bool
// MCItemStack.hasMaxStackSize as boolmyMCItemStack.hasMaxStackSize
Return Type:
bool
// MCItemStack.hasNoteBlockSound as boolmyMCItemStack.hasNoteBlockSound
Return Type:
bool
// MCItemStack.hasOminousBottleAmplifier as boolmyMCItemStack.hasOminousBottleAmplifier
Return Type:
bool
// MCItemStack.hasPotDecorations as boolmyMCItemStack.hasPotDecorations
Return Type:
bool
Stores Potion Data on an item.
// MCItemStack.hasPotionContents as boolmyMCItemStack.hasPotionContents
Return Type:
bool
// MCItemStack.hasProfile as boolmyMCItemStack.hasProfile
Return Type:
bool
// MCItemStack.hasRarity as boolmyMCItemStack.hasRarity
Return Type:
bool
Used for Knowledge Books.
// MCItemStack.hasRecipes as boolmyMCItemStack.hasRecipes
Return Type:
bool
// MCItemStack.hasRepairCost as boolmyMCItemStack.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.
// MCItemStack.hasStoredEnchantments as boolmyMCItemStack.hasStoredEnchantments
Return Type:
bool
// MCItemStack.hasSuspiciousStewEffects as boolmyMCItemStack.hasSuspiciousStewEffects
Return Type:
bool
// MCItemStack.hasTool as boolmyMCItemStack.hasTool
Return Type:
bool
// MCItemStack.hasTrim as boolmyMCItemStack.hasTrim
Return Type:
bool
// MCItemStack.hasUnbreakable as boolmyMCItemStack.hasUnbreakable
Return Type:
bool
// MCItemStack.hasWritableBookContent as boolmyMCItemStack.hasWritableBookContent
Return Type:
bool
// MCItemStack.hasWrittenBookContent as boolmyMCItemStack.hasWrittenBookContent
Return Type:
bool
// MCItemStack.hideAdditionalTooltip as boolmyMCItemStack.hideAdditionalTooltip
Return Type:
bool
// MCItemStack.hideTooltip as boolmyMCItemStack.hideTooltip
Return Type:
bool
// MCItemStack.ingredient as IIngredientmyMCItemStack.ingredient
Return Type:
IIngredient
// MCItemStack.instrument as InstrumentmyMCItemStack.instrument
Return Type:
Instrument
// MCItemStack.isEnchantable as boolmyMCItemStack.isEnchantable
Return Type:
bool
// MCItemStack.isFireResistant as boolmyMCItemStack.isFireResistant
Return Type:
bool
// MCItemStack.isIntangibleProjectile as boolmyMCItemStack.isIntangibleProjectile
Return Type:
bool
// MCItemStack.isMutable as boolmyMCItemStack.isMutable
Return Type:
bool
// MCItemStack.isMutable() as bool;myMCItemStack.isMutable();
Return Type:
bool
// MCItemStack.lodestoneTracker as LodestoneTrackermyMCItemStack.lodestoneTracker
Return Type:
LodestoneTracker
// MCItemStack.mapColor as MapItemColormyMCItemStack.mapColor
Return Type:
MapItemColor
// MCItemStack.mapDecorations as MapDecorationsmyMCItemStack.mapDecorations
Return Type:
MapDecorations
// MCItemStack.mapPostProcessing as MapPostProcessingmyMCItemStack.mapPostProcessing
Return Type:
MapPostProcessing
myMCItemStack.matches(<item:minecraft:iron_ingot>);
Parameters:
Return Type:
bool
// MCItemStack.maxDamage as intmyMCItemStack.maxDamage
Return Type:
int
// MCItemStack.maxDamage as intmyMCItemStack.maxDamage
Return Type:
int
// MCItemStack.maxStackSize as intmyMCItemStack.maxStackSize
Return Type:
int
// MCItemStack.modifyShiftTooltip(shiftedFunction as ITooltipFunction, unshiftedFunction as ITooltipFunction = null);myMCItemStack.modifyShiftTooltip(myITooltipFunction, myITooltipFunction);
Parameters:
shiftedFunction: ITooltipFunction
Type: ITooltipFunction
myMCItemStack.modifyTooltip(myITooltipFunction);
Parameters:
function: ITooltipFunction
Type: ITooltipFunction
myMCItemStack.mul(myInt);
Parameters:
amount: int
Type: int
Return Type:
IIngredientWithAmount
// MCItemStack.noteBlockSound as ResourceLocationmyMCItemStack.noteBlockSound
Return Type:
ResourceLocation
// MCItemStack.ominousBottleAmplifier as intmyMCItemStack.ominousBottleAmplifier
Return Type:
int
myMCItemStack.onlyDamagedAtLeast(myInt);
Parameters:
minDamage: int
Type: int
Return Type:
IIngredient
myMCItemStack.onlyDamagedAtMost(myInt);
Parameters:
maxDamage: int
Type: int
Return Type:
IIngredient
// MCItemStack.onlyIf(uid as string, function as function(t as IItemStack) as bool = null) as IIngredient;myMCItemStack.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
// MCItemStack.owner as stringmyMCItemStack.owner
Return Type:
string
myMCItemStack.percent(myDouble);
Parameters:
percentage: double
Type: double
Return Type:
Percentaged<IItemStack>
// MCItemStack.potDecorations as PotDecorationsmyMCItemStack.potDecorations
Return Type:
PotDecorations
// MCItemStack.potionContents as PotionContentsmyMCItemStack.potionContents
Return Type:
PotionContents
// MCItemStack.profile as ResolvableProfilemyMCItemStack.profile
Return Type:
ResolvableProfile
// MCItemStack.prototype as DataComponentMapmyMCItemStack.prototype
Return Type:
DataComponentMap
myMCItemStack.recipes
Return Type:
List<ResourceLocation>
// MCItemStack.registryName as ResourceLocationmyMCItemStack.registryName
Return Type:
ResourceLocation
myMCItemStack.remove<T>(myDataComponentType);
Parameters:
type: DataComponentType<T>
Type: DataComponentType<T>
Return Type:
IItemStack
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.
myMCItemStack.removeGlobalAttribute(<attribute:minecraft:generic.attack_damage>, [<constant:minecraft:equipmentslot:chest>]);
Parameters:
myMCItemStack.removeGlobalAttributeModifier("8c1b5535-9f79-448b-87ae-52d81480aaa3", [<constant:minecraft:equipmentslot:chest>]);
Parameters:
uuid: string
Type: string
- The unique id of the AttributeModifier to remove. myMCItemStack.removeGlobalAttributeModifier(IItemStack.BASE_ATTACK_DAMAGE_UUID, [<constant:minecraft:equipmentslot:chest>]);
Parameters:
uuid: UUID
Type: UUID
- The unique id of the AttributeModifier to remove. // MCItemStack.removeTooltip(regex as string);myMCItemStack.removeTooltip(myString);
Parameters:
regex: string
Type: string
// MCItemStack.repairCost as intmyMCItemStack.repairCost
Return Type:
int
myMCItemStack.setBurnTime(500, myIRecipeManager);
Parameters:
time: int
Type: int
- the new burn time manager: IRecipeManager<Recipe>
Type: IRecipeManager<Recipe>
Returns: This IItemStack if mutable, a new one with the new amount otherwise.
myMCItemStack.shrink(2);
Parameters:
amount: int
(optional) Type: int
- The amount to shrink by.
Default Value: 1
Return Type:
IItemStack
// MCItemStack.stackable as boolmyMCItemStack.stackable
Return Type:
bool
// MCItemStack.storedEnchantments as ItemEnchantmentsmyMCItemStack.storedEnchantments
Return Type:
ItemEnchantments
// MCItemStack.suspiciousStewEffects as SuspiciousStewEffectsmyMCItemStack.suspiciousStewEffects
Return Type:
SuspiciousStewEffects
// MCItemStack.transformCustom(uid as string, function as function(r as IItemStack) as IItemStack = null) as IIngredient;myMCItemStack.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
myMCItemStack.transformDamage(myInt);
Parameters:
amount: int
(optional) Type: int
Default Value: 1
Return Type:
IIngredient
myMCItemStack.transformReplace(myIItemStack);
Parameters:
replaceWith: IItemStack
Type: IItemStack
Return Type:
IIngredient
// MCItemStack.unbreakable as UnbreakablemyMCItemStack.unbreakable
Return Type:
Unbreakable
// MCItemStack.update<T, U>(type as DataComponentType<T>, defaultValue as T, data as U, operator as BiFunction<T, T, U>) as IItemStack;myMCItemStack.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
// MCItemStack.update<T>(type as DataComponentType<T>, defaultValue as T, operator as UnaryOperator<T>) as IItemStack;myMCItemStack.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
// MCItemStack.useOnRelease as boolmyMCItemStack.useOnRelease
Return Type:
bool
myMCItemStack.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.
myMCItemStack.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.
// MCItemStack.withAttributeModifiers(modifier as ItemAttributeModifiersEntry, showInTooltip as bool = true) as ComponentAccess;myMCItemStack.withAttributeModifiers(myEntry, myBool);
Parameters:
modifier: ItemAttributeModifiersEntry
Type: ItemAttributeModifiersEntry
showInTooltip: bool
(optional) Type: bool
Default Value: true
Return Type:
ComponentAccess
// MCItemStack.withAttributeModifiers(modifiers as List<ItemAttributeModifiersEntry>, showInTooltip as bool = true) as ComponentAccess;myMCItemStack.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.
myMCItemStack.withBannerPatterns(myList);
Parameters:
layers: List<BannerPatternLayersLayer>
Type: List<BannerPatternLayersLayer>
Return Type:
ComponentAccess
BannerPatternLayers
Returns: The new instance with the modified data.
myMCItemStack.withBannerPatterns(myBannerPatternLayers);
Parameters:
layers: BannerPatternLayers
Type: BannerPatternLayers
Return Type:
ComponentAccess
DyeColor
Returns: The new instance with the modified data.
myMCItemStack.withBaseColor(myDyeColor);
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withBees(myList);
Parameters:
occupants: List<BeehiveBlockEntityOccupant>
Type: List<BeehiveBlockEntityOccupant>
Return Type:
ComponentAccess
MapData
Returns: The new instance with the modified data.
myMCItemStack.withBlockEntityData(myMapData);
Return Type:
ComponentAccess
CustomData
Returns: The new instance with the modified data.
myMCItemStack.withBlockEntityData(myCustomData);
Parameters:
data: CustomData
Type: CustomData
Return Type:
ComponentAccess
BlockItemStateProperties
Returns: The new instance with the modified data.
myMCItemStack.withBlockState(myBlockItemStateProperties);
Parameters:
properties: BlockItemStateProperties
Type: BlockItemStateProperties
Return Type:
ComponentAccess
MapData
Returns: The new instance with the modified data.
myMCItemStack.withBucketEntityData(myMapData);
Return Type:
ComponentAccess
CustomData
Returns: The new instance with the modified data.
myMCItemStack.withBucketEntityData(myCustomData);
Parameters:
data: CustomData
Type: CustomData
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withBundleContents([<item:minecraft:diamond> * 64]);
Parameters:
Return Type:
ComponentAccess
BundleContents
Returns: The new instance with the modified data.
myMCItemStack.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.
// MCItemStack.withCanBreak(predicates as List<BlockPredicate>, showInTooltip as bool = true) as ComponentAccess;myMCItemStack.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.
myMCItemStack.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.
// MCItemStack.withCanPlaceOn(predicates as List<BlockPredicate>, showInTooltip as bool = true) as ComponentAccess;myMCItemStack.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.
myMCItemStack.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.
myMCItemStack.withChargedProjectiles(<item:minecraft:arrow>);
Parameters:
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withChargedProjectiles([<item:minecraft:arrow>]);
Parameters:
Return Type:
ComponentAccess
ChargedProjectiles
Returns: The new instance with the modified data.
myMCItemStack.withChargedProjectiles(myChargedProjectiles);
Parameters:
chargedProjectiles: ChargedProjectiles
Type: ChargedProjectiles
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withContainer(myList);
Parameters:
contents: List<IItemStack>
Type: List<IItemStack>
Return Type:
ComponentAccess
ItemContainerContents
Returns: The new instance with the modified data.
myMCItemStack.withContainer(myItemContainerContents);
Parameters:
contents: ItemContainerContents
Type: ItemContainerContents
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
// MCItemStack.withContainerLoot(lootTable as ResourceKey<LootTable>, seed as long) as ComponentAccess;myMCItemStack.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.
myMCItemStack.withContainerLoot(mySeededContainerLoot);
Parameters:
loot: SeededContainerLoot
Type: SeededContainerLoot
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withCreativeSlotLock();
Return Type:
ComponentAccess
MapData
Returns: The new instance with the modified data.
myMCItemStack.withCustomData({custom_ammo_thing: 1, owner: "Benji"});
Return Type:
ComponentAccess
CustomData
Returns: The new instance with the modified data.
myMCItemStack.withCustomData(myCustomData);
Parameters:
customData: CustomData
Type: CustomData
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.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.
myMCItemStack.withCustomModelData(myCustomModelData);
Parameters:
data: CustomModelData
Type: CustomModelData
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withCustomName(Component.literal("Fancy Water"));
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.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.
myMCItemStack.withDebugStickState(myDebugStickState);
Parameters:
state: DebugStickState
Type: DebugStickState
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.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.
myMCItemStack.withDyedColor(myDyedItemColor);
Parameters:
color: DyedItemColor
Type: DyedItemColor
Return Type:
ComponentAccess
Enchantment
and level.Returns: The new instance with the modified data.
myMCItemStack.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.
myMCItemStack.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.
myMCItemStack.withEnchantments(myItemEnchantments);
Parameters:
enchantments: ItemEnchantments
Type: ItemEnchantments
Return Type:
ComponentAccess
MapData
Returns: The new instance with the modified data.
myMCItemStack.withEntityData(myMapData);
Return Type:
ComponentAccess
CustomData
Returns: The new instance with the modified data.
myMCItemStack.withEntityData(myCustomData);
Parameters:
data: CustomData
Type: CustomData
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withFireResistant();
Return Type:
ComponentAccess
FireworkExplosion
Returns: The new instance with the modified data.
myMCItemStack.withFireworkExplosion(myFireworkExplosion);
Parameters:
explosion: FireworkExplosion
Type: FireworkExplosion
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
// MCItemStack.withFireworks(flightDuration as int, explosions as List<FireworkExplosion>) as ComponentAccess;myMCItemStack.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.
myMCItemStack.withFireworks(myFireworks);
Return Type:
ComponentAccess
FoodProperties
Returns: The new instance with the modified data.
myMCItemStack.withFood(myFoodProperties);
Parameters:
food: FoodProperties
Type: FoodProperties
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withHideAdditionalTooltip();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withHideTooltip();
Return Type:
ComponentAccess
Instrument
Returns: The new instance with the modified data.
myMCItemStack.withInstrument(myInstrument);
Parameters:
instrument: Instrument
Type: Instrument
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withIntangibleProjectile();
Return Type:
ComponentAccess
Component
Returns: The new instance with the modified data.
myMCItemStack.withItemName(Component.literal("Fancy Water"));
Return Type:
ComponentAccess
myMCItemStack.withJsonComponent(myDataComponentType, myIData);
Parameters:
type: DataComponentType<T>
Type: DataComponentType<T>
Return Type:
IItemStack
myMCItemStack.withJsonComponents(myIData);
Return Type:
IItemStack
Returns: The new instance with the modified data.
myMCItemStack.withLock(myString);
Parameters:
code: string
Type: string
Return Type:
ComponentAccess
LockCode
Returns: The new instance with the modified data.
myMCItemStack.withLock(myLockCode);
Return Type:
ComponentAccess
LodestoneTracker
Returns: The new instance with the modified data.
myMCItemStack.withLodestoneTracker(myLodestoneTracker);
Parameters:
tracker: LodestoneTracker
Type: LodestoneTracker
Return Type:
ComponentAccess
Component
>Returns: The new instance with the modified data.
myMCItemStack.withLore([Component.literal("Found in a dark cave"), Component.translatable("Belonged to a Dragon")]);
Parameters:
Return Type:
ComponentAccess
ItemLore
Returns: The new instance with the modified data.
myMCItemStack.withLore(myItemLore);
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withMapColor(0xFF0000);
Parameters:
rgb: int
Type: int
- The new map colour
Return Type:
ComponentAccess
MapItemColor
Returns: The new instance with the modified data.
myMCItemStack.withMapColor(myMapItemColor);
Parameters:
color: MapItemColor
Type: MapItemColor
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withMapDecorations(myMap);
Parameters:
decorations: MapDecorationsEntry[string]
Type: MapDecorationsEntry[string]
Return Type:
ComponentAccess
MapDecorations
Returns: The new instance with the modified data.
myMCItemStack.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.
myMCItemStack.withMapId(myInt);
Parameters:
id: int
Type: int
Return Type:
ComponentAccess
MapId
Returns: The new instance with the modified data.
myMCItemStack.withMapId(myMapId);
Return Type:
ComponentAccess
MapPostProcessing
Returns: The new instance with the modified data.
myMCItemStack.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.
myMCItemStack.withMaxDamage(1024);
Parameters:
maxDamage: int
Type: int
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.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.
myMCItemStack.withNoteBlockSound(myResourceLocation);
Parameters:
sound: ResourceLocation
Type: ResourceLocation
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withOminousBottleAmplifier(myInt);
Parameters:
amplifier: int
Type: int
Return Type:
ComponentAccess
myMCItemStack.without<T>(myDataComponentType);
Parameters:
type: DataComponentType<T>
Type: DataComponentType<T>
Return Type:
IItemStack
Returns: The new instance with the modified data.
myMCItemStack.withoutAttributeModifiers();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutBannerPatterns();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutBaseColor();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutBees();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutBlockEntityData();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutBlockState();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutBucketEntityData();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutBundleContents();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutCanBreak();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutCanPlaceOn();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutChargedProjectiles();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutContainer();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutContainerLoot();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutCreativeSlotLock();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutCustomData();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutCustomModelData();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutCustomName();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutDamage();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutDebugStickState();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutDyedColor();
Return Type:
ComponentAccess
Enchantment
from the ComponentAccess.Returns: The new instance with the modified data.
myMCItemStack.withoutEnchantment(<enchantment:minecraft:mending>);
Parameters:
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutEnchantmentGlintOverride();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutEnchantments();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutEntityDate();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutFireResistant();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutFireworkExplosion();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutFireworks();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutFood();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutHideAdditionalTooltip();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutHideTooltip();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutInstrument();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutIntangibleProjectile();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutItemName();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutLock();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutLodestoneTracker();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutLore();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutMapColor();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutMapDecorations();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutMapId();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutMapPostProcessing();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutMaxDamage();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutMaxStackSize();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutNoteBlockSound();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutOminousBottleAmplifier();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutPotDecorations();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutPotionContents();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutProfile();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutRarity();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutRecipes();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutRepairCost();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutStoredEnchantments();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutSuspiciousStewEffects();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutTool();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutTrim();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutUnbreakable();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutWritableBookContent();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withoutWrittenBookContent();
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
// MCItemStack.withPotDecorations(back as ItemDefinition, left as ItemDefinition, right as ItemDefinition, front as ItemDefinition) as ComponentAccess;myMCItemStack.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.
myMCItemStack.withPotDecorations(myPotDecorations);
Parameters:
decorations: PotDecorations
Type: PotDecorations
Return Type:
ComponentAccess
Potion
and no custom effects
Returns: The new instance with the modified data.
myMCItemStack.withPotionContents(<potion:minecraft:swiftness>);
Return Type:
ComponentAccess
Potion
and the given
MobEffectInstance
effects.Returns: The new instance with the modified data.
// MCItemStack.withPotionContents(potion as Potion, customEffects as List<MobEffectInstance>) as ComponentAccess;myMCItemStack.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.
// MCItemStack.withPotionContents(potion as Potion, customColor as int, customEffects as List<MobEffectInstance>) as ComponentAccess;myMCItemStack.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.
myMCItemStack.withPotionContents(myPotionContents);
Parameters:
contents: PotionContents
Type: PotionContents
Return Type:
ComponentAccess
ResolvableProfile
Returns: The new instance with the modified data.
myMCItemStack.withProfile(myResolvableProfile);
Parameters:
profile: ResolvableProfile
Type: ResolvableProfile
Return Type:
ComponentAccess
Rarity
Returns: The new instance with the modified data.
myMCItemStack.withRarity(<constant:minecraft:item/rarity:epic>);
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withRecipes(myList);
Parameters:
recipes: List<ResourceLocation>
Type: List<ResourceLocation>
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withRepairCost(20);
Parameters:
cost: int
Type: int
- The repair cost
Return Type:
ComponentAccess
ItemEnchantments
Returns: The new instance with the modified data.
myMCItemStack.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.
// MCItemStack.withSuspiciousStewEffects(effects as List<SuspiciousStewEffectsEntry>) as ComponentAccess;myMCItemStack.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.
// MCItemStack.withSuspiciousStewEffects(suspiciousStewEffects as SuspiciousStewEffects) as ComponentAccess;myMCItemStack.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.
// MCItemStack.withTool(rules as List<ToolRule>, defaultMiningSpeed as float, damagePerBlock as int) as ComponentAccess;myMCItemStack.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.
myMCItemStack.withTool(myTool);
Return Type:
ComponentAccess
ArmorTrim
Returns: The new instance with the modified data.
myMCItemStack.withTrim(myArmorTrim);
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.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.
myMCItemStack.withUnbreakable(myUnbreakable);
Parameters:
Return Type:
ComponentAccess
Returns: The new instance with the modified data.
myMCItemStack.withWritableBookContent(myList);
Parameters:
pages: List<Filterable<string>>
Type: List<Filterable<string>>
Return Type:
ComponentAccess
WritableBookContent
Returns: The new instance with the modified data.
myMCItemStack.withWritableBookContent(myWritableBookContent);
Parameters:
content: WritableBookContent
Type: WritableBookContent
Return Type:
ComponentAccess
WrittenBookContent
Returns: The new instance with the modified data.
myMCItemStack.withWrittenBookContent(myWrittenBookContent);
Parameters:
content: WrittenBookContent
Type: WrittenBookContent
Return Type:
ComponentAccess
// MCItemStack.writableBookContent as WritableBookContentmyMCItemStack.writableBookContent
Return Type:
WritableBookContent
// MCItemStack.writtenBookContent as WrittenBookContentmyMCItemStack.writtenBookContent
Return Type:
WrittenBookContent