ComponentAccess<T : ComponentAccess

Link to componentaccesst--componentaccesst

An interface exposing methods to handle setting and removing DataComponents.

DataComponents are the new way of storing data in memory, instead of writing it to NBT data and to disk every time, which has a performance cost. DataComponents now occupy the space that was previously occupied or known as a NBT tag.

DataComponents are immutable. Operations that set or remove a component return a new instance of the object implementing ComponentAccess<T>

DataComponents may optionally be persistent. They also may optionally be syncronised.

In most cases, ComponentAccesses are going to be ItemStacks, although in NeoForge FluidStacks are too.

Importing the class

Link to importing-the-class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

ZenScript
Copy
import crafttweaker.api.component.ComponentAccess;

Link to withAttributeModifiers

Name: withAttributeModifiers

Sets the <componenttype:minecraft:attribute_modifiers> of the ComponentAccess to have the given ItemAttributeModifiers

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withAttributeModifiers(modifiers as ItemAttributeModifiers) as T

myComponentAccess.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(););
ParameterTypeDescription
Parameter
modifiers
Type
ItemAttributeModifiers
Description
The attributes to give to the item.

Link to withAttributeModifiers

Name: withAttributeModifiers

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withAttributeModifiers(modifier as ItemAttributeModifiersEntry, showInTooltip as boolean) as T
ParameterTypeOptionalDefault Value
Parameter
modifier
Type
ItemAttributeModifiersEntry
Optional
false
Default Value
Parameter
showInTooltip
Type
boolean
Optional
true
Default Value
true

Link to withAttributeModifiers

Name: withAttributeModifiers

Return Type: T

ZenScript
Copy
ComponentAccess.withAttributeModifiers(modifiers as stdlib.List<ItemAttributeModifiersEntry>, showInTooltip as boolean) as T
ParameterTypeOptionalDefault Value
Parameter
modifiers
Type
stdlib.List<ItemAttributeModifiersEntry>
Optional
false
Default Value
Parameter
showInTooltip
Type
boolean
Optional
true
Default Value
true

Link to withBannerPatterns

Name: withBannerPatterns

Sets the <componenttype:minecraft:banner_patterns> of the ComponentAccess to have the given BannerPatternLayers

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withBannerPatterns(layers as BannerPatternLayers) as T
ParameterType
Parameter
layers
Type
BannerPatternLayers

Link to withBannerPatterns

Name: withBannerPatterns

Sets the <componenttype:minecraft:banner_patterns> of the ComponentAccess to have the given stdlib.List<BannerPatternLayersLayer>

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withBannerPatterns(layers as stdlib.List<BannerPatternLayersLayer>) as T
ParameterType
Parameter
layers
Type
stdlib.List<BannerPatternLayersLayer>

Name: withBaseColor

Sets the <componenttype:minecraft:base_color> of the ComponentAccess to have the given DyeColor

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withBaseColor(color as DyeColor) as T
ParameterType
Parameter
color
Type
DyeColor

Name: withBees

Sets the <componenttype:minecraft:bees> of the ComponentAccess to have the given occupants

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withBees(occupants as stdlib.List<BeehiveBlockEntityOccupant>) as T
ParameterType
Parameter
occupants
Type
stdlib.List<BeehiveBlockEntityOccupant>

Link to withBlockEntityData

Name: withBlockEntityData

Sets the <componenttype:minecraft:block_entity_data> of the ComponentAccess to have the given CustomData

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withBlockEntityData(data as CustomData) as T
ParameterType
Parameter
data
Type
CustomData

Link to withBlockEntityData

Name: withBlockEntityData

Sets the <componenttype:minecraft:block_entity_data> of the ComponentAccess to have the given MapData

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withBlockEntityData(data as MapData) as T
ParameterType
Parameter
data
Type
MapData

Name: withBlockState

Sets the <componenttype:minecraft:block_state> of the ComponentAccess to have the given BlockItemStateProperties

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withBlockState(properties as BlockItemStateProperties) as T
ParameterType
Parameter
properties
Type
BlockItemStateProperties

Link to withBucketEntityData

Name: withBucketEntityData

Sets the <componenttype:minecraft:bucket_entity_data> of the ComponentAccess to have the given CustomData

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withBucketEntityData(data as CustomData) as T
ParameterType
Parameter
data
Type
CustomData

Link to withBucketEntityData

Name: withBucketEntityData

Sets the <componenttype:minecraft:bucket_entity_data> of the ComponentAccess to have the given MapData

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withBucketEntityData(data as MapData) as T
ParameterType
Parameter
data
Type
MapData

Link to withBundleContents

Name: withBundleContents

Sets the <componenttype:minecraft:bundle_contents> of the ComponentAccess to have the given BundleContents

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withBundleContents(contents as BundleContents) as T
ParameterType
Parameter
contents
Type
BundleContents

Link to withBundleContents

Name: withBundleContents

Sets the <componenttype:minecraft:bundle_contents> of the ComponentAccess to have the given contents

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withBundleContents(contents as stdlib.List<IItemStack>) as T

myComponentAccess.withBundleContents([<item:minecraft:diamond> * 64]);
ParameterTypeDescription
Parameter
contents
Type
stdlib.List<IItemStack>
Description
A list of items to store within.

Name: withCanBreak

Sets the <componenttype:minecraft:can_break> of the ComponentAccess to have the given AdventureModePredicate

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withCanBreak(predicate as AdventureModePredicate) as T
ParameterTypeDescription
Parameter
predicate
Type
AdventureModePredicate
Description
The adventure mode predicate to use to determine whether the item can be used to break a block.

Name: withCanBreak

Sets the <componenttype:minecraft:can_break> with the given BlockPredicates.

Any predicate that matches will allow the Block to be broken by this ItemStack.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withCanBreak(predicates as stdlib.List<BlockPredicate>, showInTooltip as boolean) as T

myComponentAccess.withCanBreak(BlockPredicate.create().of(<block:minecraft:diamond_ore>).build(), true);
ParameterTypeDescriptionOptionalDefault Value
Parameter
predicates
Type
stdlib.List<BlockPredicate>
Description
The collection of predicates to test for
Optional
false
Default Value
Parameter
showInTooltip
Type
boolean
Description
Whether to show the ability in the tooltip or not.
Optional
true
Default Value
true

Name: withCanPlaceOn

Sets the <componenttype:minecraft:can_place_on> of the ComponentAccess to have the given AdventureModePredicate

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withCanPlaceOn(predicate as AdventureModePredicate) as T
ParameterTypeDescription
Parameter
predicate
Type
AdventureModePredicate
Description
The adventure mode predicate to use to determine whether the current block can be placed on another block.

Name: withCanPlaceOn

Sets the <componenttype:minecraft:can_place_on> with the given BlockPredicates.

Any predicate that matches will allow the BlockItem within the ItemStack to be placed.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withCanPlaceOn(predicates as stdlib.List<BlockPredicate>, showInTooltip as boolean) as T
ParameterTypeDescriptionOptionalDefault Value
Parameter
predicates
Type
stdlib.List<BlockPredicate>
Description
The collection of predicates to test for
Optional
false
Default Value
Parameter
showInTooltip
Type
boolean
Description
Whether to show the restriction in the tooltip or not.
Optional
true
Default Value
true

Link to withChargedProjectiles

Name: withChargedProjectiles

Sets the <componenttype:minecraft:charged_projectiles> of the ComponentAccess to have the given ChargedProjectiles

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withChargedProjectiles(chargedProjectiles as ChargedProjectiles) as T
ParameterType
Parameter
chargedProjectiles
Type
ChargedProjectiles

Link to withChargedProjectiles

Name: withChargedProjectiles

Sets the <componenttype:minecraft:charged_projectiles> of the ComponentAccess to have the given IItemStack

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withChargedProjectiles(item as IItemStack) as T

myComponentAccess.withChargedProjectiles(<item:minecraft:arrow>);
ParameterTypeDescription
Parameter
item
Type
IItemStack
Description
The item to store within.

Link to withChargedProjectiles

Name: withChargedProjectiles

Sets the <componenttype:minecraft:charged_projectiles> of the ComponentAccess to have the given items.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withChargedProjectiles(items as stdlib.List<IItemStack>) as T

myComponentAccess.withChargedProjectiles([<item:minecraft:arrow>]);
ParameterTypeDescription
Parameter
items
Type
stdlib.List<IItemStack>
Description
The items to store within.

Name: withContainer

Sets the <componenttype:minecraft:container> of the ComponentAccess to have the given ItemContainerContents

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withContainer(contents as ItemContainerContents) as T
ParameterType
Parameter
contents
Type
ItemContainerContents

Name: withContainer

Sets the <componenttype:minecraft:container> of the ComponentAccess to have the given values.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withContainer(contents as stdlib.List<IItemStack>) as T
ParameterType
Parameter
contents
Type
stdlib.List<IItemStack>

Link to withContainerLoot

Name: withContainerLoot

Sets the <componenttype:minecraft:container_loot> of the ComponentAccess to have the given SeededContainerLoot

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withContainerLoot(loot as SeededContainerLoot) as T
ParameterType
Parameter
loot
Type
SeededContainerLoot

Link to withContainerLoot

Name: withContainerLoot

Sets the <componenttype:minecraft:container_loot> of the ComponentAccess to have the given loot table and seed.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withContainerLoot(lootTable as ResourceKey<LootTable>, seed as long) as T
ParameterType
Parameter
lootTable
Type
ResourceKey<LootTable>
Parameter
seed
Type
long

Link to withCreativeSlotLock

Name: withCreativeSlotLock

Sets the <componenttype:minecraft:creative_slot_lock> of the ComponentAccess to exist.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withCreativeSlotLock() as T

myComponentAccess.withCreativeSlotLock();

Name: withCustomData

Sets the <componenttype:minecraft:custom_data> of the ComponentAccess to have the given CustomData

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withCustomData(customData as CustomData) as T
ParameterType
Parameter
customData
Type
CustomData

Name: withCustomData

Sets the componenttype:minecraft:custom_data of the ComponentAccess to have the given MapData

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withCustomData(customData as MapData) as T

myComponentAccess.withCustomData({custom_ammo_thing: 1, owner: "Benji"});
ParameterTypeDescription
Parameter
customData
Type
MapData
Description
The MapData to set the component to.

Link to withCustomModelData

Name: withCustomModelData

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withCustomModelData(data as CustomModelData) as T
ParameterType
Parameter
data
Type
CustomModelData

Link to withCustomModelData

Name: withCustomModelData

Sets the <componenttype:minecraft:custom_model_data> of the ComponentAccess to have the given value.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withCustomModelData(value as int) as T

myComponentAccess.withCustomModelData(2);
ParameterTypeDescription
Parameter
value
Type
int
Description
The value to set the CustomModelData to

Name: withCustomName

Sets the <componenttype:minecraft:custom_name> of the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withCustomName(name as Component) as T

myComponentAccess.withCustomName(Component.literal("Fancy Water"));
myComponentAccess.withCustomName(Component.translatable("mypack.lore.fancy_water"));
ParameterTypeDescription
Parameter
name
Type
Component
Description
The component to use.

Name: withDamage

Sets the <componenttype:minecraft:damage> of the ComponentAccess to have the given value. Damage is related to durability. Using this on an item that has no maxDamage may have unforeseen issues.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withDamage(damage as int) as T

myComponentAccess.withDamage(16);
ParameterTypeDescription
Parameter
damage
Type
int
Description
The new damage of the ComponentAccess.

Link to withDebugStickState

Name: withDebugStickState

Sets the <componenttype:minecraft:debug_stick_state> of the ComponentAccess to have the given DebugStickState

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withDebugStickState(state as DebugStickState) as T
ParameterType
Parameter
state
Type
DebugStickState

Name: withDyedColor

Sets the <componenttype:minecraft:dyed_color> of the ComponentAccess to have the given DyedItemColor

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withDyedColor(color as DyedItemColor) as T
ParameterType
Parameter
color
Type
DyedItemColor

Name: withDyedColor

Sets the <componenttype:minecraft:dyed_color> of the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withDyedColor(rgb as int, showInTooltip as boolean) as T

myComponentAccess.withDyedColor(0xFFFF00, true);
ParameterTypeDescriptionOptionalDefault Value
Parameter
rgb
Type
int
Description
The colour to dye this item with
Optional
false
Default Value
Parameter
showInTooltip
Type
boolean
Description
Whether to show this information in a tooltip
Optional
true
Default Value
true

Name: withEnchantment

Sets the <componenttype:minecraft:enchantments> of the ComponentAccess to have the given Enchantment and level.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withEnchantment(enchantment as Enchantment, level as int) as T

myComponentAccess.withEnchantment(<enchantment:minecraft:efficiency>, 4);
ParameterTypeDescriptionOptionalDefault Value
Parameter
enchantment
Type
Enchantment
Description
The enchantment to add
Optional
false
Default Value
Parameter
level
Type
int
Description
The level of the enchantment to set
Optional
true
Default Value
1

Link to withEnchantmentGlintOverride

Name: withEnchantmentGlintOverride

Sets the <componenttype:minecraft:enchantment_glint_override> of the ComponentAccess to have the given value.

If it is false, the item will never render the enchantment glint If it is true, the item will render the enchantment glint always, indenpendently of whether it is enchanted or not.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withEnchantmentGlintOverride(value as boolean) as T

myComponentAccess.withEnchantmentGlintOverride(true);
ParameterTypeDescription
Parameter
value
Type
boolean
Description
The value of the override, as described above

Link to withEnchantments

Name: withEnchantments

Sets the <componenttype:minecraft:enchantments> of the ComponentAccess to have the given ItemEnchantments

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withEnchantments(enchantments as ItemEnchantments) as T
ParameterType
Parameter
enchantments
Type
ItemEnchantments

Name: withEntityData

Sets the <componenttype:minecraft:entity_data> of the ComponentAccess to have the given CustomData

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withEntityData(data as CustomData) as T
ParameterType
Parameter
data
Type
CustomData

Name: withEntityData

Sets the <componenttype:minecraft:entity_data> of the ComponentAccess to have the given MapData

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withEntityData(data as MapData) as T
ParameterType
Parameter
data
Type
MapData

Link to withFireResistant

Name: withFireResistant

Sets the <componenttype:minecraft:fire_resistant> of the ComponentAccess to exist.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withFireResistant() as T

myComponentAccess.withFireResistant();

Link to withFireworkExplosion

Name: withFireworkExplosion

Sets the <componenttype:minecraft:firework_explosion> of the ComponentAccess to have the given FireworkExplosion

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withFireworkExplosion(explosion as FireworkExplosion) as T
ParameterType
Parameter
explosion
Type
FireworkExplosion

Name: withFireworks

Sets the <componenttype:minecraft:fireworks> of the ComponentAccess to have the given Fireworks

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withFireworks(fireworks as Fireworks) as T
ParameterType
Parameter
fireworks
Type
Fireworks

Name: withFireworks

Sets the <componenttype:minecraft:fireworks> of the ComponentAccess to have the given duration and explosions.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withFireworks(flightDuration as int, explosions as stdlib.List<FireworkExplosion>) as T
ParameterType
Parameter
flightDuration
Type
int
Parameter
explosions
Type
stdlib.List<FireworkExplosion>

Name: withFood

Sets the <componenttype:minecraft:food> of the ComponentAccess to have the given FoodProperties

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withFood(food as FoodProperties) as T
ParameterType
Parameter
food
Type
FoodProperties

Link to withHideAdditionalTooltip

Name: withHideAdditionalTooltip

Sets the <componenttype:minecraft:hide_additional_tooltip> of the ComponentAccess to exist.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withHideAdditionalTooltip() as T

myComponentAccess.withHideAdditionalTooltip();

Name: withHideTooltip

Sets the <componenttype:minecraft:hide_tooltip> of the ComponentAccess to exist.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withHideTooltip() as T

myComponentAccess.withHideTooltip();

Name: withInstrument

Sets the <componenttype:minecraft:instrument> of the ComponentAccess to have the given Instrument

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withInstrument(instrument as Instrument) as T
ParameterType
Parameter
instrument
Type
Instrument

Link to withIntangibleProjectile

Name: withIntangibleProjectile

Sets the <componenttype:minecraft:intangible_projectile> of the ComponentAccess to exist.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withIntangibleProjectile() as T

myComponentAccess.withIntangibleProjectile();

Name: withItemName

Sets the <componenttype:minecraft:item_name> of the ComponentAccess to have the given Component

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withItemName(name as Component) as T

myComponentAccess.withItemName(Component.literal("Fancy Water"));
myComponentAccess.withItemName(Component.translatable("mypack.lore.fancy_water"));
ParameterType
Parameter
name
Type
Component

Name: withLock

Sets the <componenttype:minecraft:lock> of the ComponentAccess to have the given string.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withLock(code as string) as T
ParameterType
Parameter
code
Type
string

Name: withLock

Sets the <componenttype:minecraft:lock> of the ComponentAccess to have the given LockCode

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withLock(lock as LockCode) as T
ParameterType
Parameter
lock
Type
LockCode

Link to withLodestoneTracker

Name: withLodestoneTracker

Sets the <componenttype:minecraft:lodestone_tracker> of the ComponentAccess to have the given LodestoneTracker

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withLodestoneTracker(tracker as LodestoneTracker) as T
ParameterType
Parameter
tracker
Type
LodestoneTracker

Name: withLore

Sets the <componenttype:minecraft:lore> of the ComponentAccess to have the given stdlib.List<Component>

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withLore(components as stdlib.List<Component>) as T

myComponentAccess.withLore([Component.literal("Found in a dark cave"), Component.translatable("Belonged to a Dragon")]);
ParameterTypeDescription
Parameter
components
Type
stdlib.List<Component>
Description
The list of Components to add as lore.

Name: withLore

Sets the <componenttype:minecraft:lore> of the ComponentAccess to have the given ItemLore

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withLore(lore as ItemLore) as T
ParameterType
Parameter
lore
Type
ItemLore

Name: withMapColor

Sets the <componenttype:minecraft:map_color> of the ComponentAccess to have the given MapItemColor

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withMapColor(color as MapItemColor) as T
ParameterType
Parameter
color
Type
MapItemColor

Name: withMapColor

Sets the <componenttype:minecraft:map_color> of the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withMapColor(rgb as int) as T

myComponentAccess.withMapColor(0xFF0000);
ParameterTypeDescription
Parameter
rgb
Type
int
Description
The new map colour

Link to withMapDecorations

Name: withMapDecorations

Sets the <componenttype:minecraft:map_decorations> of the ComponentAccess to have the given MapDecorations

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withMapDecorations(decorations as MapDecorations) as T
ParameterType
Parameter
decorations
Type
MapDecorations

Link to withMapDecorations

Name: withMapDecorations

Sets the <componenttype:minecraft:map_decorations> of the ComponentAccess to have the given values.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withMapDecorations(decorations as MapDecorationsEntry[string]) as T
ParameterType
Parameter
decorations
Type
MapDecorationsEntry[string]

Name: withMapId

Sets the <componenttype:minecraft:map_id> of the ComponentAccess to have the given value.

A map id is only useful after the game generates one to store data. Therefore, you should always pass in the parameter for an id you know is available.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withMapId(id as int) as T
ParameterType
Parameter
id
Type
int

Name: withMapId

Sets the <componenttype:minecraft:map_id> of the ComponentAccess to have the given MapId

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withMapId(mapId as MapId) as T
ParameterType
Parameter
mapId
Type
MapId

Link to withMapPostProcessing

Name: withMapPostProcessing

Sets the <componenttype:minecraft:map_post_processing> of the ComponentAccess to have the given MapPostProcessing

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withMapPostProcessing(value as MapPostProcessing) as T
ParameterType
Parameter
value
Type
MapPostProcessing

Name: withMaxDamage

Sets the <componenttype:minecraft:max_damage> of the ComponentAccess to have the given value.

It is likely that you need to call withDamage(0) in order for some things to function properly.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withMaxDamage(maxDamage as int) as T

myComponentAccess.withMaxDamage(1024);
myComponentAccess.withMaxDamage(1024);
ParameterType
Parameter
maxDamage
Type
int

Link to withMaxStackSize

Name: withMaxStackSize

Sets the <componenttype:minecraft:stack_size> of the ComponentAccess to have the given value. Non standard stack sizes may render differently and may not be handled correctly by all mods. Test your changes!

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withMaxStackSize(maxStackSize as int) as T

myComponentAccess.withMaxStackSize(16);
ParameterTypeDescription
Parameter
maxStackSize
Type
int
Description
The new maxStackSize of the ComponentAccess.

Link to withNoteBlockSound

Name: withNoteBlockSound

Sets the <componenttype:minecraft:note_block_sound> of the ComponentAccess to have the given ResourceLocation

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withNoteBlockSound(sound as ResourceLocation) as T
ParameterType
Parameter
sound
Type
ResourceLocation

Link to withOminousBottleAmplifier

Name: withOminousBottleAmplifier

Sets the <componenttype:minecraft:ominous_bottle_amplifier> of the ComponentAccess to have the given amplifier.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withOminousBottleAmplifier(amplifier as int) as T
ParameterType
Parameter
amplifier
Type
int

Link to withPotDecorations

Name: withPotDecorations

Sets the <componenttype:minecraft:pot_decorations> of the ComponentAccess to have the given PotDecorations

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withPotDecorations(decorations as PotDecorations) as T
ParameterType
Parameter
decorations
Type
PotDecorations

Link to withPotDecorations

Name: withPotDecorations

Sets the <componenttype:minecraft:pot_decorations> of the ComponentAccess to have the given items.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withPotDecorations(back as ItemDefinition, left as ItemDefinition, right as ItemDefinition, front as ItemDefinition) as T
ParameterType
Parameter
back
Type
ItemDefinition
Parameter
left
Type
ItemDefinition
Parameter
right
Type
ItemDefinition
Parameter
front
Type
ItemDefinition

Link to withPotionContents

Name: withPotionContents

Sets the <componenttype:minecraft:potion_contents> of the ComponentAccess to have the given PotionContents

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withPotionContents(contents as PotionContents) as T
ParameterType
Parameter
contents
Type
PotionContents

Link to withPotionContents

Name: withPotionContents

Sets the <componenttype:minecraft:potion_contents> of the ComponentAccess to have the given Potion and no custom effects

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withPotionContents(potion as Potion) as T

myComponentAccess.withPotionContents(<potion:minecraft:swiftness>);
ParameterTypeDescription
Parameter
potion
Type
Potion
Description
The potion to store within

Link to withPotionContents

Name: withPotionContents

Sets the <componenttype:minecraft:potion_contents> of the ComponentAccess to have the given Potion and the given MobEffectInstance effects.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withPotionContents(potion as Potion, customEffects as stdlib.List<MobEffectInstance>) as T

myComponentAccess.withPotionContents(<potion:minecraft:swiftness>, [MobEffectInstance.of(<mobeffect:minecraft:strength>, 20 * 20, 1, false, false, true)]);
ParameterTypeDescription
Parameter
potion
Type
Potion
Description
The potion to store within.
Parameter
customEffects
Type
stdlib.List<MobEffectInstance>
Description
The effects to grant upon consuming this potion.

Link to withPotionContents

Name: withPotionContents

Sets the <componenttype:minecraft:potion_contents> of the ComponentAccess to have the given Potion and the given MobEffectInstance effects.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withPotionContents(potion as Potion, customColor as int, customEffects as stdlib.List<MobEffectInstance>) as T

myComponentAccess.withPotionContents(<potion:minecraft:swiftness>, 0xFFFFFF00, [MobEffectInstance.of(<mobeffect:minecraft:strength>, 20 * 20, 1, false, false, true)]);
ParameterTypeDescription
Parameter
potion
Type
Potion
Description
The potion to store within.
Parameter
customColor
Type
int
Description
The ARGB color the potion will have.
Parameter
customEffects
Type
stdlib.List<MobEffectInstance>
Description
The effects to grant upon consuming this potion.

Name: withProfile

Sets the <componenttype:minecraft:profile> of the ComponentAccess to have the given ResolvableProfile

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withProfile(profile as ResolvableProfile) as T
ParameterType
Parameter
profile
Type
ResolvableProfile

Name: withRarity

Sets the <componenttype:minecraft:rarity> of the ComponentAccess to have the given Rarity

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withRarity(rarity as Rarity) as T

myComponentAccess.withRarity(<constant:minecraft:item/rarity:epic>);
ParameterTypeDescription
Parameter
rarity
Type
Rarity
Description
The rarity to set

Name: withRecipes

Sets the <componenttype:minecraft:recipes> of the ComponentAccess to have the given stdlib.List<ResourceLocation>

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withRecipes(recipes as stdlib.List<ResourceLocation>) as T
ParameterType
Parameter
recipes
Type
stdlib.List<ResourceLocation>

Name: withRepairCost

Sets the <componenttype:minecraft:repair_cost> of the ComponentAccess to have the given value.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withRepairCost(cost as int) as T

myComponentAccess.withRepairCost(20);
ParameterTypeDescription
Parameter
cost
Type
int
Description
The repair cost

Link to withStoredEnchantments

Name: withStoredEnchantments

Sets the <componenttype:minecraft:stored_enchantments> of the ComponentAccess to have the given ItemEnchantments

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withStoredEnchantments(enchantments as ItemEnchantments) as T
ParameterType
Parameter
enchantments
Type
ItemEnchantments

Link to withSuspiciousStewEffects

Name: withSuspiciousStewEffects

Sets the <componenttype:minecraft:suspicious_stew_effects> of the ComponentAccess to have the given SuspiciousStewEffects SuspiciousStewEffectsEntry is effectively a pair of Effect and duration.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withSuspiciousStewEffects(effects as stdlib.List<SuspiciousStewEffectsEntry>) as T
ParameterTypeDescription
Parameter
effects
Type
stdlib.List<SuspiciousStewEffectsEntry>
Description
The list of effects to grant on consumption.

Link to withSuspiciousStewEffects

Name: withSuspiciousStewEffects

Sets the <componenttype:minecraft:suspicious_stew_effects> of the ComponentAccess to have the given SuspiciousStewEffects

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withSuspiciousStewEffects(suspiciousStewEffects as SuspiciousStewEffects) as T
ParameterType
Parameter
suspiciousStewEffects
Type
SuspiciousStewEffects

Name: withTool

Sets the <componenttype:minecraft:tool> of the ComponentAccess to have the given Tool

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withTool(tool as Tool) as T
ParameterType
Parameter
tool
Type
Tool

Name: withTool

Sets the <componenttype:minecraft:tool> of the ComponentAccess to have the given data. A Tool instance is constructed from the parameters.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withTool(rules as stdlib.List<ToolRule>, defaultMiningSpeed as float, damagePerBlock as int) as T

myComponentAccess.withTool([ToolRule.minesAndDrops(<tag:blocks:minecraft:planks>, 6.0f)], 0.25f, 1);
ParameterTypeDescription
Parameter
rules
Type
stdlib.List<ToolRule>
Description
The list of rules the new Tool instance will have
Parameter
defaultMiningSpeed
Type
float
Description
The default mining speed of the new tool
Parameter
damagePerBlock
Type
int
Description
The damage or durability that is dealt to the Tool after use.

Name: withTrim

Sets the <componenttype:minecraft:trim> of the ComponentAccess to have the given ArmorTrim

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withTrim(trim as ArmorTrim) as T
ParameterType
Parameter
trim
Type
ArmorTrim

Name: withUnbreakable

Sets the <componenttype:minecraft:unbreakable> of the ComponentAccess. The existance of the component makes the ComponentAccess unbreakable.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withUnbreakable(showInTooltip as boolean) as T
ParameterTypeDescriptionOptionalDefault Value
Parameter
showInTooltip
Type
boolean
Description
Whether to show that the ComponentAccess is unbreakable in a tooltip.
Optional
true
Default Value
true

Name: withUnbreakable

Sets the <componenttype:minecraft:unbreakable> of the ComponentAccess. The existance of the component makes the ComponentAccess unbreakable.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withUnbreakable(unbreakable as Unbreakable) as T
ParameterTypeDescription
Parameter
unbreakable
Type
Unbreakable
Description
The Unbreakable instance with the configured values.

Link to withWritableBookContent

Name: withWritableBookContent

Sets the <componenttype:minecraft:writable_book_content> of the ComponentAccess to have the given WritableBookContent

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withWritableBookContent(content as WritableBookContent) as T
ParameterType
Parameter
content
Type
WritableBookContent

Link to withWritableBookContent

Name: withWritableBookContent

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withWritableBookContent(pages as stdlib.List<Filterable<string>>) as T
ParameterType
Parameter
pages
Type
stdlib.List<Filterable<string>>

Link to withWrittenBookContent

Name: withWrittenBookContent

Sets the <componenttype:minecraft:written_book_content> of the ComponentAccess to have the given WrittenBookContent

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
ComponentAccess.withWrittenBookContent(content as WrittenBookContent) as T
ParameterType
Parameter
content
Type
WrittenBookContent

Link to withoutAttributeModifiers

Name: withoutAttributeModifiers

Removes the <componenttype:minecraft:attribute_modifiers> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutAttributeModifiers() as T

myComponentAccess.withoutAttributeModifiers();

Link to withoutBannerPatterns

Name: withoutBannerPatterns

Removes the <componenttype:minecraft:banner_patterns> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutBannerPatterns() as T

myComponentAccess.withoutBannerPatterns();

Link to withoutBaseColor

Name: withoutBaseColor

Removes the <componenttype:minecraft:base_color> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutBaseColor() as T

myComponentAccess.withoutBaseColor();

Name: withoutBees

Removes the <componenttype:minecraft:bees> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutBees() as T

myComponentAccess.withoutBees();

Link to withoutBlockEntityData

Name: withoutBlockEntityData

Removes the <componenttype:minecraft:block_entity_data> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutBlockEntityData() as T

myComponentAccess.withoutBlockEntityData();

Link to withoutBlockState

Name: withoutBlockState

Removes the <componenttype:minecraft:block_state> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutBlockState() as T

myComponentAccess.withoutBlockState();

Link to withoutBucketEntityData

Name: withoutBucketEntityData

Removes the <componenttype:minecraft:bucket_entity_data> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutBucketEntityData() as T

myComponentAccess.withoutBucketEntityData();

Link to withoutBundleContents

Name: withoutBundleContents

Removes the <componenttype:minecraft:bundle_contents> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutBundleContents() as T

myComponentAccess.withoutBundleContents();

Name: withoutCanBreak

Removes the <componenttype:minecraft:can_break> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutCanBreak() as T

myComponentAccess.withoutCanBreak();

Link to withoutCanPlaceOn

Name: withoutCanPlaceOn

Removes the <componenttype:minecraft:can_place_on> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutCanPlaceOn() as T

myComponentAccess.withoutCanPlaceOn();

Link to withoutChargedProjectiles

Name: withoutChargedProjectiles

Removes the <componenttype:minecraft:charged_projectiles> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutChargedProjectiles() as T

myComponentAccess.withoutChargedProjectiles();

Link to withoutContainer

Name: withoutContainer

Removes the <componenttype:minecraft:container> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutContainer() as T

myComponentAccess.withoutContainer();

Link to withoutContainerLoot

Name: withoutContainerLoot

Removes the <componenttype:minecraft:container_loot> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutContainerLoot() as T

myComponentAccess.withoutContainerLoot();

Link to withoutCreativeSlotLock

Name: withoutCreativeSlotLock

Removes the <componenttype:minecraft:creative_slot_lock> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutCreativeSlotLock() as T

myComponentAccess.withoutCreativeSlotLock();

Link to withoutCustomData

Name: withoutCustomData

Removes the <componenttype:minecraft:custom_data> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutCustomData() as T

myComponentAccess.withoutCustomData();

Link to withoutCustomModelData

Name: withoutCustomModelData

Removes the <componenttype:minecraft:custom_model_data> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutCustomModelData() as T

myComponentAccess.withoutCustomModelData();

Link to withoutCustomName

Name: withoutCustomName

Removes the <componenttype:minecraft:custom_name> from the ComponentAccess

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutCustomName() as T

myComponentAccess.withoutCustomName();

Name: withoutDamage

Removes the <componenttype:minecraft:damage> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutDamage() as T

myComponentAccess.withoutDamage();

Link to withoutDebugStickState

Name: withoutDebugStickState

Removes the <componenttype:minecraft:debug_stick_state> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutDebugStickState() as T

myComponentAccess.withoutDebugStickState();

Link to withoutDyedColor

Name: withoutDyedColor

Removes the <componenttype:minecraft:dyed_color> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutDyedColor() as T

myComponentAccess.withoutDyedColor();

Link to withoutEnchantment

Name: withoutEnchantment

Removes the Enchantment from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutEnchantment(enchantment as Enchantment) as T

myComponentAccess.withoutEnchantment(<enchantment:minecraft:mending>);
ParameterTypeDescription
Parameter
enchantment
Type
Enchantment
Description
The Enchantment to remove

Link to withoutEnchantmentGlintOverride

Name: withoutEnchantmentGlintOverride

Removes the <componenttype:minecraft:enchantment_glint_override> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutEnchantmentGlintOverride() as T

myComponentAccess.withoutEnchantmentGlintOverride();

Link to withoutEnchantments

Name: withoutEnchantments

Removes the <componenttype:minecraft:enchantments> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutEnchantments() as T

myComponentAccess.withoutEnchantments();

Link to withoutEntityDate

Name: withoutEntityDate

Removes the <componenttype:minecraft:entity_data> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutEntityDate() as T

myComponentAccess.withoutEntityDate();

Link to withoutFireResistant

Name: withoutFireResistant

Removes the <componenttype:minecraft:fire_resistant> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutFireResistant() as T

myComponentAccess.withoutFireResistant();

Link to withoutFireworkExplosion

Name: withoutFireworkExplosion

Removes the <componenttype:minecraft:firework_explosion> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutFireworkExplosion() as T

myComponentAccess.withoutFireworkExplosion();

Link to withoutFireworks

Name: withoutFireworks

Removes the <componenttype:minecraft:fireworks> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutFireworks() as T

myComponentAccess.withoutFireworks();

Name: withoutFood

Removes the <componenttype:minecraft:food> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutFood() as T

myComponentAccess.withoutFood();

Link to withoutHideAdditionalTooltip

Name: withoutHideAdditionalTooltip

Removes the <componenttype:minecraft:hide_additional_tooltip> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutHideAdditionalTooltip() as T

myComponentAccess.withoutHideAdditionalTooltip();

Link to withoutHideTooltip

Name: withoutHideTooltip

Removes the <componenttype:minecraft:hide_tooltip> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutHideTooltip() as T

myComponentAccess.withoutHideTooltip();

Link to withoutInstrument

Name: withoutInstrument

Removes the <componenttype:minecraft:instrument> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutInstrument() as T

myComponentAccess.withoutInstrument();

Link to withoutIntangibleProjectile

Name: withoutIntangibleProjectile

Removes the <componenttype:minecraft:intangible_projectile> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutIntangibleProjectile() as T

myComponentAccess.withoutIntangibleProjectile();

Name: withoutItemName

Removes the <componenttype:minecraft:item_name> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutItemName() as T

myComponentAccess.withoutItemName();

Name: withoutLock

Removes the <componenttype:minecraft:lock> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutLock() as T

myComponentAccess.withoutLock();

Link to withoutLodestoneTracker

Name: withoutLodestoneTracker

Removes the <componenttype:minecraft:lodestone_tracker> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutLodestoneTracker() as T

myComponentAccess.withoutLodestoneTracker();

Name: withoutLore

Removes the <componenttype:minecraft:lore> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutLore() as T

myComponentAccess.withoutLore();

Name: withoutMapColor

Removes the <componenttype:minecraft:map_color> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutMapColor() as T

myComponentAccess.withoutMapColor();

Link to withoutMapDecorations

Name: withoutMapDecorations

Removes the <componenttype:minecraft:map_decorations> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutMapDecorations() as T

myComponentAccess.withoutMapDecorations();

Name: withoutMapId

Removes the <componenttype:minecraft:map_id> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutMapId() as T

myComponentAccess.withoutMapId();

Link to withoutMapPostProcessing

Name: withoutMapPostProcessing

Removes the <componenttype:minecraft:map_post_processing> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutMapPostProcessing() as T

myComponentAccess.withoutMapPostProcessing();

Link to withoutMaxDamage

Name: withoutMaxDamage

Removes the <componenttype:minecraft:max_damage> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutMaxDamage() as T

myComponentAccess.withoutMaxDamage();

Link to withoutMaxStackSize

Name: withoutMaxStackSize

Removes the <componenttype:minecraft:stack_size> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutMaxStackSize() as T

myComponentAccess.withoutMaxStackSize();

Link to withoutNoteBlockSound

Name: withoutNoteBlockSound

Removes the <componenttype:minecraft:note_block_sound> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutNoteBlockSound() as T

myComponentAccess.withoutNoteBlockSound();

Link to withoutOminousBottleAmplifier

Name: withoutOminousBottleAmplifier

Removes the <componenttype:minecraft:ominous_bottle_amplifier> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutOminousBottleAmplifier() as T

myComponentAccess.withoutOminousBottleAmplifier();

Link to withoutPotDecorations

Name: withoutPotDecorations

Removes the <componenttype:minecraft:pot_decorations> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutPotDecorations() as T

myComponentAccess.withoutPotDecorations();

Link to withoutPotionContents

Name: withoutPotionContents

Removes the <componenttype:minecraft:potion_contents> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutPotionContents() as T

myComponentAccess.withoutPotionContents();

Name: withoutProfile

Removes the <componenttype:minecraft:profile> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutProfile() as T

myComponentAccess.withoutProfile();

Name: withoutRarity

Removes the <componenttype:minecraft:rarity> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutRarity() as T

myComponentAccess.withoutRarity();

Name: withoutRecipes

Removes the <componenttype:minecraft:recipes> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutRecipes() as T

myComponentAccess.withoutRecipes();

Link to withoutRepairCost

Name: withoutRepairCost

Removes the <componenttype:minecraft:repair_cost> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutRepairCost() as T

myComponentAccess.withoutRepairCost();

Link to withoutStoredEnchantments

Name: withoutStoredEnchantments

Removes the <componenttype:minecraft:stored_enchantments> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutStoredEnchantments() as T

myComponentAccess.withoutStoredEnchantments();

Link to withoutSuspiciousStewEffects

Name: withoutSuspiciousStewEffects

Removes the <componenttype:minecraft:suspicious_stew_effects> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutSuspiciousStewEffects() as T

myComponentAccess.withoutSuspiciousStewEffects();

Name: withoutTool

Removes the <componenttype:minecraft:tool> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutTool() as T

myComponentAccess.withoutTool();

Name: withoutTrim

Removes the <componenttype:minecraft:trim> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutTrim() as T

myComponentAccess.withoutTrim();

Link to withoutUnbreakable

Name: withoutUnbreakable

Removes the <componenttype:minecraft:unbreakable> from the ComponentAccess

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutUnbreakable() as T

myComponentAccess.withoutUnbreakable();

Link to withoutWritableBookContent

Name: withoutWritableBookContent

Removes the <componenttype:minecraft:writable_book_content> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutWritableBookContent() as T

myComponentAccess.withoutWritableBookContent();

Link to withoutWrittenBookContent

Name: withoutWrittenBookContent

Removes the <componenttype:minecraft:written_book_content> from the ComponentAccess.

Returns: The new instance with the modified data.
Return Type: T

ZenScript
Copy
// ComponentAccess.withoutWrittenBookContent() as T

myComponentAccess.withoutWrittenBookContent();
NameTypeHas GetterHas SetterDescription
Name
attributeModifiers
Type
ItemAttributeModifiers
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:attribute_modifiers>
Name
bannerPatterns
Type
BannerPatternLayers
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:banner_patterns>
Name
baseColor
Type
DyeColor
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:base_color>
Name
bees
Type
stdlib.List<BeehiveBlockEntityOccupant>
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:bees>
Name
blockEntityData
Type
CustomData
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:block_entity_data>
Name
blockState
Type
BlockItemStateProperties
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:block_state>
Name
bucketEntityData
Type
CustomData
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:bucket_entity_data>
Name
bundleContents
Type
BundleContents
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:bundle_contents>
Name
canBreak
Type
AdventureModePredicate
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:can_break>
Name
canPlaceOn
Type
AdventureModePredicate
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:can_place_on>
Name
chargedProjectiles
Type
ChargedProjectiles
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:charged_projectiles>
Name
container
Type
ItemContainerContents
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:container>
Name
containerLoot
Type
SeededContainerLoot
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:container_loot>
Name
creativeSlotLock
Type
boolean
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:creative_slot_lock>
Name
customData
Type
CustomData
Has Getter
true
Has Setter
false
Description
Gets the data in the <componenttype:minecraft:custom_data>
Name
customModelData
Type
CustomModelData
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:custom_model_data>
Name
customName
Type
Component
Has Getter
true
Has Setter
false
Description
Gets the data in the <componenttype:minecraft:custom_name>

A custom name is generally displayed in italics and controlled by the user.
Name
damage
Type
int
Has Getter
true
Has Setter
false
Description
Gets the data in the <componenttype:minecraft:damage>
Name
debugStickState
Type
DebugStickState
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:debug_stick_state>
Name
dyedColor
Type
DyedItemColor
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:dye_color>
Name
enchantmentGlintOverride
Type
boolean
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:enchantment_glint_override>

If it is present, it is first checked to determine whether there is special behaviour, otherwise
the code checks for enchantments.
Name
enchantments
Type
ItemEnchantments
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:enchantments>
Name
entityData
Type
CustomData
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:entity_data>
Name
fireworkExplosion
Type
FireworkExplosion
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:firework_explosion>
Name
fireworks
Type
Fireworks
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:fireworks>
Name
food
Type
FoodProperties
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:food>
Name
hasAttributeModifiers
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:attribute_modifiers>
Name
hasBannerPatterns
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:banner_patterns>
Name
hasBaseColor
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:base_color>

Used for shield colouring.
Name
hasBees
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:bees>
Name
hasBlockEntityData
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:block_entity_data>
Name
hasBlockState
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:block_state>
Name
hasBucketEntityData
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:bucket_entity_data>
Name
hasBundleContents
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:bundle_contents>
Name
hasCanBreak
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:can_break>
Name
hasCanPlaceOn
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:can_place_on>
Name
hasChargedProjectiles
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:charged_projectiles>

This component is used for crossbows.
Name
hasContainer
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:container>
Name
hasContainerLoot
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:container_loot>
Name
hasCustomData
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has the <componenttype:minecraft:custom_data>
Name
hasCustomModelData
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:custom_model_data>
Name
hasCustomName
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has the <componenttype:minecraft:custom_name>
Name
hasDamage
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has the <componenttype:minecraft:damage>
Name
hasDebugStickState
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:debug_stick_state>
Name
hasDyedColor
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:dyed_color>
Name
hasEnchantmentGlintOverride
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:enchantment_glint_override>
Name
hasEnchantments
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has the <componenttype:minecraft:enchantments>
Name
hasEntityData
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:entity_data>
Name
hasFireworkExplosion
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:firework_explosion>
Name
hasFireworks
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:fireworks>
Name
hasFood
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:food>
Name
hasInstrument
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:instrument>
Name
hasItemName
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has the <componenttype:minecraft:item_namegt;
Name
hasLock
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:lock>
Name
hasLodestoneTracker
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:lodestone_tracker>
Name
hasLore
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has the <componenttype:minecraft:lore>
Name
hasMapColor
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:map_color>
Name
hasMapDecorations
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:map_decorations>

MapDecorations are additional elements that render on a map, such as waypoints.
Name
hasMapId
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:map_id>
Name
hasMapPostProcessing
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:map_post_processing>

This componenet stores additional info on the map, such as the scale or whether to lock it.
Name
hasMaxDamage
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has the <componenttype:minecraft:max_damage>
Name
hasMaxStackSize
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has the <componenttype:minecraft:max_stack_size>
Name
hasNoteBlockSound
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:note_block_sound>
Name
hasOminousBottleAmplifier
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:ominous_bottle_amplifier>
Name
hasPotDecorations
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:pot_decorations>
Name
hasPotionContents
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:potion_contents>

Stores Potion Data on an item.
Name
hasProfile
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:profile>
Name
hasRarity
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has the <componenttype:minecraft:rarity>
Name
hasRecipes
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:recipes>

Used for Knowledge Books.
Name
hasRepairCost
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:repair_cost>
Name
hasStoredEnchantments
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:stored_enchantments>

The stored enchantments component is only present in enchanted books, since it just stores the enchantments
under a lid for future use. The item is not enchanted.
Name
hasSuspiciousStewEffects
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:suspicious_stew_effects>
Name
hasTool
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:tool>
Name
hasTrim
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:trim>
Name
hasUnbreakable
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has the <componenttype:minecraft:unbreakable>
Name
hasWritableBookContent
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:writable_book_content>
Name
hasWrittenBookContent
Type
boolean
Has Getter
true
Has Setter
false
Description
Checks whether the ComponentAccess has <componenttype:minecraft:written_book_content>
Name
hideAdditionalTooltip
Type
boolean
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:hide_additional_tooltip>
Name
hideTooltip
Type
boolean
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:hide_tooltip>
Name
instrument
Type
Instrument
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:instrument>
Name
isFireResistant
Type
boolean
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:fire_resistant>
Name
isIntangibleProjectile
Type
boolean
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:intangible_projectile>
Name
itemName
Type
Component
Has Getter
true
Has Setter
false
Description
Gets the data in the <componenttype:minecraft:custom_name>

In the case of items, an item name is set by the make to make a special instance of an item, such as with
ominous banners.
Name
lockComponent
Type
LockCode
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:lock>
Name
lodestoneTracker
Type
LodestoneTracker
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:lodestone_tracker>
Name
lore
Type
ItemLore
Has Getter
true
Has Setter
false
Description
Gets the data in the <componenttype:minecraft:lore>
Name
mapColor
Type
MapItemColor
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:map_color>
Name
mapDecorations
Type
MapDecorations
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:map_decorations>
Name
mapId
Type
MapId
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:map_id>
Name
mapPostProcessing
Type
MapPostProcessing
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:map_post_processing>
Name
maxDamage
Type
int
Has Getter
true
Has Setter
false
Description
Gets the data in the <componenttype:minecraft:max_damage>
Name
maxStackSize
Type
int
Has Getter
true
Has Setter
false
Description
Gets the data in the <componenttype:minecraft:max_stack_size>
Name
noteBlockSound
Type
ResourceLocation
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:note_block_sound>
Name
ominousBottleAmplifier
Type
int
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:ominous_bottle_amplifier>
Name
potDecorations
Type
PotDecorations
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:pot_decorations>
Name
potionContents
Type
PotionContents
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:potion_contents>
Name
profile
Type
ResolvableProfile
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:profile>
Name
rarity
Type
Rarity
Has Getter
true
Has Setter
false
Description
Gets the data in the <componenttype:minecraft:rarity>
Name
recipes
Type
stdlib.List<ResourceLocation>
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:recipes>
Name
repairCost
Type
int
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:repair_cost>
Name
storedEnchantments
Type
ItemEnchantments
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:stored_enchantments>
Name
suspiciousStewEffects
Type
SuspiciousStewEffects
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:suspicious_stew_effects>
Name
tool
Type
Tool
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:tool>
Name
trim
Type
ArmorTrim
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:trim>
Name
unbreakable
Type
Unbreakable
Has Getter
true
Has Setter
false
Description
Gets the data in the <componenttype:minecraft:unbreakable>
Name
writableBookContent
Type
WritableBookContent
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:writable_book_content>
Name
writtenBookContent
Type
WrittenBookContent
Has Getter
true
Has Setter
false
Description
Gets the data in <componenttype:minecraft:written_book_content>