Interface ComponentAccess<T extends ComponentAccess<T>>
- All Known Subinterfaces:
IFluidStack,IItemStack
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
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.-
Method Summary
Modifier and TypeMethodDescription<U> U_get(net.minecraft.core.component.DataComponentType<? extends U> componentType) <U> boolean_has(net.minecraft.core.component.DataComponentType<U> componentType) <U> T_with(net.minecraft.core.component.DataComponentType<U> componentType, U value) <U> T_without(net.minecraft.core.component.DataComponentType<U> componentType) default booleanGets the data in <componenttype:minecraft:creative_slot_lock>default net.minecraft.world.item.component.ItemAttributeModifiersGets the data in <componenttype:minecraft:attribute_modifiers>default net.minecraft.world.level.block.entity.BannerPatternLayersGets the data in <componenttype:minecraft:banner_patterns>default net.minecraft.world.item.DyeColorGets the data in <componenttype:minecraft:base_color>default List<net.minecraft.world.level.block.entity.BeehiveBlockEntity.Occupant> getBees()Gets the data in <componenttype:minecraft:bees>default net.minecraft.world.item.component.CustomDataGets the data in <componenttype:minecraft:block_entity_data>default net.minecraft.world.item.component.BlockItemStatePropertiesGets the data in <componenttype:minecraft:block_state>default net.minecraft.world.item.component.CustomDataGets the data in <componenttype:minecraft:bucket_entity_data>default net.minecraft.world.item.component.BundleContentsGets the data in <componenttype:minecraft:bundle_contents>default net.minecraft.world.item.AdventureModePredicateGets the data in <componenttype:minecraft:can_break>default net.minecraft.world.item.AdventureModePredicateGets the data in <componenttype:minecraft:can_place_on>default net.minecraft.world.item.component.ChargedProjectilesGets the data in <componenttype:minecraft:charged_projectiles>default net.minecraft.world.item.component.ItemContainerContentsGets the data in <componenttype:minecraft:container>default net.minecraft.world.item.component.SeededContainerLootGets the data in <componenttype:minecraft:container_loot>default net.minecraft.world.item.component.CustomDataGets the data in the <componenttype:minecraft:custom_data>default net.minecraft.world.item.component.CustomModelDataGets the data in <componenttype:minecraft:custom_model_data>default net.minecraft.network.chat.ComponentGets the data in the <componenttype:minecraft:custom_name> A custom name is generally displayed in italics and controlled by the user.default intGets the data in the <componenttype:minecraft:damage>default net.minecraft.world.item.component.DebugStickStateGets the data in <componenttype:minecraft:debug_stick_state>default net.minecraft.world.item.component.DyedItemColorGets the data in <componenttype:minecraft:dye_color>default booleanGets 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.default net.minecraft.world.item.enchantment.ItemEnchantmentsGets the data in <componenttype:minecraft:enchantments>default net.minecraft.world.item.component.CustomDataGets the data in <componenttype:minecraft:entity_data>default net.minecraft.world.item.component.FireworkExplosionGets the data in <componenttype:minecraft:firework_explosion>default net.minecraft.world.item.component.FireworksGets the data in <componenttype:minecraft:fireworks>default net.minecraft.world.food.FoodPropertiesgetFood()Gets the data in <componenttype:minecraft:food>default net.minecraft.world.item.InstrumentGets the data in <componenttype:minecraft:instrument>default net.minecraft.network.chat.ComponentGets the data in the <componenttype:minecraft:item_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.default net.minecraft.world.LockCodegetLock()Gets the data in <componenttype:minecraft:lock>default net.minecraft.world.item.component.LodestoneTrackerGets the data in <componenttype:minecraft:lodestone_tracker>default net.minecraft.world.item.component.ItemLoregetLore()Gets the data in the <componenttype:minecraft:lore>default net.minecraft.world.item.component.MapItemColorGets the data in <componenttype:minecraft:map_color>default net.minecraft.world.item.component.MapDecorationsGets the data in <componenttype:minecraft:map_decorations>default net.minecraft.world.level.saveddata.maps.MapIdgetMapId()Gets the data in <componenttype:minecraft:map_id>default net.minecraft.world.item.component.MapPostProcessingGets the data in <componenttype:minecraft:map_post_processing>default intGets the data in the <componenttype:minecraft:max_damage>default intGets the data in the <componenttype:minecraft:max_stack_size>default net.minecraft.resources.ResourceLocationGets the data in <componenttype:minecraft:note_block_sound>default intGets the data in <componenttype:minecraft:ominous_bottle_amplifier>default net.minecraft.world.level.block.entity.PotDecorationsGets the data in <componenttype:minecraft:pot_decorations>default net.minecraft.world.item.alchemy.PotionContentsGets the data in <componenttype:minecraft:potion_contents>default net.minecraft.world.item.component.ResolvableProfileGets the data in <componenttype:minecraft:profile>default net.minecraft.world.item.RarityGets the data in the <componenttype:minecraft:rarity>default List<net.minecraft.resources.ResourceLocation> Gets the data in <componenttype:minecraft:recipes>default net.minecraft.world.item.enchantment.ItemEnchantmentsGets the data in <componenttype:minecraft:stored_enchantments>default net.minecraft.world.item.component.SuspiciousStewEffectsGets the data in <componenttype:minecraft:suspicious_stew_effects>default net.minecraft.world.item.component.ToolgetTool()Gets the data in <componenttype:minecraft:tool>default net.minecraft.world.item.armortrim.ArmorTrimgetTrim()Gets the data in <componenttype:minecraft:trim>default net.minecraft.world.item.component.UnbreakableGets the data in the <componenttype:minecraft:unbreakable>default net.minecraft.world.item.component.WritableBookContentGets the data in <componenttype:minecraft:writable_book_content>default net.minecraft.world.item.component.WrittenBookContentGets the data in <componenttype:minecraft:written_book_content>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:attribute_modifiers>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:banner_patterns>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:base_color> Used for shield colouring.default booleanhasBees()Checks whether the ComponentAccess has <componenttype:minecraft:bees>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:block_entity_data>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:block_state>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:bucket_entity_data>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:bundle_contents>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:can_break>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:can_place_on>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:charged_projectiles> This component is used for crossbows.default booleanChecks whether the ComponentAccess has <componenttype:minecraft:container>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:container_loot>default booleanChecks whether the ComponentAccess has the <componenttype:minecraft:custom_data>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:custom_model_data>default booleanChecks whether the ComponentAccess has the <componenttype:minecraft:custom_name>default booleanChecks whether the ComponentAccess has the <componenttype:minecraft:damage>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:debug_stick_state>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:dyed_color>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:enchantment_glint_override>default booleanChecks whether the ComponentAccess has the <componenttype:minecraft:enchantments>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:entity_data>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:firework_explosion>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:fireworks>default booleanhasFood()Checks whether the ComponentAccess has <componenttype:minecraft:food>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:instrument>default booleanChecks whether the ComponentAccess has the <componenttype:minecraft:item_namegt;default booleanhasLock()Checks whether the ComponentAccess has <componenttype:minecraft:lock>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:lodestone_tracker>default booleanhasLore()Checks whether the ComponentAccess has the <componenttype:minecraft:lore>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:map_color>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:map_decorations> MapDecorations are additional elements that render on a map, such as waypoints.default booleanhasMapId()Checks whether the ComponentAccess has <componenttype:minecraft:map_id>default booleanChecks 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.default booleanChecks whether the ComponentAccess has the <componenttype:minecraft:max_damage>default booleanChecks whether the ComponentAccess has the <componenttype:minecraft:max_stack_size>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:note_block_sound>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:ominous_bottle_amplifier>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:pot_decorations>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:potion_contents> Stores Potion Data on an item.default booleanChecks whether the ComponentAccess has <componenttype:minecraft:profile>default booleanChecks whether the ComponentAccess has the <componenttype:minecraft:rarity>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:recipes> Used for Knowledge Books.default booleanChecks whether the ComponentAccess has <componenttype:minecraft:repair_cost>default booleanChecks 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.default booleanChecks whether the ComponentAccess has <componenttype:minecraft:suspicious_stew_effects>default booleanhasTool()Checks whether the ComponentAccess has <componenttype:minecraft:tool>default booleanhasTrim()Checks whether the ComponentAccess has <componenttype:minecraft:trim>default booleanChecks whether the ComponentAccess has the <componenttype:minecraft:unbreakable>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:writable_book_content>default booleanChecks whether the ComponentAccess has <componenttype:minecraft:written_book_content>default booleanGets the data in <componenttype:minecraft:hide_additional_tooltip>default booleanGets the data in <componenttype:minecraft:hide_tooltip>default booleanGets the data in <componenttype:minecraft:fire_resistant>default booleanGets the data in <componenttype:minecraft:intangible_projectile>default intGets the data in <componenttype:minecraft:repair_cost>default TwithAttributeModifiers(List<net.minecraft.world.item.component.ItemAttributeModifiers.Entry> modifiers, boolean showInTooltip) default TwithAttributeModifiers(net.minecraft.world.item.component.ItemAttributeModifiers modifiers) Sets the <componenttype:minecraft:attribute_modifiers> of the ComponentAccess to have the givenItemAttributeModifiersdefault TwithAttributeModifiers(net.minecraft.world.item.component.ItemAttributeModifiers.Entry modifier, boolean showInTooltip) default TwithBannerPatterns(List<net.minecraft.world.level.block.entity.BannerPatternLayers.Layer> layers) Sets the <componenttype:minecraft:banner_patterns> of the ComponentAccess to have the givenList<net.minecraft.world.level.block.entity.BannerPatternLayers.Layer>default TwithBannerPatterns(net.minecraft.world.level.block.entity.BannerPatternLayers layers) Sets the <componenttype:minecraft:banner_patterns> of the ComponentAccess to have the givenBannerPatternLayersdefault TwithBaseColor(net.minecraft.world.item.DyeColor color) Sets the <componenttype:minecraft:base_color> of the ComponentAccess to have the givenDyeColordefault TSets the <componenttype:minecraft:bees> of the ComponentAccess to have the given occupantsdefault TwithBlockEntityData(MapData data) Sets the <componenttype:minecraft:block_entity_data> of the ComponentAccess to have the givenMapDatadefault TwithBlockEntityData(net.minecraft.world.item.component.CustomData data) Sets the <componenttype:minecraft:block_entity_data> of the ComponentAccess to have the givenCustomDatadefault TwithBlockState(net.minecraft.world.item.component.BlockItemStateProperties properties) Sets the <componenttype:minecraft:block_state> of the ComponentAccess to have the givenBlockItemStatePropertiesdefault TwithBucketEntityData(MapData data) Sets the <componenttype:minecraft:bucket_entity_data> of the ComponentAccess to have the givenMapDatadefault TwithBucketEntityData(net.minecraft.world.item.component.CustomData data) Sets the <componenttype:minecraft:bucket_entity_data> of the ComponentAccess to have the givenCustomDatadefault TwithBundleContents(List<IItemStack> contents) Sets the <componenttype:minecraft:bundle_contents> of the ComponentAccess to have the given contentsdefault TwithBundleContents(net.minecraft.world.item.component.BundleContents contents) Sets the <componenttype:minecraft:bundle_contents> of the ComponentAccess to have the givenBundleContentsdefault TwithCanBreak(List<net.minecraft.advancements.critereon.BlockPredicate> predicates, boolean showInTooltip) Sets the <componenttype:minecraft:can_break> with the given BlockPredicates.default TwithCanBreak(net.minecraft.world.item.AdventureModePredicate predicate) Sets the <componenttype:minecraft:can_break> of the ComponentAccess to have the givenAdventureModePredicatedefault TwithCanPlaceOn(List<net.minecraft.advancements.critereon.BlockPredicate> predicates, boolean showInTooltip) Sets the <componenttype:minecraft:can_place_on> with the given BlockPredicates.default TwithCanPlaceOn(net.minecraft.world.item.AdventureModePredicate predicate) Sets the <componenttype:minecraft:can_place_on> of the ComponentAccess to have the givenAdventureModePredicatedefault TSets the <componenttype:minecraft:charged_projectiles> of the ComponentAccess to have the givenIItemStackdefault TwithChargedProjectiles(List<IItemStack> items) Sets the <componenttype:minecraft:charged_projectiles> of the ComponentAccess to have the given items.default TwithChargedProjectiles(net.minecraft.world.item.component.ChargedProjectiles chargedProjectiles) Sets the <componenttype:minecraft:charged_projectiles> of the ComponentAccess to have the givenChargedProjectilesdefault TwithContainer(List<IItemStack> contents) Sets the <componenttype:minecraft:container> of the ComponentAccess to have the given values.default TwithContainer(net.minecraft.world.item.component.ItemContainerContents contents) Sets the <componenttype:minecraft:container> of the ComponentAccess to have the givenItemContainerContentsdefault TwithContainerLoot(net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable> lootTable, long seed) Sets the <componenttype:minecraft:container_loot> of the ComponentAccess to have the given loot table and seed.default TwithContainerLoot(net.minecraft.world.item.component.SeededContainerLoot loot) Sets the <componenttype:minecraft:container_loot> of the ComponentAccess to have the givenSeededContainerLootdefault TSets the <componenttype:minecraft:creative_slot_lock> of the ComponentAccess to exist.default TwithCustomData(MapData customData) Sets the invalid input: '<'componenttype:minecraft:custom_data> of the ComponentAccess to have the givenMapDatadefault TwithCustomData(net.minecraft.world.item.component.CustomData customData) Sets the <componenttype:minecraft:custom_data> of the ComponentAccess to have the givenCustomDatadefault TwithCustomModelData(int value) Sets the <componenttype:minecraft:custom_model_data> of the ComponentAccess to have the given value.default TwithCustomModelData(net.minecraft.world.item.component.CustomModelData data) default TwithCustomName(net.minecraft.network.chat.Component name) Sets the <componenttype:minecraft:custom_name> of the ComponentAccess.default TwithDamage(int damage) Sets the <componenttype:minecraft:damage> of the ComponentAccess to have the given value.default TwithDebugStickState(net.minecraft.world.item.component.DebugStickState state) Sets the <componenttype:minecraft:debug_stick_state> of the ComponentAccess to have the givenDebugStickStatedefault TwithDyedColor(int rgb, boolean showInTooltip) Sets the <componenttype:minecraft:dyed_color> of the ComponentAccess.default TwithDyedColor(net.minecraft.world.item.component.DyedItemColor color) Sets the <componenttype:minecraft:dyed_color> of the ComponentAccess to have the givenDyedItemColordefault TwithEnchantment(net.minecraft.world.item.enchantment.Enchantment enchantment, int level) Sets the <componenttype:minecraft:enchantments> of the ComponentAccess to have the givenEnchantmentand level.default TwithEnchantmentGlintOverride(boolean value) Sets the <componenttype:minecraft:enchantment_glint_override> of the ComponentAccess to have the given value.default TwithEnchantments(net.minecraft.world.item.enchantment.ItemEnchantments enchantments) Sets the <componenttype:minecraft:enchantments> of the ComponentAccess to have the givenItemEnchantmentsdefault TwithEntityData(MapData data) Sets the <componenttype:minecraft:entity_data> of the ComponentAccess to have the givenMapDatadefault TwithEntityData(net.minecraft.world.item.component.CustomData data) Sets the <componenttype:minecraft:entity_data> of the ComponentAccess to have the givenCustomDatadefault TSets the <componenttype:minecraft:fire_resistant> of the ComponentAccess to exist.default TwithFireworkExplosion(net.minecraft.world.item.component.FireworkExplosion explosion) Sets the <componenttype:minecraft:firework_explosion> of the ComponentAccess to have the givenFireworkExplosiondefault TwithFireworks(int flightDuration, List<net.minecraft.world.item.component.FireworkExplosion> explosions) Sets the <componenttype:minecraft:fireworks> of the ComponentAccess to have the given duration and explosions.default TwithFireworks(net.minecraft.world.item.component.Fireworks fireworks) Sets the <componenttype:minecraft:fireworks> of the ComponentAccess to have the givenFireworksdefault TwithFood(net.minecraft.world.food.FoodProperties food) Sets the <componenttype:minecraft:food> of the ComponentAccess to have the givenFoodPropertiesdefault TSets the <componenttype:minecraft:hide_additional_tooltip> of the ComponentAccess to exist.default TSets the <componenttype:minecraft:hide_tooltip> of the ComponentAccess to exist.default TwithInstrument(net.minecraft.world.item.Instrument instrument) Sets the <componenttype:minecraft:instrument> of the ComponentAccess to have the givenInstrumentdefault TSets the <componenttype:minecraft:intangible_projectile> of the ComponentAccess to exist.default TwithItemName(net.minecraft.network.chat.Component name) Sets the <componenttype:minecraft:item_name> of the ComponentAccess to have the givenComponentdefault TSets the <componenttype:minecraft:lock> of the ComponentAccess to have the given string.default TwithLock(net.minecraft.world.LockCode lock) Sets the <componenttype:minecraft:lock> of the ComponentAccess to have the givenLockCodedefault TwithLodestoneTracker(net.minecraft.world.item.component.LodestoneTracker tracker) Sets the <componenttype:minecraft:lodestone_tracker> of the ComponentAccess to have the givenLodestoneTrackerdefault TSets the <componenttype:minecraft:lore> of the ComponentAccess to have the given stdlib.List<Component>default TwithLore(net.minecraft.network.chat.Component components) default TwithLore(net.minecraft.world.item.component.ItemLore lore) Sets the <componenttype:minecraft:lore> of the ComponentAccess to have the givenItemLoredefault TwithMapColor(int rgb) Sets the <componenttype:minecraft:map_color> of the ComponentAccess.default TwithMapColor(net.minecraft.world.item.component.MapItemColor color) Sets the <componenttype:minecraft:map_color> of the ComponentAccess to have the givenMapItemColordefault TwithMapDecorations(Map<String, net.minecraft.world.item.component.MapDecorations.Entry> decorations) Sets the <componenttype:minecraft:map_decorations> of the ComponentAccess to have the given values.default TwithMapDecorations(net.minecraft.world.item.component.MapDecorations decorations) Sets the <componenttype:minecraft:map_decorations> of the ComponentAccess to have the givenMapDecorationsdefault TwithMapId(int id) Sets the <componenttype:minecraft:map_id> of the ComponentAccess to have the given value.default TwithMapId(net.minecraft.world.level.saveddata.maps.MapId mapId) Sets the <componenttype:minecraft:map_id> of the ComponentAccess to have the givenMapIddefault TwithMapPostProcessing(net.minecraft.world.item.component.MapPostProcessing value) Sets the <componenttype:minecraft:map_post_processing> of the ComponentAccess to have the givenMapPostProcessingdefault TwithMaxDamage(int maxDamage) Sets the <componenttype:minecraft:max_damage> of the ComponentAccess to have the given value.default TwithMaxStackSize(int maxStackSize) Sets the <componenttype:minecraft:stack_size> of the ComponentAccess to have the given value.default TwithNoteBlockSound(net.minecraft.resources.ResourceLocation sound) Sets the <componenttype:minecraft:note_block_sound> of the ComponentAccess to have the givenResourceLocationdefault TwithOminousBottleAmplifier(int amplifier) Sets the <componenttype:minecraft:ominous_bottle_amplifier> of the ComponentAccess to have the given amplifier.default TRemoves the <componenttype:minecraft:attribute_modifiers> from the ComponentAccess.default TRemoves the <componenttype:minecraft:banner_patterns> from the ComponentAccess.default TRemoves the <componenttype:minecraft:base_color> from the ComponentAccess.default TRemoves the <componenttype:minecraft:bees> from the ComponentAccess.default TRemoves the <componenttype:minecraft:block_entity_data> from the ComponentAccess.default TRemoves the <componenttype:minecraft:block_state> from the ComponentAccess.default TRemoves the <componenttype:minecraft:bucket_entity_data> from the ComponentAccess.default TRemoves the <componenttype:minecraft:bundle_contents> from the ComponentAccess.default TRemoves the <componenttype:minecraft:can_break> from the ComponentAccess.default TRemoves the <componenttype:minecraft:can_place_on> from the ComponentAccess.default TRemoves the <componenttype:minecraft:charged_projectiles> from the ComponentAccess.default TRemoves the <componenttype:minecraft:container> from the ComponentAccess.default TRemoves the <componenttype:minecraft:container_loot> from the ComponentAccess.default TRemoves the <componenttype:minecraft:creative_slot_lock> from the ComponentAccess.default TRemoves the <componenttype:minecraft:custom_data> from the ComponentAccess.default TRemoves the <componenttype:minecraft:custom_model_data> from the ComponentAccess.default TRemoves the <componenttype:minecraft:custom_name> from the ComponentAccessdefault TRemoves the <componenttype:minecraft:damage> from the ComponentAccess.default TRemoves the <componenttype:minecraft:debug_stick_state> from the ComponentAccess.default TRemoves the <componenttype:minecraft:dyed_color> from the ComponentAccess.default TwithoutEnchantment(net.minecraft.world.item.enchantment.Enchantment enchantment) Removes theEnchantmentfrom the ComponentAccess.default TRemoves the <componenttype:minecraft:enchantment_glint_override> from the ComponentAccess.default TRemoves the <componenttype:minecraft:enchantments> from the ComponentAccess.default TRemoves the <componenttype:minecraft:entity_data> from the ComponentAccess.default TRemoves the <componenttype:minecraft:fire_resistant> from the ComponentAccess.default TRemoves the <componenttype:minecraft:firework_explosion> from the ComponentAccess.default TRemoves the <componenttype:minecraft:fireworks> from the ComponentAccess.default TRemoves the <componenttype:minecraft:food> from the ComponentAccess.default TRemoves the <componenttype:minecraft:hide_additional_tooltip> from the ComponentAccess.default TRemoves the <componenttype:minecraft:hide_tooltip> from the ComponentAccess.default TRemoves the <componenttype:minecraft:instrument> from the ComponentAccess.default TRemoves the <componenttype:minecraft:intangible_projectile> from the ComponentAccess.default TRemoves the <componenttype:minecraft:item_name> from the ComponentAccess.default TRemoves the <componenttype:minecraft:lock> from the ComponentAccess.default TRemoves the <componenttype:minecraft:lodestone_tracker> from the ComponentAccess.default TRemoves the <componenttype:minecraft:lore> from the ComponentAccess.default TRemoves the <componenttype:minecraft:map_color> from the ComponentAccess.default TRemoves the <componenttype:minecraft:map_decorations> from the ComponentAccess.default TRemoves the <componenttype:minecraft:map_id> from the ComponentAccess.default TRemoves the <componenttype:minecraft:map_post_processing> from the ComponentAccess.default TRemoves the <componenttype:minecraft:max_damage> from the ComponentAccess.default TRemoves the <componenttype:minecraft:stack_size> from the ComponentAccess.default TRemoves the <componenttype:minecraft:note_block_sound> from the ComponentAccess.default TRemoves the <componenttype:minecraft:ominous_bottle_amplifier> from the ComponentAccess.default TRemoves the <componenttype:minecraft:pot_decorations> from the ComponentAccess.default TRemoves the <componenttype:minecraft:potion_contents> from the ComponentAccess.default TRemoves the <componenttype:minecraft:profile> from the ComponentAccess.default TRemoves the <componenttype:minecraft:rarity> from the ComponentAccess.default TRemoves the <componenttype:minecraft:recipes> from the ComponentAccess.default TRemoves the <componenttype:minecraft:repair_cost> from the ComponentAccess.default TRemoves the <componenttype:minecraft:stored_enchantments> from the ComponentAccess.default TRemoves the <componenttype:minecraft:suspicious_stew_effects> from the ComponentAccess.default TRemoves the <componenttype:minecraft:tool> from the ComponentAccess.default TRemoves the <componenttype:minecraft:trim> from the ComponentAccess.default TRemoves the <componenttype:minecraft:unbreakable> from the ComponentAccessdefault TRemoves the <componenttype:minecraft:writable_book_content> from the ComponentAccess.default TRemoves the <componenttype:minecraft:written_book_content> from the ComponentAccess.default TwithPotDecorations(net.minecraft.world.item.Item back, net.minecraft.world.item.Item left, net.minecraft.world.item.Item right, net.minecraft.world.item.Item front) Sets the <componenttype:minecraft:pot_decorations> of the ComponentAccess to have the given items.default TwithPotDecorations(net.minecraft.world.level.block.entity.PotDecorations decorations) Sets the <componenttype:minecraft:pot_decorations> of the ComponentAccess to have the givenPotDecorationsdefault TwithPotionContents(net.minecraft.world.item.alchemy.Potion potion) Sets the <componenttype:minecraft:potion_contents> of the ComponentAccess to have the givenPotionand no custom effectsdefault TwithPotionContents(net.minecraft.world.item.alchemy.PotionContents contents) Sets the <componenttype:minecraft:potion_contents> of the ComponentAccess to have the givenPotionContentsdefault TwithPotionContents(net.minecraft.world.item.alchemy.Potion potion, int customColor, List<net.minecraft.world.effect.MobEffectInstance> customEffects) Sets the <componenttype:minecraft:potion_contents> of the ComponentAccess to have the givenPotionand the givenMobEffectInstanceeffects.default TwithPotionContents(net.minecraft.world.item.alchemy.Potion potion, List<net.minecraft.world.effect.MobEffectInstance> customEffects) Sets the <componenttype:minecraft:potion_contents> of the ComponentAccess to have the givenPotionand the givenMobEffectInstanceeffects.default TwithProfile(net.minecraft.world.item.component.ResolvableProfile profile) Sets the <componenttype:minecraft:profile> of the ComponentAccess to have the givenResolvableProfiledefault TwithRarity(net.minecraft.world.item.Rarity rarity) Sets the <componenttype:minecraft:rarity> of the ComponentAccess to have the givenRaritydefault TwithRecipes(List<net.minecraft.resources.ResourceLocation> recipes) Sets the <componenttype:minecraft:recipes> of the ComponentAccess to have the givenList<net.minecraft.resources.ResourceLocation>default TwithRepairCost(int cost) Sets the <componenttype:minecraft:repair_cost> of the ComponentAccess to have the given value.default TwithStoredEnchantments(net.minecraft.world.item.enchantment.ItemEnchantments enchantments) Sets the <componenttype:minecraft:stored_enchantments> of the ComponentAccess to have the givenItemEnchantmentsdefault TwithSuspiciousStewEffects(List<net.minecraft.world.item.component.SuspiciousStewEffects.Entry> effects) Sets the <componenttype:minecraft:suspicious_stew_effects> of the ComponentAccess to have the givenSuspiciousStewEffectsSuspiciousStewEffects.Entryis effectively a pair of Effect and duration.default TwithSuspiciousStewEffects(net.minecraft.world.item.component.SuspiciousStewEffects suspiciousStewEffects) Sets the <componenttype:minecraft:suspicious_stew_effects> of the ComponentAccess to have the givenSuspiciousStewEffectsdefault TwithTool(List<net.minecraft.world.item.component.Tool.Rule> rules, float defaultMiningSpeed, int damagePerBlock) Sets the <componenttype:minecraft:tool> of the ComponentAccess to have the given data.default TwithTool(net.minecraft.world.item.component.Tool tool) Sets the <componenttype:minecraft:tool> of the ComponentAccess to have the givenTooldefault TwithTrim(net.minecraft.world.item.armortrim.ArmorTrim trim) Sets the <componenttype:minecraft:trim> of the ComponentAccess to have the givenArmorTrimdefault TwithUnbreakable(boolean showInTooltip) Sets the <componenttype:minecraft:unbreakable> of the ComponentAccess.default TwithUnbreakable(net.minecraft.world.item.component.Unbreakable unbreakable) Sets the <componenttype:minecraft:unbreakable> of the ComponentAccess.default TwithWritableBookContent(List<net.minecraft.server.network.Filterable<String>> pages) default TwithWritableBookContent(net.minecraft.world.item.component.WritableBookContent content) Sets the <componenttype:minecraft:writable_book_content> of the ComponentAccess to have the givenWritableBookContentdefault TwithWrittenBookContent(net.minecraft.world.item.component.WrittenBookContent content) Sets the <componenttype:minecraft:written_book_content> of the ComponentAccess to have the givenWrittenBookContent
-
Method Details
-
hasCustomData
default boolean hasCustomData()Checks whether the ComponentAccess has the <componenttype:minecraft:custom_data>- Returns:
- Whether the componenttype is stored.
-
getCustomData
default net.minecraft.world.item.component.CustomData getCustomData()Gets the data in the <componenttype:minecraft:custom_data>- Returns:
- A
CustomDatathat wraps around aMapDataobject containing the data.
-
withCustomData
Sets the invalid input: '<'componenttype:minecraft:custom_data> of the ComponentAccess to have the givenMapData- Parameters:
customData- The MapData to set the component to.- Returns:
- The new instance with the modified data.
- DocParam:
- customData {custom_ammo_thing: 1, owner: "Benji"}
-
withCustomData
Sets the <componenttype:minecraft:custom_data> of the ComponentAccess to have the givenCustomData- Returns:
- The new instance with the modified data.
-
withoutCustomData
Removes the <componenttype:minecraft:custom_data> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasMaxStackSize
default boolean hasMaxStackSize()Checks whether the ComponentAccess has the <componenttype:minecraft:max_stack_size>- Returns:
- Whether the componenttype is stored.
-
getMaxStackSize
default int getMaxStackSize()Gets the data in the <componenttype:minecraft:max_stack_size>- Returns:
- An int with the max stack size of the ComponentAccess.
-
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!- Parameters:
maxStackSize- The new maxStackSize of the ComponentAccess.- Returns:
- The new instance with the modified data.
- DocParam:
- maxStackSize 16
-
withoutMaxStackSize
Removes the <componenttype:minecraft:stack_size> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasMaxDamage
default boolean hasMaxDamage()Checks whether the ComponentAccess has the <componenttype:minecraft:max_damage>- Returns:
- Whether the componenttype is stored.
-
getMaxDamage
default int getMaxDamage()Gets the data in the <componenttype:minecraft:max_damage>- Returns:
- An int returning the maximum durability, damage or uses.
-
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.
- DocParam:
- maxDamage 1024, maxDamage 1024
-
withoutMaxDamage
Removes the <componenttype:minecraft:max_damage> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasDamage
default boolean hasDamage()Checks whether the ComponentAccess has the <componenttype:minecraft:damage>- Returns:
- Whether the componenttype is stored.
-
getDamage
default int getDamage()Gets the data in the <componenttype:minecraft:damage>- Returns:
- An int returning the current durability, damage or uses.
-
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.- Parameters:
damage- The new damage of the ComponentAccess.- Returns:
- The new instance with the modified data.
- DocParam:
- damage 16
-
withoutDamage
Removes the <componenttype:minecraft:damage> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasUnbreakable
default boolean hasUnbreakable()Checks whether the ComponentAccess has the <componenttype:minecraft:unbreakable>- Returns:
- Whether the componenttype is stored.
-
getUnbreakable
default net.minecraft.world.item.component.Unbreakable getUnbreakable()Gets the data in the <componenttype:minecraft:unbreakable>- Returns:
- An
Unbreakablecontaining the configuration of the Component.
-
withUnbreakable
Sets the <componenttype:minecraft:unbreakable> of the ComponentAccess. The existance of the component makes the ComponentAccess unbreakable.- Parameters:
showInTooltip- Whether to show that the ComponentAccess is unbreakable in a tooltip.- Returns:
- The new instance with the modified data.
-
withUnbreakable
Sets the <componenttype:minecraft:unbreakable> of the ComponentAccess. The existance of the component makes the ComponentAccess unbreakable.- Parameters:
unbreakable- TheUnbreakableinstance with the configured values.- Returns:
- The new instance with the modified data.
-
withoutUnbreakable
Removes the <componenttype:minecraft:unbreakable> from the ComponentAccess- Returns:
- The new instance with the modified data.
-
hasCustomName
default boolean hasCustomName()Checks whether the ComponentAccess has the <componenttype:minecraft:custom_name>- Returns:
- Whether the componenttype is stored.
-
getCustomName
default net.minecraft.network.chat.Component getCustomName()Gets the data in the <componenttype:minecraft:custom_name> A custom name is generally displayed in italics and controlled by the user.- Returns:
- A
Componentrepresenting the ComponentAccess's custom name.
-
withCustomName
Sets the <componenttype:minecraft:custom_name> of the ComponentAccess.- Parameters:
name- The component to use.- Returns:
- The new instance with the modified data.
- DocParam:
- name Component.literal("Fancy Water"), name Component.translatable("mypack.lore.fancy_water")
-
withoutCustomName
Removes the <componenttype:minecraft:custom_name> from the ComponentAccess- Returns:
- The new instance with the modified data.
-
hasItemName
default boolean hasItemName()Checks whether the ComponentAccess has the <componenttype:minecraft:item_namegt;- Returns:
- Whether the componenttype is stored.
-
getItemName
default net.minecraft.network.chat.Component getItemName()Gets the data in the <componenttype:minecraft:item_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.- Returns:
- A
Componentrepresenting the ComponentAccess's custom name.
-
withItemName
Sets the <componenttype:minecraft:item_name> of the ComponentAccess to have the givenComponent- Returns:
- The new instance with the modified data.
- DocParam:
- name Component.literal("Fancy Water"), name Component.translatable("mypack.lore.fancy_water")
-
withoutItemName
Removes the <componenttype:minecraft:item_name> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasLore
default boolean hasLore()Checks whether the ComponentAccess has the <componenttype:minecraft:lore>- Returns:
- Whether the componenttype is stored.
-
getLore
default net.minecraft.world.item.component.ItemLore getLore()Gets the data in the <componenttype:minecraft:lore>- Returns:
- A
ItemLoreinstance, which effectively behaves as a stdlib.List<Component>.
-
withLore
Sets the <componenttype:minecraft:lore> of the ComponentAccess to have the given stdlib.List<Component>- Parameters:
components- The list of Components to add as lore.- Returns:
- The new instance with the modified data.
- DocParam:
- components [Component.literal("Found in a dark cave"), Component.translatable("Belonged to a Dragon")]
-
withLore
-
withLore
Sets the <componenttype:minecraft:lore> of the ComponentAccess to have the givenItemLore- Returns:
- The new instance with the modified data.
-
withoutLore
Removes the <componenttype:minecraft:lore> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasRarity
default boolean hasRarity()Checks whether the ComponentAccess has the <componenttype:minecraft:rarity>- Returns:
- Whether the componenttype is stored.
-
getRarity
default net.minecraft.world.item.Rarity getRarity()Gets the data in the <componenttype:minecraft:rarity>- Returns:
- A
Rarity
-
withRarity
Sets the <componenttype:minecraft:rarity> of the ComponentAccess to have the givenRarity- Parameters:
rarity- The rarity to set- Returns:
- The new instance with the modified data.
- DocParam:
- rarity invalid input: '<'constant:minecraft:item/rarity:epic>
-
withoutRarity
Removes the <componenttype:minecraft:rarity> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasEnchantments
default boolean hasEnchantments()Checks whether the ComponentAccess has the <componenttype:minecraft:enchantments>- Returns:
- Whether the componenttype is stored.
-
getEnchantments
default net.minecraft.world.item.enchantment.ItemEnchantments getEnchantments()Gets the data in <componenttype:minecraft:enchantments>- Returns:
- A
ItemEnchantmentsinstance
-
withEnchantments
Sets the <componenttype:minecraft:enchantments> of the ComponentAccess to have the givenItemEnchantments- Returns:
- The new instance with the modified data.
-
withEnchantment
Sets the <componenttype:minecraft:enchantments> of the ComponentAccess to have the givenEnchantmentand level.- Parameters:
enchantment- The enchantment to addlevel- The level of the enchantment to set- Returns:
- The new instance with the modified data.
- DocParam:
- enchantment invalid input: '<'enchantment:minecraft:efficiency>, level 4
-
withoutEnchantment
Removes theEnchantmentfrom the ComponentAccess.- Parameters:
enchantment- TheEnchantmentto remove- Returns:
- The new instance with the modified data.
- DocParam:
- enchantment invalid input: '<'enchantment:minecraft:mending>
-
withoutEnchantments
Removes the <componenttype:minecraft:enchantments> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasCanPlaceOn
default boolean hasCanPlaceOn()Checks whether the ComponentAccess has <componenttype:minecraft:can_place_on>- Returns:
- Whether the componenttype is stored.
-
getCanPlaceOn
default net.minecraft.world.item.AdventureModePredicate getCanPlaceOn()Gets the data in <componenttype:minecraft:can_place_on>- Returns:
- An
AdventureModePredicateinstance that holds data on whether a Block is placeable in adventure mode.
-
withCanPlaceOn
default T withCanPlaceOn(List<net.minecraft.advancements.critereon.BlockPredicate> predicates, boolean showInTooltip) 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.- Parameters:
predicates- The collection of predicates to test forshowInTooltip- Whether to show the restriction in the tooltip or not.- Returns:
- The new instance with the modified data.
- DocParam:
- predicates BlockPredicate.create().of(invalid input: '<'block:minecraft:dirt>).build()
-
withCanPlaceOn
Sets the <componenttype:minecraft:can_place_on> of the ComponentAccess to have the givenAdventureModePredicate- Parameters:
predicate- The adventure mode predicate to use to determine whether the current block can be placed on another block.- Returns:
- The new instance with the modified data.
-
withoutCanPlaceOn
Removes the <componenttype:minecraft:can_place_on> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasCanBreak
default boolean hasCanBreak()Checks whether the ComponentAccess has <componenttype:minecraft:can_break>- Returns:
- Whether the componenttype is stored.
-
getCanBreak
default net.minecraft.world.item.AdventureModePredicate getCanBreak()Gets the data in <componenttype:minecraft:can_break>- Returns:
- An
AdventureModePredicateinstance that holds data on whether a Block is breakable using this Item.
-
withCanBreak
default T withCanBreak(List<net.minecraft.advancements.critereon.BlockPredicate> predicates, boolean showInTooltip) Sets the <componenttype:minecraft:can_break> with the given BlockPredicates. Any predicate that matches will allow the Block to be broken by this ItemStack.- Parameters:
predicates- The collection of predicates to test forshowInTooltip- Whether to show the ability in the tooltip or not.- Returns:
- The new instance with the modified data.
- DocParam:
- predicates BlockPredicate.create().of(invalid input: '<'block:minecraft:diamond_ore>).build(), showInTooltip true
-
withCanBreak
Sets the <componenttype:minecraft:can_break> of the ComponentAccess to have the givenAdventureModePredicate- Parameters:
predicate- The adventure mode predicate to use to determine whether the item can be used to break a block.- Returns:
- The new instance with the modified data.
-
withoutCanBreak
Removes the <componenttype:minecraft:can_break> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasAttributeModifiers
default boolean hasAttributeModifiers()Checks whether the ComponentAccess has <componenttype:minecraft:attribute_modifiers>- Returns:
- Whether the componenttype is stored.
-
getAttributeModifiers
default net.minecraft.world.item.component.ItemAttributeModifiers getAttributeModifiers()Gets the data in <componenttype:minecraft:attribute_modifiers>- Returns:
- An
ItemAttributeModifiers.
-
withAttributeModifiers
default T withAttributeModifiers(net.minecraft.world.item.component.ItemAttributeModifiers modifiers) Sets the <componenttype:minecraft:attribute_modifiers> of the ComponentAccess to have the givenItemAttributeModifiers- Parameters:
modifiers- The attributes to give to the item.- Returns:
- The new instance with the modified data.
- DocParam:
- modifiers ItemAttributeModifiers.builder().add(invalid input: '<'attribute:minecraft:player.block_break_speed>, AttributeModifier.create("test", 2.0, invalid input: '<'constant:minecraft:attribute/operation:add_value>, "596e0826-7c66-42c6-b3da-45a6d667ccf7"), invalid input: '<'constant:minecraft:equipmentslot/group:mainhand>).build();
-
withAttributeModifiers
default T withAttributeModifiers(net.minecraft.world.item.component.ItemAttributeModifiers.Entry modifier, boolean showInTooltip) - Returns:
- The new instance with the modified data.
-
withAttributeModifiers
-
withoutAttributeModifiers
Removes the <componenttype:minecraft:attribute_modifiers> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasCustomModelData
default boolean hasCustomModelData()Checks whether the ComponentAccess has <componenttype:minecraft:custom_model_data>- Returns:
- Whether the componenttype is stored.
-
getCustomModelData
default net.minecraft.world.item.component.CustomModelData getCustomModelData()Gets the data in <componenttype:minecraft:custom_model_data>- Returns:
- A
CustomModelData
-
withCustomModelData
Sets the <componenttype:minecraft:custom_model_data> of the ComponentAccess to have the given value.- Parameters:
value- The value to set the CustomModelData to- Returns:
- The new instance with the modified data.
- DocParam:
- value 2
-
withCustomModelData
- Returns:
- The new instance with the modified data.
-
withoutCustomModelData
Removes the <componenttype:minecraft:custom_model_data> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hideAdditionalTooltip
default boolean hideAdditionalTooltip()Gets the data in <componenttype:minecraft:hide_additional_tooltip>- Returns:
- A boolean representing whether to hide the additional tooltip.
-
withHideAdditionalTooltip
Sets the <componenttype:minecraft:hide_additional_tooltip> of the ComponentAccess to exist.- Returns:
- The new instance with the modified data.
-
withoutHideAdditionalTooltip
Removes the <componenttype:minecraft:hide_additional_tooltip> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hideTooltip
default boolean hideTooltip()Gets the data in <componenttype:minecraft:hide_tooltip>- Returns:
- A boolean representing whether to hide the tooltip.
-
withHideTooltip
Sets the <componenttype:minecraft:hide_tooltip> of the ComponentAccess to exist.- Returns:
- The new instance with the modified data.
-
withoutHideTooltip
Removes the <componenttype:minecraft:hide_tooltip> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasRepairCost
default boolean hasRepairCost()Checks whether the ComponentAccess has <componenttype:minecraft:repair_cost>- Returns:
- Whether the componenttype is stored.
-
repairCost
default int repairCost()Gets the data in <componenttype:minecraft:repair_cost>- Returns:
- An int representing the repair cost of the item. Used for anvil and grindstone xp.
-
withRepairCost
Sets the <componenttype:minecraft:repair_cost> of the ComponentAccess to have the given value.- Parameters:
cost- The repair cost- Returns:
- The new instance with the modified data.
- DocParam:
- cost 20
-
withoutRepairCost
Removes the <componenttype:minecraft:repair_cost> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
creativeSlotLock
default boolean creativeSlotLock()Gets the data in <componenttype:minecraft:creative_slot_lock>- Returns:
- A boolean representing whether to disallow picking up the item from the creative menu.
-
withCreativeSlotLock
Sets the <componenttype:minecraft:creative_slot_lock> of the ComponentAccess to exist.- Returns:
- The new instance with the modified data.
-
withoutCreativeSlotLock
Removes the <componenttype:minecraft:creative_slot_lock> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasEnchantmentGlintOverride
default boolean hasEnchantmentGlintOverride()Checks whether the ComponentAccess has <componenttype:minecraft:enchantment_glint_override>- Returns:
- Whether the componenttype is stored.
-
getEnchantmentGlintOverride
default boolean getEnchantmentGlintOverride()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.- Returns:
- A boolean representing whether to override enchantment glint rendering.
-
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.- Parameters:
value- The value of the override, as described above- Returns:
- The new instance with the modified data.
- DocParam:
- value true
-
withoutEnchantmentGlintOverride
Removes the <componenttype:minecraft:enchantment_glint_override> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
isIntangibleProjectile
default boolean isIntangibleProjectile()Gets the data in <componenttype:minecraft:intangible_projectile>- Returns:
- A boolean representing whether the projectile is intangible.
-
withIntangibleProjectile
Sets the <componenttype:minecraft:intangible_projectile> of the ComponentAccess to exist.- Returns:
- The new instance with the modified data.
-
withoutIntangibleProjectile
Removes the <componenttype:minecraft:intangible_projectile> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasFood
default boolean hasFood()Checks whether the ComponentAccess has <componenttype:minecraft:food>- Returns:
- Whether the componenttype is stored.
-
getFood
default net.minecraft.world.food.FoodProperties getFood()Gets the data in <componenttype:minecraft:food>- Returns:
- A
FoodPropertiesinstance.
-
withFood
Sets the <componenttype:minecraft:food> of the ComponentAccess to have the givenFoodProperties- Returns:
- The new instance with the modified data.
-
withoutFood
Removes the <componenttype:minecraft:food> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
isFireResistant
default boolean isFireResistant()Gets the data in <componenttype:minecraft:fire_resistant>- Returns:
- A boolean representing whether to resist fire.
-
withFireResistant
Sets the <componenttype:minecraft:fire_resistant> of the ComponentAccess to exist.- Returns:
- The new instance with the modified data.
-
withoutFireResistant
Removes the <componenttype:minecraft:fire_resistant> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasTool
default boolean hasTool()Checks whether the ComponentAccess has <componenttype:minecraft:tool>- Returns:
- Whether the componenttype is stored.
-
getTool
default net.minecraft.world.item.component.Tool getTool()Gets the data in <componenttype:minecraft:tool>- Returns:
- A
Toolinstance.
-
withTool
default T withTool(List<net.minecraft.world.item.component.Tool.Rule> rules, float defaultMiningSpeed, int damagePerBlock) Sets the <componenttype:minecraft:tool> of the ComponentAccess to have the given data. AToolinstance is constructed from the parameters.- Parameters:
rules- The list of rules the new Tool instance will havedefaultMiningSpeed- The default mining speed of the new tooldamagePerBlock- The damage or durability that is dealt to the Tool after use.- Returns:
- The new instance with the modified data.
- DocParam:
- rules [ToolRule.minesAndDrops(invalid input: '<'tag:blocks:minecraft:planks>, 6.0f)], defaultMiningSpeed 0.25f, damagePerBlock 1
-
withTool
Sets the <componenttype:minecraft:tool> of the ComponentAccess to have the givenTool- Returns:
- The new instance with the modified data.
-
withoutTool
Removes the <componenttype:minecraft:tool> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasStoredEnchantments
default boolean hasStoredEnchantments()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.- Returns:
- Whether the componenttype is stored.
-
getStoredEnchantments
default net.minecraft.world.item.enchantment.ItemEnchantments getStoredEnchantments()Gets the data in <componenttype:minecraft:stored_enchantments>- Returns:
- An
ItemEnchantmentsinstance.
-
withStoredEnchantments
default T withStoredEnchantments(net.minecraft.world.item.enchantment.ItemEnchantments enchantments) Sets the <componenttype:minecraft:stored_enchantments> of the ComponentAccess to have the givenItemEnchantments- Returns:
- The new instance with the modified data.
-
withoutStoredEnchantments
Removes the <componenttype:minecraft:stored_enchantments> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasDyedColor
default boolean hasDyedColor()Checks whether the ComponentAccess has <componenttype:minecraft:dyed_color>- Returns:
- Whether the componenttype is stored.
-
getDyedColor
default net.minecraft.world.item.component.DyedItemColor getDyedColor()Gets the data in <componenttype:minecraft:dye_color>- Returns:
- A
DyedItemColorinstance.
-
withDyedColor
Sets the <componenttype:minecraft:dyed_color> of the ComponentAccess.- Parameters:
rgb- The colour to dye this item withshowInTooltip- Whether to show this information in a tooltip- Returns:
- The new instance with the modified data.
- DocParam:
- rgb 0xFFFF00, showInTooltip true
-
withDyedColor
Sets the <componenttype:minecraft:dyed_color> of the ComponentAccess to have the givenDyedItemColor- Returns:
- The new instance with the modified data.
-
withoutDyedColor
Removes the <componenttype:minecraft:dyed_color> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasMapColor
default boolean hasMapColor()Checks whether the ComponentAccess has <componenttype:minecraft:map_color>- Returns:
- Whether the componenttype is stored.
-
getMapColor
default net.minecraft.world.item.component.MapItemColor getMapColor()Gets the data in <componenttype:minecraft:map_color>- Returns:
- A
MapItemColorthat stores an RGB color..
-
withMapColor
Sets the <componenttype:minecraft:map_color> of the ComponentAccess.- Parameters:
rgb- The new map colour- Returns:
- The new instance with the modified data.
- DocParam:
- rgb 0xFF0000
-
withMapColor
Sets the <componenttype:minecraft:map_color> of the ComponentAccess to have the givenMapItemColor- Returns:
- The new instance with the modified data.
-
withoutMapColor
Removes the <componenttype:minecraft:map_color> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasMapId
default boolean hasMapId()Checks whether the ComponentAccess has <componenttype:minecraft:map_id>- Returns:
- Whether the componenttype is stored.
-
getMapId
default net.minecraft.world.level.saveddata.maps.MapId getMapId()Gets the data in <componenttype:minecraft:map_id>- Returns:
- A
MapId
-
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.
-
withMapId
Sets the <componenttype:minecraft:map_id> of the ComponentAccess to have the givenMapId- Returns:
- The new instance with the modified data.
-
withoutMapId
Removes the <componenttype:minecraft:map_id> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasMapDecorations
default boolean hasMapDecorations()Checks whether the ComponentAccess has <componenttype:minecraft:map_decorations> MapDecorations are additional elements that render on a map, such as waypoints.- Returns:
- Whether the componenttype is stored.
-
getMapDecorations
default net.minecraft.world.item.component.MapDecorations getMapDecorations()Gets the data in <componenttype:minecraft:map_decorations>- Returns:
- A
MapDecorations.
-
withMapDecorations
default T withMapDecorations(Map<String, net.minecraft.world.item.component.MapDecorations.Entry> decorations) Sets the <componenttype:minecraft:map_decorations> of the ComponentAccess to have the given values.- Returns:
- The new instance with the modified data.
-
withMapDecorations
Sets the <componenttype:minecraft:map_decorations> of the ComponentAccess to have the givenMapDecorations- Returns:
- The new instance with the modified data.
-
withoutMapDecorations
Removes the <componenttype:minecraft:map_decorations> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasMapPostProcessing
default boolean hasMapPostProcessing()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.- Returns:
- Whether the componenttype is stored.
-
getMapPostProcessing
default net.minecraft.world.item.component.MapPostProcessing getMapPostProcessing()Gets the data in <componenttype:minecraft:map_post_processing>- Returns:
- A
MapPostProcessing
-
withMapPostProcessing
Sets the <componenttype:minecraft:map_post_processing> of the ComponentAccess to have the givenMapPostProcessing- Returns:
- The new instance with the modified data.
-
withoutMapPostProcessing
Removes the <componenttype:minecraft:map_post_processing> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasChargedProjectiles
default boolean hasChargedProjectiles()Checks whether the ComponentAccess has <componenttype:minecraft:charged_projectiles> This component is used for crossbows.- Returns:
- Whether the componenttype is stored.
-
getChargedProjectiles
default net.minecraft.world.item.component.ChargedProjectiles getChargedProjectiles()Gets the data in <componenttype:minecraft:charged_projectiles>- Returns:
- A
ChargedProjectiles.
-
withChargedProjectiles
Sets the <componenttype:minecraft:charged_projectiles> of the ComponentAccess to have the givenIItemStack- Parameters:
item- The item to store within.- Returns:
- The new instance with the modified data.
- DocParam:
- item invalid input: '<'item:minecraft:arrow>
-
withChargedProjectiles
Sets the <componenttype:minecraft:charged_projectiles> of the ComponentAccess to have the given items.- Parameters:
items- The items to store within.- Returns:
- The new instance with the modified data.
- DocParam:
- items [invalid input: '<'item:minecraft:arrow>]
-
withChargedProjectiles
default T withChargedProjectiles(net.minecraft.world.item.component.ChargedProjectiles chargedProjectiles) Sets the <componenttype:minecraft:charged_projectiles> of the ComponentAccess to have the givenChargedProjectiles- Returns:
- The new instance with the modified data.
-
withoutChargedProjectiles
Removes the <componenttype:minecraft:charged_projectiles> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasBundleContents
default boolean hasBundleContents()Checks whether the ComponentAccess has <componenttype:minecraft:bundle_contents>- Returns:
- Whether the componenttype is stored.
-
getBundleContents
default net.minecraft.world.item.component.BundleContents getBundleContents()Gets the data in <componenttype:minecraft:bundle_contents>- Returns:
- A
BundleContents.
-
withBundleContents
Sets the <componenttype:minecraft:bundle_contents> of the ComponentAccess to have the given contents- Parameters:
contents- A list of items to store within.- Returns:
- The new instance with the modified data.
- DocParam:
- contents [invalid input: '<'item:minecraft:diamond> * 64]
-
withBundleContents
Sets the <componenttype:minecraft:bundle_contents> of the ComponentAccess to have the givenBundleContents- Returns:
- The new instance with the modified data.
-
withoutBundleContents
Removes the <componenttype:minecraft:bundle_contents> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasPotionContents
default boolean hasPotionContents()Checks whether the ComponentAccess has <componenttype:minecraft:potion_contents> Stores Potion Data on an item.- Returns:
- Whether the componenttype is stored.
-
getPotionContents
default net.minecraft.world.item.alchemy.PotionContents getPotionContents()Gets the data in <componenttype:minecraft:potion_contents>- Returns:
- A
PotionContents.
-
withPotionContents
Sets the <componenttype:minecraft:potion_contents> of the ComponentAccess to have the givenPotionand no custom effects- Parameters:
potion- The potion to store within- Returns:
- The new instance with the modified data.
- DocParam:
- potion invalid input: '<'potion:minecraft:swiftness>
-
withPotionContents
default T withPotionContents(net.minecraft.world.item.alchemy.Potion potion, List<net.minecraft.world.effect.MobEffectInstance> customEffects) Sets the <componenttype:minecraft:potion_contents> of the ComponentAccess to have the givenPotionand the givenMobEffectInstanceeffects.- Parameters:
potion- The potion to store within.customEffects- The effects to grant upon consuming this potion.- Returns:
- The new instance with the modified data.
- DocParam:
- potion invalid input: '<'potion:minecraft:swiftness>, customEffects [MobEffectInstance.of(invalid input: '<'mobeffect:minecraft:strength>, 20 * 20, 1, false, false, true)]
-
withPotionContents
default T withPotionContents(net.minecraft.world.item.alchemy.Potion potion, int customColor, List<net.minecraft.world.effect.MobEffectInstance> customEffects) Sets the <componenttype:minecraft:potion_contents> of the ComponentAccess to have the givenPotionand the givenMobEffectInstanceeffects.- Parameters:
potion- The potion to store within.customColor- The ARGB color the potion will have.customEffects- The effects to grant upon consuming this potion.- Returns:
- The new instance with the modified data.
- DocParam:
- potion invalid input: '<'potion:minecraft:swiftness>, customColor 0xFFFFFF00, customEffects [MobEffectInstance.of(invalid input: '<'mobeffect:minecraft:strength>, 20 * 20, 1, false, false, true)]
-
withPotionContents
Sets the <componenttype:minecraft:potion_contents> of the ComponentAccess to have the givenPotionContents- Returns:
- The new instance with the modified data.
-
withoutPotionContents
Removes the <componenttype:minecraft:potion_contents> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasSuspiciousStewEffects
default boolean hasSuspiciousStewEffects()Checks whether the ComponentAccess has <componenttype:minecraft:suspicious_stew_effects>- Returns:
- Whether the componenttype is stored.
-
getSuspiciousStewEffects
default net.minecraft.world.item.component.SuspiciousStewEffects getSuspiciousStewEffects()Gets the data in <componenttype:minecraft:suspicious_stew_effects>- Returns:
- A
SuspiciousStewEffects.
-
withSuspiciousStewEffects
default T withSuspiciousStewEffects(List<net.minecraft.world.item.component.SuspiciousStewEffects.Entry> effects) Sets the <componenttype:minecraft:suspicious_stew_effects> of the ComponentAccess to have the givenSuspiciousStewEffectsSuspiciousStewEffects.Entryis effectively a pair of Effect and duration.- Parameters:
effects- The list of effects to grant on consumption.- Returns:
- The new instance with the modified data.
-
withSuspiciousStewEffects
default T withSuspiciousStewEffects(net.minecraft.world.item.component.SuspiciousStewEffects suspiciousStewEffects) Sets the <componenttype:minecraft:suspicious_stew_effects> of the ComponentAccess to have the givenSuspiciousStewEffects- Returns:
- The new instance with the modified data.
-
withoutSuspiciousStewEffects
Removes the <componenttype:minecraft:suspicious_stew_effects> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasWritableBookContent
default boolean hasWritableBookContent()Checks whether the ComponentAccess has <componenttype:minecraft:writable_book_content>- Returns:
- Whether the componenttype is stored.
-
getWritableBookContent
default net.minecraft.world.item.component.WritableBookContent getWritableBookContent()Gets the data in <componenttype:minecraft:writable_book_content>- Returns:
- A
WritableBookContent.
-
withWritableBookContent
- Returns:
- The new instance with the modified data.
-
withWritableBookContent
Sets the <componenttype:minecraft:writable_book_content> of the ComponentAccess to have the givenWritableBookContent- Returns:
- The new instance with the modified data.
-
withoutWritableBookContent
Removes the <componenttype:minecraft:writable_book_content> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasWrittenBookContent
default boolean hasWrittenBookContent()Checks whether the ComponentAccess has <componenttype:minecraft:written_book_content>- Returns:
- Whether the componenttype is stored.
-
getWrittenBookContent
default net.minecraft.world.item.component.WrittenBookContent getWrittenBookContent()Gets the data in <componenttype:minecraft:written_book_content>- Returns:
- A
WrittenBookContent.
-
withWrittenBookContent
Sets the <componenttype:minecraft:written_book_content> of the ComponentAccess to have the givenWrittenBookContent- Returns:
- The new instance with the modified data.
-
withoutWrittenBookContent
Removes the <componenttype:minecraft:written_book_content> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasTrim
default boolean hasTrim()Checks whether the ComponentAccess has <componenttype:minecraft:trim>- Returns:
- Whether the componenttype is stored.
-
getTrim
default net.minecraft.world.item.armortrim.ArmorTrim getTrim()Gets the data in <componenttype:minecraft:trim>- Returns:
- A
ArmorTrim.
-
withTrim
Sets the <componenttype:minecraft:trim> of the ComponentAccess to have the givenArmorTrim- Returns:
- The new instance with the modified data.
-
withoutTrim
Removes the <componenttype:minecraft:trim> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasDebugStickState
default boolean hasDebugStickState()Checks whether the ComponentAccess has <componenttype:minecraft:debug_stick_state>- Returns:
- Whether the componenttype is stored.
-
getDebugStickState
default net.minecraft.world.item.component.DebugStickState getDebugStickState()Gets the data in <componenttype:minecraft:debug_stick_state>- Returns:
- A
DebugStickState.
-
withDebugStickState
Sets the <componenttype:minecraft:debug_stick_state> of the ComponentAccess to have the givenDebugStickState- Returns:
- The new instance with the modified data.
-
withoutDebugStickState
Removes the <componenttype:minecraft:debug_stick_state> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasEntityData
default boolean hasEntityData()Checks whether the ComponentAccess has <componenttype:minecraft:entity_data>- Returns:
- Whether the componenttype is stored.
-
getEntityData
default net.minecraft.world.item.component.CustomData getEntityData()Gets the data in <componenttype:minecraft:entity_data>- Returns:
- A
CustomData.
-
withEntityData
Sets the <componenttype:minecraft:entity_data> of the ComponentAccess to have the givenMapData- Returns:
- The new instance with the modified data.
-
withEntityData
Sets the <componenttype:minecraft:entity_data> of the ComponentAccess to have the givenCustomData- Returns:
- The new instance with the modified data.
-
withoutEntityDate
Removes the <componenttype:minecraft:entity_data> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasBucketEntityData
default boolean hasBucketEntityData()Checks whether the ComponentAccess has <componenttype:minecraft:bucket_entity_data>- Returns:
- Whether the componenttype is stored.
-
getBucketEntityData
default net.minecraft.world.item.component.CustomData getBucketEntityData()Gets the data in <componenttype:minecraft:bucket_entity_data>- Returns:
- A
CustomData.
-
withBucketEntityData
Sets the <componenttype:minecraft:bucket_entity_data> of the ComponentAccess to have the givenMapData- Returns:
- The new instance with the modified data.
-
withBucketEntityData
Sets the <componenttype:minecraft:bucket_entity_data> of the ComponentAccess to have the givenCustomData- Returns:
- The new instance with the modified data.
-
withoutBucketEntityData
Removes the <componenttype:minecraft:bucket_entity_data> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasBlockEntityData
default boolean hasBlockEntityData()Checks whether the ComponentAccess has <componenttype:minecraft:block_entity_data>- Returns:
- Whether the componenttype is stored.
-
getBlockEntityData
default net.minecraft.world.item.component.CustomData getBlockEntityData()Gets the data in <componenttype:minecraft:block_entity_data>- Returns:
- A
CustomData.
-
withBlockEntityData
Sets the <componenttype:minecraft:block_entity_data> of the ComponentAccess to have the givenMapData- Returns:
- The new instance with the modified data.
-
withBlockEntityData
Sets the <componenttype:minecraft:block_entity_data> of the ComponentAccess to have the givenCustomData- Returns:
- The new instance with the modified data.
-
withoutBlockEntityData
Removes the <componenttype:minecraft:block_entity_data> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasInstrument
default boolean hasInstrument()Checks whether the ComponentAccess has <componenttype:minecraft:instrument>- Returns:
- Whether the componenttype is stored.
-
getInstrument
default net.minecraft.world.item.Instrument getInstrument()Gets the data in <componenttype:minecraft:instrument>- Returns:
- A
Instrument.
-
withInstrument
Sets the <componenttype:minecraft:instrument> of the ComponentAccess to have the givenInstrument- Returns:
- The new instance with the modified data.
-
withoutInstrument
Removes the <componenttype:minecraft:instrument> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasOminousBottleAmplifier
default boolean hasOminousBottleAmplifier()Checks whether the ComponentAccess has <componenttype:minecraft:ominous_bottle_amplifier>- Returns:
- Whether the componenttype is stored.
-
getOminousBottleAmplifier
default int getOminousBottleAmplifier()Gets the data in <componenttype:minecraft:ominous_bottle_amplifier>- Returns:
- The amplifier number.
-
withOminousBottleAmplifier
Sets the <componenttype:minecraft:ominous_bottle_amplifier> of the ComponentAccess to have the given amplifier.- Returns:
- The new instance with the modified data.
-
withoutOminousBottleAmplifier
Removes the <componenttype:minecraft:ominous_bottle_amplifier> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasRecipes
default boolean hasRecipes()Checks whether the ComponentAccess has <componenttype:minecraft:recipes> Used for Knowledge Books.- Returns:
- Whether the componenttype is stored.
-
getRecipes
Gets the data in <componenttype:minecraft:recipes>- Returns:
- A
List<net.minecraft.resources.ResourceLocation>.
-
withRecipes
Sets the <componenttype:minecraft:recipes> of the ComponentAccess to have the givenList<net.minecraft.resources.ResourceLocation>- Returns:
- The new instance with the modified data.
-
withoutRecipes
Removes the <componenttype:minecraft:recipes> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasLodestoneTracker
default boolean hasLodestoneTracker()Checks whether the ComponentAccess has <componenttype:minecraft:lodestone_tracker>- Returns:
- Whether the componenttype is stored.
-
getLodestoneTracker
default net.minecraft.world.item.component.LodestoneTracker getLodestoneTracker()Gets the data in <componenttype:minecraft:lodestone_tracker>- Returns:
- A
LodestoneTracker.
-
withLodestoneTracker
Sets the <componenttype:minecraft:lodestone_tracker> of the ComponentAccess to have the givenLodestoneTracker- Returns:
- The new instance with the modified data.
-
withoutLodestoneTracker
Removes the <componenttype:minecraft:lodestone_tracker> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasFireworkExplosion
default boolean hasFireworkExplosion()Checks whether the ComponentAccess has <componenttype:minecraft:firework_explosion>- Returns:
- Whether the componenttype is stored.
-
getFireworkExplosion
default net.minecraft.world.item.component.FireworkExplosion getFireworkExplosion()Gets the data in <componenttype:minecraft:firework_explosion>- Returns:
- A
FireworkExplosion.
-
withFireworkExplosion
Sets the <componenttype:minecraft:firework_explosion> of the ComponentAccess to have the givenFireworkExplosion- Returns:
- The new instance with the modified data.
-
withoutFireworkExplosion
Removes the <componenttype:minecraft:firework_explosion> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasFireworks
default boolean hasFireworks()Checks whether the ComponentAccess has <componenttype:minecraft:fireworks>- Returns:
- Whether the componenttype is stored.
-
getFireworks
default net.minecraft.world.item.component.Fireworks getFireworks()Gets the data in <componenttype:minecraft:fireworks>- Returns:
- A
Fireworks.
-
withFireworks
default T withFireworks(int flightDuration, List<net.minecraft.world.item.component.FireworkExplosion> explosions) Sets the <componenttype:minecraft:fireworks> of the ComponentAccess to have the given duration and explosions.- Returns:
- The new instance with the modified data.
-
withFireworks
Sets the <componenttype:minecraft:fireworks> of the ComponentAccess to have the givenFireworks- Returns:
- The new instance with the modified data.
-
withoutFireworks
Removes the <componenttype:minecraft:fireworks> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasProfile
default boolean hasProfile()Checks whether the ComponentAccess has <componenttype:minecraft:profile>- Returns:
- Whether the componenttype is stored.
-
getProfile
default net.minecraft.world.item.component.ResolvableProfile getProfile()Gets the data in <componenttype:minecraft:profile>- Returns:
- A
ResolvableProfile.
-
withProfile
Sets the <componenttype:minecraft:profile> of the ComponentAccess to have the givenResolvableProfile- Returns:
- The new instance with the modified data.
-
withoutProfile
Removes the <componenttype:minecraft:profile> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasNoteBlockSound
default boolean hasNoteBlockSound()Checks whether the ComponentAccess has <componenttype:minecraft:note_block_sound>- Returns:
- Whether the componenttype is stored.
-
getNoteBlockSound
default net.minecraft.resources.ResourceLocation getNoteBlockSound()Gets the data in <componenttype:minecraft:note_block_sound>- Returns:
- A
ResourceLocation.
-
withNoteBlockSound
Sets the <componenttype:minecraft:note_block_sound> of the ComponentAccess to have the givenResourceLocation- Returns:
- The new instance with the modified data.
-
withoutNoteBlockSound
Removes the <componenttype:minecraft:note_block_sound> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasBannerPatterns
default boolean hasBannerPatterns()Checks whether the ComponentAccess has <componenttype:minecraft:banner_patterns>- Returns:
- Whether the componenttype is stored.
-
getBannerPatterns
default net.minecraft.world.level.block.entity.BannerPatternLayers getBannerPatterns()Gets the data in <componenttype:minecraft:banner_patterns>- Returns:
- A
BannerPatternLayers.
-
withBannerPatterns
default T withBannerPatterns(List<net.minecraft.world.level.block.entity.BannerPatternLayers.Layer> layers) Sets the <componenttype:minecraft:banner_patterns> of the ComponentAccess to have the givenList<net.minecraft.world.level.block.entity.BannerPatternLayers.Layer>- Returns:
- The new instance with the modified data.
-
withBannerPatterns
Sets the <componenttype:minecraft:banner_patterns> of the ComponentAccess to have the givenBannerPatternLayers- Returns:
- The new instance with the modified data.
-
withoutBannerPatterns
Removes the <componenttype:minecraft:banner_patterns> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasBaseColor
default boolean hasBaseColor()Checks whether the ComponentAccess has <componenttype:minecraft:base_color> Used for shield colouring.- Returns:
- Whether the componenttype is stored.
-
getBaseColor
default net.minecraft.world.item.DyeColor getBaseColor()Gets the data in <componenttype:minecraft:base_color>- Returns:
- A
DyeColor.
-
withBaseColor
Sets the <componenttype:minecraft:base_color> of the ComponentAccess to have the givenDyeColor- Returns:
- The new instance with the modified data.
-
withoutBaseColor
Removes the <componenttype:minecraft:base_color> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasPotDecorations
default boolean hasPotDecorations()Checks whether the ComponentAccess has <componenttype:minecraft:pot_decorations>- Returns:
- Whether the componenttype is stored.
-
getPotDecorations
default net.minecraft.world.level.block.entity.PotDecorations getPotDecorations()Gets the data in <componenttype:minecraft:pot_decorations>- Returns:
- A
PotDecorations.
-
withPotDecorations
default T withPotDecorations(net.minecraft.world.item.Item back, net.minecraft.world.item.Item left, net.minecraft.world.item.Item right, net.minecraft.world.item.Item front) Sets the <componenttype:minecraft:pot_decorations> of the ComponentAccess to have the given items.- Returns:
- The new instance with the modified data.
-
withPotDecorations
Sets the <componenttype:minecraft:pot_decorations> of the ComponentAccess to have the givenPotDecorations- Returns:
- The new instance with the modified data.
-
withoutPotDecorations
Removes the <componenttype:minecraft:pot_decorations> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasContainer
default boolean hasContainer()Checks whether the ComponentAccess has <componenttype:minecraft:container>- Returns:
- Whether the componenttype is stored.
-
getContainer
default net.minecraft.world.item.component.ItemContainerContents getContainer()Gets the data in <componenttype:minecraft:container>- Returns:
- A
ItemContainerContents.
-
withContainer
Sets the <componenttype:minecraft:container> of the ComponentAccess to have the given values.- Returns:
- The new instance with the modified data.
-
withContainer
Sets the <componenttype:minecraft:container> of the ComponentAccess to have the givenItemContainerContents- Returns:
- The new instance with the modified data.
-
withoutContainer
Removes the <componenttype:minecraft:container> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasBlockState
default boolean hasBlockState()Checks whether the ComponentAccess has <componenttype:minecraft:block_state>- Returns:
- Whether the componenttype is stored.
-
getBlockState
default net.minecraft.world.item.component.BlockItemStateProperties getBlockState()Gets the data in <componenttype:minecraft:block_state>- Returns:
- A
BlockItemStateProperties.
-
withBlockState
Sets the <componenttype:minecraft:block_state> of the ComponentAccess to have the givenBlockItemStateProperties- Returns:
- The new instance with the modified data.
-
withoutBlockState
Removes the <componenttype:minecraft:block_state> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasBees
default boolean hasBees()Checks whether the ComponentAccess has <componenttype:minecraft:bees>- Returns:
- Whether the componenttype is stored.
-
getBees
Gets the data in <componenttype:minecraft:bees>- Returns:
- A
List<net.minecraft.world.level.block.entity.BeehiveBlockEntity.Occupant>.
-
withBees
default T withBees(List<net.minecraft.world.level.block.entity.BeehiveBlockEntity.Occupant> occupants) Sets the <componenttype:minecraft:bees> of the ComponentAccess to have the given occupants- Returns:
- The new instance with the modified data.
-
withoutBees
Removes the <componenttype:minecraft:bees> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasLock
default boolean hasLock()Checks whether the ComponentAccess has <componenttype:minecraft:lock>- Returns:
- Whether the componenttype is stored.
-
getLock
default net.minecraft.world.LockCode getLock()Gets the data in <componenttype:minecraft:lock>- Returns:
- A
LockCode.
-
withLock
Sets the <componenttype:minecraft:lock> of the ComponentAccess to have the given string.- Returns:
- The new instance with the modified data.
-
withLock
Sets the <componenttype:minecraft:lock> of the ComponentAccess to have the givenLockCode- Returns:
- The new instance with the modified data.
-
withoutLock
Removes the <componenttype:minecraft:lock> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
hasContainerLoot
default boolean hasContainerLoot()Checks whether the ComponentAccess has <componenttype:minecraft:container_loot>- Returns:
- Whether the componenttype is stored.
-
getContainerLoot
default net.minecraft.world.item.component.SeededContainerLoot getContainerLoot()Gets the data in <componenttype:minecraft:container_loot>- Returns:
- A
SeededContainerLoot.
-
withContainerLoot
default T withContainerLoot(net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable> lootTable, long seed) 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.
-
withContainerLoot
Sets the <componenttype:minecraft:container_loot> of the ComponentAccess to have the givenSeededContainerLoot- Returns:
- The new instance with the modified data.
-
withoutContainerLoot
Removes the <componenttype:minecraft:container_loot> from the ComponentAccess.- Returns:
- The new instance with the modified data.
-
_get
<U> U _get(net.minecraft.core.component.DataComponentType<? extends U> componentType) -
_with
-
_without
-
_has
<U> boolean _has(net.minecraft.core.component.DataComponentType<U> componentType)
-