Class ItemStack
- All Implemented Interfaces:
ComponentHolder,ComponentsAccess
Item. Instances can be created using one of
the constructors and are usually stored in an Inventory.
Item stacks should never be compared using == operator or equals
method. This also means they cannot be used as a map key. To check if an item stack
is of a certain item, use isOf(Item). To compare two item stacks, use areItemsEqual(net.minecraft.item.ItemStack, net.minecraft.item.ItemStack) to check the item only, or areEqual(net.minecraft.item.ItemStack, net.minecraft.item.ItemStack) to also check the item
count and the components. Use isEmpty() to check if an item stack is empty instead
of doing stack == ItemStack.EMPTY.
When storing an item stack in an inventory or other places, make sure that an instance is never stored in multiple places. When two inventories hold the same instance, it will duplicate the item stack (and become two instances) when one is saved and reloaded.
Components
Components can be used to store data specific to the item stack.
Use ComponentHolder.get(net.minecraft.component.ComponentType<? extends T>) or ComponentHolder.getOrDefault(net.minecraft.component.ComponentType<? extends T>, T) to
get the component values. Use set(net.minecraft.component.ComponentType<T>, T) or remove(net.minecraft.component.ComponentType<? extends T>) to set the components.
NBT serialization
An Item Stack can be serialized with
invalid reference
#toNbt(RegistryWrapper.WrapperLookup)invalid reference
#fromNbt(RegistryWrapper.WrapperLookup, NbtCompound)
| Key | Type | Purpose |
|---|---|---|
id | NbtString | The identifier of the item. |
count | NbtInt | The count of items in the stack. |
components | ComponentChanges | The item stack's components. |
- Mappings:
Namespace Name named net/minecraft/item/ItemStackintermediary net/minecraft/class_1799official dkg
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intstatic final com.mojang.serialization.Codec<ItemStack> (package private) final MergedComponentMapprivate intprivate static final Textstatic final ItemStackThe empty item stack that holds no item.private Entityprivate static final Textprivate final ItemDeprecated.static final PacketCodec<RegistryByteBuf, ItemStack> private static final Loggerstatic final com.mojang.serialization.MapCodec<ItemStack> static final com.mojang.serialization.Codec<ItemStack> static final PacketCodec<RegistryByteBuf, List<ItemStack>> static final PacketCodec<RegistryByteBuf, ItemStack> static final PacketCodec<RegistryByteBuf, ItemStack> static final com.mojang.serialization.Codec<ItemStack> private static final Textstatic final com.mojang.serialization.Codec<ItemStack> static final com.mojang.serialization.Codec<ItemStack> static final com.mojang.serialization.Codec<ItemStack> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateItemStack(ItemConvertible item) ItemStack(ItemConvertible item, int count) privateItemStack(ItemConvertible item, int count, MergedComponentMap components) ItemStack(RegistryEntry<Item> entry) ItemStack(RegistryEntry<Item> itemEntry, int count) ItemStack(RegistryEntry<Item> item, int count, ComponentChanges changes) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEnchantment(RegistryEntry<Enchantment> enchantment, int level) Enchants this item with the given enchantment and level.private voidappendAttributeModifiersTooltip(Consumer<Text> textConsumer, TooltipDisplayComponent displayComponent, @Nullable PlayerEntity player) <T extends TooltipAppender>
voidappendComponentTooltip(ComponentType<T> componentType, Item.TooltipContext context, TooltipDisplayComponent displayComponent, Consumer<Text> textConsumer, TooltipType type) voidappendTooltip(Item.TooltipContext context, TooltipDisplayComponent displayComponent, @Nullable PlayerEntity player, TooltipType type, Consumer<Text> textConsumer) private voidappendTooltipIfComponentExists(ComponentType<?> type, Text tooltip, TooltipDisplayComponent displayComponent, Consumer<Text> textConsumer) <T> @Nullable Tapply(ComponentType<T> type, T defaultValue, UnaryOperator<T> applier) Sets the componenttypeby passing the current value (ordefaultValueif the component is missing) toapplierand then setting its return value as the value.<T,U> @Nullable T apply(ComponentType<T> type, T defaultValue, U change, BiFunction<T, U, T> applier) Sets the componenttypeby passing the current value andchangetoapplier, then setting its return value as the value.voidapplyAttributeModifier(AttributeModifierSlot slot, TriConsumer<RegistryEntry<EntityAttribute>, EntityAttributeModifier, AttributeModifiersComponent.Display> attributeModifierConsumer) voidapplyAttributeModifiers(EquipmentSlot slot, BiConsumer<RegistryEntry<EntityAttribute>, EntityAttributeModifier> attributeModifierConsumer) voidapplyChanges(ComponentChanges changes) voidapplyComponentsFrom(ComponentMap components) private ItemStackapplyRemainderAndCooldown(LivingEntity user, ItemStack stack) voidapplyUnvalidatedChanges(ComponentChanges changes) static booleanReturns whether the given item stacks are equal, including the item count and components.static booleanareItemsAndComponentsEqual(ItemStack stack, ItemStack otherStack) Returns whether the given item stacks' items and components are equal.static booleanareItemsEqual(ItemStack left, ItemStack right) Returns whether the given item stacks contain the same item, regardless of item count or components.private intcalculateDamage(int baseDamage, ServerWorld world, @Nullable ServerPlayerEntity player) booleanbooleancanMine(BlockState state, World world, BlockPos pos, PlayerEntity player) booleanbooleancanRepairWith(ItemStack ingredient) voidcapCount(int maxCount) Sets the count of items in this item stack to not exceedmaxCount.copy()Returns a copy of this item stack, including the item count, components, and bobbing animation time.<T> voidcopy(ComponentType<T> type, ComponentsAccess from) copyComponentsToNewStack(ItemConvertible item, int count) Returns a new item stack with the components copied from this item stack.private ItemStackcopyComponentsToNewStackIgnoreEmpty(ItemConvertible item, int count) Returns a new item stack with the components copied from this item stack, even if this stack is empty.copyWithCount(int count) Returns a copy of this item stack, including the components, and bobbing animation time, with the item count set tocount.static PacketCodec<RegistryByteBuf, ItemStack> createExtraValidatingPacketCodec(PacketCodec<RegistryByteBuf, ItemStack> basePacketCodec) Returns a packet codec that ensures the validity of the decoded stack by checking if it can be re-encoded.static com.mojang.serialization.MapCodec<ItemStack> createOptionalCodec(String fieldName) private static PacketCodec<RegistryByteBuf, ItemStack> createOptionalPacketCodec(PacketCodec<RegistryByteBuf, ComponentChanges> componentsPacketCodec) voiddamage(int amount, LivingEntity entity, EquipmentSlot slot) Damages this item stack.voiddamage(int amount, LivingEntity entity, Hand hand) voiddamage(int amount, PlayerEntity player) damage(int amount, ItemConvertible itemAfterBreaking, LivingEntity entity, EquipmentSlot slot) voiddamage(int amount, ServerWorld world, @Nullable ServerPlayerEntity player, Consumer<Item> breakCallback) Damages this item stack.voiddecrement(int amount) Decrements the count of items in this item stack.voiddecrementUnlessCreative(int amount, @Nullable LivingEntity entity) Decrements the count of items in this item stack, unlessentityis a creative mode player.finishUsing(World world, LivingEntity user) intintgetCount()Returns the count of items in this item stack.@Nullable TextReturns the custom name or book title of the stack if it exists, ornull.intReturns the damage (lost durability) of the item stack.getDamageSource(LivingEntity attacker, Supplier<DamageSource> fallbackSupplier) @Nullable ItemFrameEntitygetFrame()Returns the item frame that holds the stack, ornullif inapplicable.@Nullable EntityReturns the entity that holds the stack, ornullif inapplicable.getItem()Returns the item of this stack.intReturns the color of the filled section of the durability bar.intReturns the length of the filled section of the durability bar in pixels (out of 13).intintintgetMaxUseTime(LivingEntity user) floatgetName()Returns the custom name of the stack if it exists, or the item's name.getTooltip(Item.TooltipContext context, @Nullable PlayerEntity player, TooltipType type) booleanhasChangedComponent(ComponentType<?> type) booleanReturns whether the item stack has any enchantments.booleanhasGlint()static intvoidincrement(int amount) Increments the count of items in this item stack.voidinventoryTick(World world, Entity entity, @Nullable EquipmentSlot slot) booleanReturns whether the item can be damaged (lose durability).booleanReturns whether the item stack is damageable and has damage.booleanisEmpty()Returns whether this item stack is empty.booleanReturns whether this item stack can be enchanted with an enchanting table.booleanisIn(RegistryEntryList<Item> registryEntryList) booleanReturns whether the item is intag.booleanReturns whether the item stack is in an item frame.booleanbooleanisItemEnabled(FeatureSet enabledFeatures) booleanReturns whether the item isitem.booleanReturns whether the item stack can have item count above1.booleanisSuitableFor(BlockState state) Determines whether this item can be used as a suitable tool for mining the specified block.booleanbooleanitemMatches(Predicate<RegistryEntry<Item>> predicate) Returns whether the item's registry entry passes thepredicate.booleanitemMatches(RegistryEntry<Item> itemEntry) Returns whether the item's registry entry matchesitemEntry.static intlistHashCode(List<ItemStack> stacks) Deprecated.booleanonClicked(ItemStack stack, Slot slot, ClickType clickType, PlayerEntity player, StackReference cursorStackReference) voidonCraftByCrafter(World world) voidonCraftByPlayer(PlayerEntity player, int amount) private voidonDurabilityChange(int damage, @Nullable ServerPlayerEntity player, Consumer<Item> breakCallback) voidonItemEntityDestroyed(ItemEntity entity) booleanonStackClicked(Slot slot, ClickType clickType, PlayerEntity player) voidonStoppedUsing(World world, LivingEntity user, int remainingUseTicks) voidpostDamageEntity(LivingEntity target, LivingEntity user) booleanpostHit(LivingEntity target, LivingEntity user) voidpostMine(World world, BlockState state, BlockPos pos, PlayerEntity miner) <T> @Nullable Tremove(ComponentType<? extends T> type) Removes the componenttype.<T> @Nullable T<T> @Nullable Tset(ComponentType<T> type, @Nullable T value) Sets the componenttypefor this item stack tovalue.voidsetBobbingAnimationTime(int bobbingAnimationTime) voidsetCount(int count) Sets the count of items in this item stack.voidsetDamage(int damage) Sets the stack's damage todamage.voidSets the stack's holder toholder.booleanstatic booleanshouldSkipHandAnimationOnSwap(ItemStack from, ItemStack to, Predicate<ComponentType<?>> skippedComponent) split(int amount) Returns the copy of the stack "split" from the current stack with item count being at mostamount.splitUnlessCreative(int amount, @Nullable LivingEntity entity) static booleanstacksEqual(List<ItemStack> left, List<ItemStack> right) Deprecated.Returns a stream of all tags the item is in.booleantakesDamageFrom(DamageSource source) Returns a text consisting of the bracketed stack name that can be hovered to show the item stack's tooltip.toString()voidusageTick(World world, LivingEntity user, int remainingUseTicks) use(World world, PlayerEntity user, Hand hand) useOnBlock(ItemUsageContext context) useOnEntity(PlayerEntity user, LivingEntity entity, Hand hand) static com.mojang.serialization.DataResult<ItemStack> static com.mojang.serialization.DataResult<Unit> validateComponents(ComponentMap components) booleanwithItem(ItemConvertible item) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.component.ComponentHolder
contains, get, getOrDefault, streamAllMethods inherited from interface net.minecraft.component.ComponentsAccess
getTyped
-
Field Details
-
OPERATOR_WARNINGS
- Mappings:
Namespace Name Mixin selector named OPERATOR_WARNINGSLnet/minecraft/item/ItemStack;OPERATOR_WARNINGS:Ljava/util/List;intermediary field_55546Lnet/minecraft/class_1799;field_55546:Ljava/util/List;official mLdkg;m:Ljava/util/List;
-
UNBREAKABLE_TEXT
- Mappings:
Namespace Name Mixin selector named UNBREAKABLE_TEXTLnet/minecraft/item/ItemStack;UNBREAKABLE_TEXT:Lnet/minecraft/text/Text;intermediary field_56297Lnet/minecraft/class_1799;field_56297:Lnet/minecraft/class_2561;official nLdkg;n:Lyi;
-
INTANGIBLE_TEXT
- Mappings:
Namespace Name Mixin selector named INTANGIBLE_TEXTLnet/minecraft/item/ItemStack;INTANGIBLE_TEXT:Lnet/minecraft/text/Text;intermediary field_63379Lnet/minecraft/class_1799;field_63379:Lnet/minecraft/class_2561;official oLdkg;o:Lyi;
-
MAP_CODEC
- Mappings:
Namespace Name Mixin selector named MAP_CODECLnet/minecraft/item/ItemStack;MAP_CODEC:Lcom/mojang/serialization/MapCodec;intermediary field_55709Lnet/minecraft/class_1799;field_55709:Lcom/mojang/serialization/MapCodec;official aLdkg;a:Lcom/mojang/serialization/MapCodec;
-
CODEC
- Mappings:
Namespace Name Mixin selector named CODECLnet/minecraft/item/ItemStack;CODEC:Lcom/mojang/serialization/Codec;intermediary field_24671Lnet/minecraft/class_1799;field_24671:Lcom/mojang/serialization/Codec;official bLdkg;b:Lcom/mojang/serialization/Codec;
-
UNCOUNTED_CODEC
- Mappings:
Namespace Name Mixin selector named UNCOUNTED_CODECLnet/minecraft/item/ItemStack;UNCOUNTED_CODEC:Lcom/mojang/serialization/Codec;intermediary field_49747Lnet/minecraft/class_1799;field_49747:Lcom/mojang/serialization/Codec;official cLdkg;c:Lcom/mojang/serialization/Codec;
-
VALIDATED_CODEC
- Mappings:
Namespace Name Mixin selector named VALIDATED_CODECLnet/minecraft/item/ItemStack;VALIDATED_CODEC:Lcom/mojang/serialization/Codec;intermediary field_51397Lnet/minecraft/class_1799;field_51397:Lcom/mojang/serialization/Codec;official dLdkg;d:Lcom/mojang/serialization/Codec;
-
VALIDATED_UNCOUNTED_CODEC
- Mappings:
Namespace Name Mixin selector named VALIDATED_UNCOUNTED_CODECLnet/minecraft/item/ItemStack;VALIDATED_UNCOUNTED_CODEC:Lcom/mojang/serialization/Codec;intermediary field_51398Lnet/minecraft/class_1799;field_51398:Lcom/mojang/serialization/Codec;official eLdkg;e:Lcom/mojang/serialization/Codec;
-
OPTIONAL_CODEC
- Mappings:
Namespace Name Mixin selector named OPTIONAL_CODECLnet/minecraft/item/ItemStack;OPTIONAL_CODEC:Lcom/mojang/serialization/Codec;intermediary field_49266Lnet/minecraft/class_1799;field_49266:Lcom/mojang/serialization/Codec;official fLdkg;f:Lcom/mojang/serialization/Codec;
-
REGISTRY_ENTRY_CODEC
- Mappings:
Namespace Name Mixin selector named REGISTRY_ENTRY_CODECLnet/minecraft/item/ItemStack;REGISTRY_ENTRY_CODEC:Lcom/mojang/serialization/Codec;intermediary field_49267Lnet/minecraft/class_1799;field_49267:Lcom/mojang/serialization/Codec;official gLdkg;g:Lcom/mojang/serialization/Codec;
-
OPTIONAL_PACKET_CODEC
- Mappings:
Namespace Name Mixin selector named OPTIONAL_PACKET_CODECLnet/minecraft/item/ItemStack;OPTIONAL_PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;intermediary field_49268Lnet/minecraft/class_1799;field_49268:Lnet/minecraft/class_9139;official hLdkg;h:Laap;
-
LENGTH_PREPENDED_OPTIONAL_PACKET_CODEC
- Mappings:
Namespace Name Mixin selector named LENGTH_PREPENDED_OPTIONAL_PACKET_CODECLnet/minecraft/item/ItemStack;LENGTH_PREPENDED_OPTIONAL_PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;intermediary field_58141Lnet/minecraft/class_1799;field_58141:Lnet/minecraft/class_9139;official iLdkg;i:Laap;
-
PACKET_CODEC
- Mappings:
Namespace Name Mixin selector named PACKET_CODECLnet/minecraft/item/ItemStack;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;intermediary field_48349Lnet/minecraft/class_1799;field_48349:Lnet/minecraft/class_9139;official jLdkg;j:Laap;
-
OPTIONAL_LIST_PACKET_CODEC
- Mappings:
Namespace Name Mixin selector named OPTIONAL_LIST_PACKET_CODECLnet/minecraft/item/ItemStack;OPTIONAL_LIST_PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;intermediary field_49269Lnet/minecraft/class_1799;field_49269:Lnet/minecraft/class_9139;official kLdkg;k:Laap;
-
LOGGER
- Mappings:
Namespace Name Mixin selector named LOGGERLnet/minecraft/item/ItemStack;LOGGER:Lorg/slf4j/Logger;intermediary field_8033Lnet/minecraft/class_1799;field_8033:Lorg/slf4j/Logger;official pLdkg;p:Lorg/slf4j/Logger;
-
EMPTY
The empty item stack that holds no item.This should never be mutated.
- See Also:
- Mappings:
Namespace Name Mixin selector named EMPTYLnet/minecraft/item/ItemStack;EMPTY:Lnet/minecraft/item/ItemStack;intermediary field_8037Lnet/minecraft/class_1799;field_8037:Lnet/minecraft/class_1799;official lLdkg;l:Ldkg;
-
DISABLED_TEXT
- Mappings:
Namespace Name Mixin selector named DISABLED_TEXTLnet/minecraft/item/ItemStack;DISABLED_TEXT:Lnet/minecraft/text/Text;intermediary field_40211Lnet/minecraft/class_1799;field_40211:Lnet/minecraft/class_2561;official qLdkg;q:Lyi;
-
count
private int count- Mappings:
Namespace Name Mixin selector named countLnet/minecraft/item/ItemStack;count:Iintermediary field_8031Lnet/minecraft/class_1799;field_8031:Iofficial rLdkg;r:I
-
bobbingAnimationTime
private int bobbingAnimationTime- Mappings:
Namespace Name Mixin selector named bobbingAnimationTimeLnet/minecraft/item/ItemStack;bobbingAnimationTime:Iintermediary field_8030Lnet/minecraft/class_1799;field_8030:Iofficial sLdkg;s:I
-
item
Deprecated.- Mappings:
Namespace Name Mixin selector named itemLnet/minecraft/item/ItemStack;item:Lnet/minecraft/item/Item;intermediary field_8038Lnet/minecraft/class_1799;field_8038:Lnet/minecraft/class_1792;official tLdkg;t:Ldkc;
-
components
- Mappings:
Namespace Name Mixin selector named componentsLnet/minecraft/item/ItemStack;components:Lnet/minecraft/component/MergedComponentMap;intermediary field_49270Lnet/minecraft/class_1799;field_49270:Lnet/minecraft/class_9335;official uLdkg;u:Lkl;
-
holder
- Mappings:
Namespace Name Mixin selector named holderLnet/minecraft/item/ItemStack;holder:Lnet/minecraft/entity/Entity;intermediary field_24093Lnet/minecraft/class_1799;field_24093:Lnet/minecraft/class_1297;official vLdkg;v:Lcga;
-
-
Constructor Details
-
ItemStack
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/item/ItemStack;<init>(Lnet/minecraft/item/ItemConvertible;)Vintermediary <init>Lnet/minecraft/class_1799;<init>(Lnet/minecraft/class_1935;)Vofficial <init>Ldkg;<init>(Lduz;)V
-
ItemStack
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/item/ItemStack;<init>(Lnet/minecraft/registry/entry/RegistryEntry;)Vintermediary <init>Lnet/minecraft/class_1799;<init>(Lnet/minecraft/class_6880;)Vofficial <init>Ldkg;<init>(Ljf;)V
-
ItemStack
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/item/ItemStack;<init>(Lnet/minecraft/registry/entry/RegistryEntry;ILnet/minecraft/component/ComponentChanges;)Vintermediary <init>Lnet/minecraft/class_1799;<init>(Lnet/minecraft/class_6880;ILnet/minecraft/class_9326;)Vofficial <init>Ldkg;<init>(Ljf;ILki;)V
-
ItemStack
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/item/ItemStack;<init>(Lnet/minecraft/registry/entry/RegistryEntry;I)Vintermediary <init>Lnet/minecraft/class_1799;<init>(Lnet/minecraft/class_6880;I)Vofficial <init>Ldkg;<init>(Ljf;I)V
-
ItemStack
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/item/ItemStack;<init>(Lnet/minecraft/item/ItemConvertible;I)Vintermediary <init>Lnet/minecraft/class_1799;<init>(Lnet/minecraft/class_1935;I)Vofficial <init>Ldkg;<init>(Lduz;I)V
-
ItemStack
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/item/ItemStack;<init>(Lnet/minecraft/item/ItemConvertible;ILnet/minecraft/component/MergedComponentMap;)Vintermediary <init>Lnet/minecraft/class_1799;<init>(Lnet/minecraft/class_1935;ILnet/minecraft/class_9335;)Vofficial <init>Ldkg;<init>(Lduz;ILkl;)V
-
ItemStack
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/item/ItemStack;<init>(Ljava/lang/Void;)Vintermediary <init>Lnet/minecraft/class_1799;<init>(Ljava/lang/Void;)Vofficial <init>Ldkg;<init>(Ljava/lang/Void;)V
-
-
Method Details
-
validate
- Mappings:
Namespace Name Mixin selector named validateLnet/minecraft/item/ItemStack;validate(Lnet/minecraft/item/ItemStack;)Lcom/mojang/serialization/DataResult;intermediary method_57372Lnet/minecraft/class_1799;method_57372(Lnet/minecraft/class_1799;)Lcom/mojang/serialization/DataResult;official aLdkg;a(Ldkg;)Lcom/mojang/serialization/DataResult;
-
createOptionalPacketCodec
private static PacketCodec<RegistryByteBuf,ItemStack> createOptionalPacketCodec(PacketCodec<RegistryByteBuf, ComponentChanges> componentsPacketCodec) - Mappings:
Namespace Name Mixin selector named createOptionalPacketCodecLnet/minecraft/item/ItemStack;createOptionalPacketCodec(Lnet/minecraft/network/codec/PacketCodec;)Lnet/minecraft/network/codec/PacketCodec;intermediary method_68810Lnet/minecraft/class_1799;method_68810(Lnet/minecraft/class_9139;)Lnet/minecraft/class_9139;official bLdkg;b(Laap;)Laap;
-
createExtraValidatingPacketCodec
public static PacketCodec<RegistryByteBuf,ItemStack> createExtraValidatingPacketCodec(PacketCodec<RegistryByteBuf, ItemStack> basePacketCodec) Returns a packet codec that ensures the validity of the decoded stack by checking if it can be re-encoded.This should be used when serializing
ItemStackin C2S packets. Encoding is unaffected.- Returns:
- a packet codec that ensures the validity of the decoded stack by checking if it can be re-encoded
- Mappings:
Namespace Name Mixin selector named createExtraValidatingPacketCodecLnet/minecraft/item/ItemStack;createExtraValidatingPacketCodec(Lnet/minecraft/network/codec/PacketCodec;)Lnet/minecraft/network/codec/PacketCodec;intermediary method_59693Lnet/minecraft/class_1799;method_59693(Lnet/minecraft/class_9139;)Lnet/minecraft/class_9139;official aLdkg;a(Laap;)Laap;
-
getTooltipData
- Mappings:
Namespace Name Mixin selector named getTooltipDataLnet/minecraft/item/ItemStack;getTooltipData()Ljava/util/Optional;intermediary method_32347Lnet/minecraft/class_1799;method_32347()Ljava/util/Optional;official bLdkg;b()Ljava/util/Optional;
-
getComponents
- Specified by:
getComponentsin interfaceComponentHolder- Mappings:
Namespace Name Mixin selector named getComponentsLnet/minecraft/component/ComponentHolder;getComponents()Lnet/minecraft/component/ComponentMap;intermediary method_57353Lnet/minecraft/class_9322;method_57353()Lnet/minecraft/class_9323;official aLkg;a()Lkh;
-
getDefaultComponents
- Mappings:
Namespace Name Mixin selector named getDefaultComponentsLnet/minecraft/item/ItemStack;getDefaultComponents()Lnet/minecraft/component/ComponentMap;intermediary method_58658Lnet/minecraft/class_1799;method_58658()Lnet/minecraft/class_9323;official cLdkg;c()Lkh;
-
getComponentChanges
- Mappings:
Namespace Name Mixin selector named getComponentChangesLnet/minecraft/item/ItemStack;getComponentChanges()Lnet/minecraft/component/ComponentChanges;intermediary method_57380Lnet/minecraft/class_1799;method_57380()Lnet/minecraft/class_9326;official dLdkg;d()Lki;
-
getImmutableComponents
- Mappings:
Namespace Name Mixin selector named getImmutableComponentsLnet/minecraft/item/ItemStack;getImmutableComponents()Lnet/minecraft/component/ComponentMap;intermediary method_65359Lnet/minecraft/class_1799;method_65359()Lnet/minecraft/class_9323;official eLdkg;e()Lkh;
-
hasChangedComponent
- Mappings:
Namespace Name Mixin selector named hasChangedComponentLnet/minecraft/item/ItemStack;hasChangedComponent(Lnet/minecraft/component/ComponentType;)Zintermediary method_65797Lnet/minecraft/class_1799;method_65797(Lnet/minecraft/class_9331;)Zofficial dLdkg;d(Lkj;)Z
-
validateComponents
- Mappings:
Namespace Name Mixin selector named validateComponentsLnet/minecraft/item/ItemStack;validateComponents(Lnet/minecraft/component/ComponentMap;)Lcom/mojang/serialization/DataResult;intermediary method_59691Lnet/minecraft/class_1799;method_59691(Lnet/minecraft/class_9323;)Lcom/mojang/serialization/DataResult;official aLdkg;a(Lkh;)Lcom/mojang/serialization/DataResult;
-
isEmpty
public boolean isEmpty()Returns whether this item stack is empty.- Returns:
- whether this item stack is empty
- Mappings:
Namespace Name Mixin selector named isEmptyLnet/minecraft/item/ItemStack;isEmpty()Zintermediary method_7960Lnet/minecraft/class_1799;method_7960()Zofficial fLdkg;f()Z
-
isItemEnabled
- Mappings:
Namespace Name Mixin selector named isItemEnabledLnet/minecraft/item/ItemStack;isItemEnabled(Lnet/minecraft/resource/featuretoggle/FeatureSet;)Zintermediary method_45435Lnet/minecraft/class_1799;method_45435(Lnet/minecraft/class_7699;)Zofficial aLdkg;a(Ldfo;)Z
-
split
Returns the copy of the stack "split" from the current stack with item count being at mostamount.Splitting an item stack mutates this stack so that the sum of the stacks' item counts does not change. See the example below:
ItemStack stack = new ItemStack(Items.APPLE, 64); ItemStack newStack = stack.split(10); // stack has 54 apples // newStack has 10 apples ItemStack smallStack = new ItemStack(Items.APPLE, 4); ItemStack newSmallStack = smallStack.split(10); // smallStack is now empty // newSmallStack has 4 apples- Returns:
- the copy of the stack "split" from the current stack with item count
being at most
amount - Mappings:
Namespace Name Mixin selector named splitLnet/minecraft/item/ItemStack;split(I)Lnet/minecraft/item/ItemStack;intermediary method_7971Lnet/minecraft/class_1799;method_7971(I)Lnet/minecraft/class_1799;official aLdkg;a(I)Ldkg;
-
copyAndEmpty
- Mappings:
Namespace Name Mixin selector named copyAndEmptyLnet/minecraft/item/ItemStack;copyAndEmpty()Lnet/minecraft/item/ItemStack;intermediary method_51164Lnet/minecraft/class_1799;method_51164()Lnet/minecraft/class_1799;official gLdkg;g()Ldkg;
-
getItem
Returns the item of this stack.- Returns:
- the item of this stack
- See Also:
- Mappings:
Namespace Name Mixin selector named getItemLnet/minecraft/item/ItemStack;getItem()Lnet/minecraft/item/Item;intermediary method_7909Lnet/minecraft/class_1799;method_7909()Lnet/minecraft/class_1792;official hLdkg;h()Ldkc;
-
getRegistryEntry
- Mappings:
Namespace Name Mixin selector named getRegistryEntryLnet/minecraft/item/ItemStack;getRegistryEntry()Lnet/minecraft/registry/entry/RegistryEntry;intermediary method_41409Lnet/minecraft/class_1799;method_41409()Lnet/minecraft/class_6880;official iLdkg;i()Ljf;
-
isIn
Returns whether the item is intag.- Returns:
- whether the item is in
tag - Mappings:
Namespace Name Mixin selector named isInLnet/minecraft/item/ItemStack;isIn(Lnet/minecraft/registry/tag/TagKey;)Zintermediary method_31573Lnet/minecraft/class_1799;method_31573(Lnet/minecraft/class_6862;)Zofficial aLdkg;a(Lbef;)Z
-
isOf
Returns whether the item isitem.- Returns:
- whether the item is
item - Mappings:
Namespace Name Mixin selector named isOfLnet/minecraft/item/ItemStack;isOf(Lnet/minecraft/item/Item;)Zintermediary method_31574Lnet/minecraft/class_1799;method_31574(Lnet/minecraft/class_1792;)Zofficial aLdkg;a(Ldkc;)Z
-
itemMatches
Returns whether the item's registry entry passes thepredicate.- Returns:
- whether the item's registry entry passes the
predicate - See Also:
- Mappings:
Namespace Name Mixin selector named itemMatchesLnet/minecraft/item/ItemStack;itemMatches(Ljava/util/function/Predicate;)Zintermediary method_41407Lnet/minecraft/class_1799;method_41407(Ljava/util/function/Predicate;)Zofficial aLdkg;a(Ljava/util/function/Predicate;)Z
-
itemMatches
Returns whether the item's registry entry matchesitemEntry.- Returns:
- whether the item's registry entry matches
itemEntry - See Also:
- Mappings:
Namespace Name Mixin selector named itemMatchesLnet/minecraft/item/ItemStack;itemMatches(Lnet/minecraft/registry/entry/RegistryEntry;)Zintermediary method_41406Lnet/minecraft/class_1799;method_41406(Lnet/minecraft/class_6880;)Zofficial aLdkg;a(Ljf;)Z
-
isIn
- Mappings:
Namespace Name Mixin selector named isInLnet/minecraft/item/ItemStack;isIn(Lnet/minecraft/registry/entry/RegistryEntryList;)Zintermediary method_53187Lnet/minecraft/class_1799;method_53187(Lnet/minecraft/class_6885;)Zofficial aLdkg;a(Ljj;)Z
-
streamTags
Returns a stream of all tags the item is in.- Returns:
- a stream of all tags the item is in
- See Also:
- Mappings:
Namespace Name Mixin selector named streamTagsLnet/minecraft/item/ItemStack;streamTags()Ljava/util/stream/Stream;intermediary method_40133Lnet/minecraft/class_1799;method_40133()Ljava/util/stream/Stream;official jLdkg;j()Ljava/util/stream/Stream;
-
useOnBlock
- Mappings:
Namespace Name Mixin selector named useOnBlockLnet/minecraft/item/ItemStack;useOnBlock(Lnet/minecraft/item/ItemUsageContext;)Lnet/minecraft/util/ActionResult;intermediary method_7981Lnet/minecraft/class_1799;method_7981(Lnet/minecraft/class_1838;)Lnet/minecraft/class_1269;official aLdkg;a(Ldoi;)Lccu;
-
getMiningSpeedMultiplier
- Mappings:
Namespace Name Mixin selector named getMiningSpeedMultiplierLnet/minecraft/item/ItemStack;getMiningSpeedMultiplier(Lnet/minecraft/block/BlockState;)Fintermediary method_7924Lnet/minecraft/class_1799;method_7924(Lnet/minecraft/class_2680;)Fofficial aLdkg;a(Lemu;)F
-
use
- Mappings:
Namespace Name Mixin selector named useLnet/minecraft/item/ItemStack;use(Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/Hand;)Lnet/minecraft/util/ActionResult;intermediary method_7913Lnet/minecraft/class_1799;method_7913(Lnet/minecraft/class_1937;Lnet/minecraft/class_1657;Lnet/minecraft/class_1268;)Lnet/minecraft/class_1269;official aLdkg;a(Ldva;Ldcc;Lcct;)Lccu;
-
finishUsing
- Mappings:
Namespace Name Mixin selector named finishUsingLnet/minecraft/item/ItemStack;finishUsing(Lnet/minecraft/world/World;Lnet/minecraft/entity/LivingEntity;)Lnet/minecraft/item/ItemStack;intermediary method_7910Lnet/minecraft/class_1799;method_7910(Lnet/minecraft/class_1937;Lnet/minecraft/class_1309;)Lnet/minecraft/class_1799;official aLdkg;a(Ldva;Lchc;)Ldkg;
-
applyRemainderAndCooldown
- Mappings:
Namespace Name Mixin selector named applyRemainderAndCooldownLnet/minecraft/item/ItemStack;applyRemainderAndCooldown(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/item/ItemStack;)Lnet/minecraft/item/ItemStack;intermediary method_62837Lnet/minecraft/class_1799;method_62837(Lnet/minecraft/class_1309;Lnet/minecraft/class_1799;)Lnet/minecraft/class_1799;official aLdkg;a(Lchc;Ldkg;)Ldkg;
-
getMaxCount
public int getMaxCount()- Mappings:
Namespace Name Mixin selector named getMaxCountLnet/minecraft/item/ItemStack;getMaxCount()Iintermediary method_7914Lnet/minecraft/class_1799;method_7914()Iofficial kLdkg;k()I
-
isStackable
public boolean isStackable()Returns whether the item stack can have item count above1.Stackable items must have the maximum count that is more than
1and cannot be damaged.- Returns:
- whether the item stack can have item count above
1 - Mappings:
Namespace Name Mixin selector named isStackableLnet/minecraft/item/ItemStack;isStackable()Zintermediary method_7946Lnet/minecraft/class_1799;method_7946()Zofficial lLdkg;l()Z
-
isDamageable
public boolean isDamageable()Returns whether the item can be damaged (lose durability).Items with 0 max damage or item stacks with
DataComponentTypes.UNBREAKABLEcomponent cannot be damaged.- Returns:
- whether the item can be damaged (lose durability)
- See Also:
- Mappings:
Namespace Name Mixin selector named isDamageableLnet/minecraft/item/ItemStack;isDamageable()Zintermediary method_7963Lnet/minecraft/class_1799;method_7963()Zofficial mLdkg;m()Z
-
isDamaged
public boolean isDamaged()Returns whether the item stack is damageable and has damage.- Returns:
- whether the item stack is damageable and has damage
- See Also:
- Mappings:
Namespace Name Mixin selector named isDamagedLnet/minecraft/item/ItemStack;isDamaged()Zintermediary method_7986Lnet/minecraft/class_1799;method_7986()Zofficial nLdkg;n()Z
-
getDamage
public int getDamage()Returns the damage (lost durability) of the item stack.Note that this method does not check if the item is damageable, unlike
isDamaged().- Returns:
- the damage (lost durability) of the item stack
- See Also:
- Mappings:
Namespace Name Mixin selector named getDamageLnet/minecraft/item/ItemStack;getDamage()Iintermediary method_7919Lnet/minecraft/class_1799;method_7919()Iofficial oLdkg;o()I
-
setDamage
public void setDamage(int damage) Sets the stack's damage todamage.This does not break the item if the damage reaches the maximum, unlike
damage(int, LivingEntity, EquipmentSlot).- See Also:
- Mappings:
Namespace Name Mixin selector named setDamageLnet/minecraft/item/ItemStack;setDamage(I)Vintermediary method_7974Lnet/minecraft/class_1799;method_7974(I)Vofficial bLdkg;b(I)V
-
getMaxDamage
public int getMaxDamage()- Mappings:
Namespace Name Mixin selector named getMaxDamageLnet/minecraft/item/ItemStack;getMaxDamage()Iintermediary method_7936Lnet/minecraft/class_1799;method_7936()Iofficial pLdkg;p()I
-
shouldBreak
public boolean shouldBreak()- Mappings:
Namespace Name Mixin selector named shouldBreakLnet/minecraft/item/ItemStack;shouldBreak()Zintermediary method_61657Lnet/minecraft/class_1799;method_61657()Zofficial qLdkg;q()Z
-
willBreakNextUse
public boolean willBreakNextUse()- Mappings:
Namespace Name Mixin selector named willBreakNextUseLnet/minecraft/item/ItemStack;willBreakNextUse()Zintermediary method_63692Lnet/minecraft/class_1799;method_63692()Zofficial rLdkg;r()Z
-
damage
public void damage(int amount, ServerWorld world, @Nullable ServerPlayerEntity player, Consumer<Item> breakCallback) Damages this item stack. This method should be used when a non-entity, such as a dispenser, damages the stack. This does not damage non-damageable stacks, and the enchantments are applied toamountbefore damaging.If
playeris notnull, this triggersCriteria.ITEM_DURABILITY_CHANGED.When the item "breaks", that is, the stack's damage is equal to or above the maximum damage,
breakCallbackis run. Note that this method automatically decrements the stack size.- Mappings:
Namespace Name Mixin selector named damageLnet/minecraft/item/ItemStack;damage(ILnet/minecraft/server/world/ServerWorld;Lnet/minecraft/server/network/ServerPlayerEntity;Ljava/util/function/Consumer;)Vintermediary method_7956Lnet/minecraft/class_1799;method_7956(ILnet/minecraft/class_3218;Lnet/minecraft/class_3222;Ljava/util/function/Consumer;)Vofficial aLdkg;a(ILaxg;Laxh;Ljava/util/function/Consumer;)V
-
calculateDamage
- Mappings:
Namespace Name Mixin selector named calculateDamageLnet/minecraft/item/ItemStack;calculateDamage(ILnet/minecraft/server/world/ServerWorld;Lnet/minecraft/server/network/ServerPlayerEntity;)Iintermediary method_61651Lnet/minecraft/class_1799;method_61651(ILnet/minecraft/class_3218;Lnet/minecraft/class_3222;)Iofficial aLdkg;a(ILaxg;Laxh;)I
-
onDurabilityChange
private void onDurabilityChange(int damage, @Nullable ServerPlayerEntity player, Consumer<Item> breakCallback) - Mappings:
Namespace Name Mixin selector named onDurabilityChangeLnet/minecraft/item/ItemStack;onDurabilityChange(ILnet/minecraft/server/network/ServerPlayerEntity;Ljava/util/function/Consumer;)Vintermediary method_61652Lnet/minecraft/class_1799;method_61652(ILnet/minecraft/class_3222;Ljava/util/function/Consumer;)Vofficial aLdkg;a(ILaxh;Ljava/util/function/Consumer;)V
-
damage
- Mappings:
Namespace Name Mixin selector named damageLnet/minecraft/item/ItemStack;damage(ILnet/minecraft/entity/player/PlayerEntity;)Vintermediary method_61653Lnet/minecraft/class_1799;method_61653(ILnet/minecraft/class_1657;)Vofficial aLdkg;a(ILdcc;)V
-
damage
- Mappings:
Namespace Name Mixin selector named damageLnet/minecraft/item/ItemStack;damage(ILnet/minecraft/entity/LivingEntity;Lnet/minecraft/util/Hand;)Vintermediary method_71012Lnet/minecraft/class_1799;method_71012(ILnet/minecraft/class_1309;Lnet/minecraft/class_1268;)Vofficial aLdkg;a(ILchc;Lcct;)V
-
damage
Damages this item stack. This method should be used when an entity, including a player, damages the stack. This does not damage non-damageable stacks, and the enchantments are applied toamountbefore damaging. Additionally, ifentityis a player in creative mode, the stack will not be damaged.If
entityis a player, this triggersCriteria.ITEM_DURABILITY_CHANGED.If the stack's damage is equal to or above the maximum damage (i.e. the item is "broken"), this will send the equipment break status, decrement the stack, and increment
Stats.BROKENif the stack is held by a player.- Parameters:
slot- the slot in which the stack is held- Mappings:
Namespace Name Mixin selector named damageLnet/minecraft/item/ItemStack;damage(ILnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/EquipmentSlot;)Vintermediary method_7970Lnet/minecraft/class_1799;method_7970(ILnet/minecraft/class_1309;Lnet/minecraft/class_1304;)Vofficial aLdkg;a(ILchc;Lcgl;)V
-
damage
public ItemStack damage(int amount, ItemConvertible itemAfterBreaking, LivingEntity entity, EquipmentSlot slot) - Mappings:
Namespace Name Mixin selector named damageLnet/minecraft/item/ItemStack;damage(ILnet/minecraft/item/ItemConvertible;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/EquipmentSlot;)Lnet/minecraft/item/ItemStack;intermediary method_60986Lnet/minecraft/class_1799;method_60986(ILnet/minecraft/class_1935;Lnet/minecraft/class_1309;Lnet/minecraft/class_1304;)Lnet/minecraft/class_1799;official aLdkg;a(ILduz;Lchc;Lcgl;)Ldkg;
-
isItemBarVisible
public boolean isItemBarVisible()- Mappings:
Namespace Name Mixin selector named isItemBarVisibleLnet/minecraft/item/ItemStack;isItemBarVisible()Zintermediary method_31578Lnet/minecraft/class_1799;method_31578()Zofficial sLdkg;s()Z
-
getItemBarStep
public int getItemBarStep()Returns the length of the filled section of the durability bar in pixels (out of 13).- Returns:
- the length of the filled section of the durability bar in pixels (out of 13)
- Mappings:
Namespace Name Mixin selector named getItemBarStepLnet/minecraft/item/ItemStack;getItemBarStep()Iintermediary method_31579Lnet/minecraft/class_1799;method_31579()Iofficial tLdkg;t()I
-
getItemBarColor
public int getItemBarColor()Returns the color of the filled section of the durability bar.- Returns:
- the color of the filled section of the durability bar
- Mappings:
Namespace Name Mixin selector named getItemBarColorLnet/minecraft/item/ItemStack;getItemBarColor()Iintermediary method_31580Lnet/minecraft/class_1799;method_31580()Iofficial uLdkg;u()I
-
onStackClicked
- Mappings:
Namespace Name Mixin selector named onStackClickedLnet/minecraft/item/ItemStack;onStackClicked(Lnet/minecraft/screen/slot/Slot;Lnet/minecraft/util/ClickType;Lnet/minecraft/entity/player/PlayerEntity;)Zintermediary method_31575Lnet/minecraft/class_1799;method_31575(Lnet/minecraft/class_1735;Lnet/minecraft/class_5536;Lnet/minecraft/class_1657;)Zofficial aLdkg;a(Ldhv;Ldgh;Ldcc;)Z
-
onClicked
public boolean onClicked(ItemStack stack, Slot slot, ClickType clickType, PlayerEntity player, StackReference cursorStackReference) - Mappings:
Namespace Name Mixin selector named onClickedLnet/minecraft/item/ItemStack;onClicked(Lnet/minecraft/item/ItemStack;Lnet/minecraft/screen/slot/Slot;Lnet/minecraft/util/ClickType;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/inventory/StackReference;)Zintermediary method_31576Lnet/minecraft/class_1799;method_31576(Lnet/minecraft/class_1799;Lnet/minecraft/class_1735;Lnet/minecraft/class_5536;Lnet/minecraft/class_1657;Lnet/minecraft/class_5630;)Zofficial aLdkg;a(Ldkg;Ldhv;Ldgh;Ldcc;Lcht;)Z
-
postHit
- Mappings:
Namespace Name Mixin selector named postHitLnet/minecraft/item/ItemStack;postHit(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/LivingEntity;)Zintermediary method_7979Lnet/minecraft/class_1799;method_7979(Lnet/minecraft/class_1309;Lnet/minecraft/class_1309;)Zofficial aLdkg;a(Lchc;Lchc;)Z
-
postDamageEntity
- Mappings:
Namespace Name Mixin selector named postDamageEntityLnet/minecraft/item/ItemStack;postDamageEntity(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/LivingEntity;)Vintermediary method_59979Lnet/minecraft/class_1799;method_59979(Lnet/minecraft/class_1309;Lnet/minecraft/class_1309;)Vofficial bLdkg;b(Lchc;Lchc;)V
-
postMine
- Mappings:
Namespace Name Mixin selector named postMineLnet/minecraft/item/ItemStack;postMine(Lnet/minecraft/world/World;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/player/PlayerEntity;)Vintermediary method_7952Lnet/minecraft/class_1799;method_7952(Lnet/minecraft/class_1937;Lnet/minecraft/class_2680;Lnet/minecraft/class_2338;Lnet/minecraft/class_1657;)Vofficial aLdkg;a(Ldva;Lemu;Liv;Ldcc;)V
-
isSuitableFor
Determines whether this item can be used as a suitable tool for mining the specified block.Depending on block implementation, when combined together, the correct item and block may achieve a better mining speed and yield drops that would not be obtained when mining otherwise.
- Returns:
- values consistent with calls to
Item.isCorrectForDrops(net.minecraft.item.ItemStack, net.minecraft.block.BlockState) - See Also:
- Mappings:
Namespace Name Mixin selector named isSuitableForLnet/minecraft/item/ItemStack;isSuitableFor(Lnet/minecraft/block/BlockState;)Zintermediary method_7951Lnet/minecraft/class_1799;method_7951(Lnet/minecraft/class_2680;)Zofficial bLdkg;b(Lemu;)Z
-
useOnEntity
- Mappings:
Namespace Name Mixin selector named useOnEntityLnet/minecraft/item/ItemStack;useOnEntity(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/util/Hand;)Lnet/minecraft/util/ActionResult;intermediary method_7920Lnet/minecraft/class_1799;method_7920(Lnet/minecraft/class_1657;Lnet/minecraft/class_1309;Lnet/minecraft/class_1268;)Lnet/minecraft/class_1269;official aLdkg;a(Ldcc;Lchc;Lcct;)Lccu;
-
copy
Returns a copy of this item stack, including the item count, components, and bobbing animation time.- Returns:
- a copy of this item stack, including the item count, components, and bobbing animation time
- See Also:
- Mappings:
Namespace Name Mixin selector named copyLnet/minecraft/item/ItemStack;copy()Lnet/minecraft/item/ItemStack;intermediary method_7972Lnet/minecraft/class_1799;method_7972()Lnet/minecraft/class_1799;official vLdkg;v()Ldkg;
-
copyWithCount
Returns a copy of this item stack, including the components, and bobbing animation time, with the item count set tocount.- Parameters:
count- the item count of the resultant stack- Returns:
- a copy of this item stack, including the components, and bobbing animation time,
with the item count set to
count - See Also:
- Mappings:
Namespace Name Mixin selector named copyWithCountLnet/minecraft/item/ItemStack;copyWithCount(I)Lnet/minecraft/item/ItemStack;intermediary method_46651Lnet/minecraft/class_1799;method_46651(I)Lnet/minecraft/class_1799;official cLdkg;c(I)Ldkg;
-
withItem
- Mappings:
Namespace Name Mixin selector named withItemLnet/minecraft/item/ItemStack;withItem(Lnet/minecraft/item/ItemConvertible;)Lnet/minecraft/item/ItemStack;intermediary method_60503Lnet/minecraft/class_1799;method_60503(Lnet/minecraft/class_1935;)Lnet/minecraft/class_1799;official aLdkg;a(Lduz;)Ldkg;
-
copyComponentsToNewStack
Returns a new item stack with the components copied from this item stack.- Parameters:
item- the item of the resultant stackcount- the item count of the resultant stack- Returns:
- a new item stack with the components copied from this item stack
- See Also:
- Mappings:
Namespace Name Mixin selector named copyComponentsToNewStackLnet/minecraft/item/ItemStack;copyComponentsToNewStack(Lnet/minecraft/item/ItemConvertible;I)Lnet/minecraft/item/ItemStack;intermediary method_56701Lnet/minecraft/class_1799;method_56701(Lnet/minecraft/class_1935;I)Lnet/minecraft/class_1799;official aLdkg;a(Lduz;I)Ldkg;
-
copyComponentsToNewStackIgnoreEmpty
Returns a new item stack with the components copied from this item stack, even if this stack is empty.- Parameters:
item- the item of the resultant stackcount- the item count of the resultant stack- Returns:
- a new item stack with the components copied from this item stack, even if this stack is empty
- See Also:
- Mappings:
Namespace Name Mixin selector named copyComponentsToNewStackIgnoreEmptyLnet/minecraft/item/ItemStack;copyComponentsToNewStackIgnoreEmpty(Lnet/minecraft/item/ItemConvertible;I)Lnet/minecraft/item/ItemStack;intermediary method_56704Lnet/minecraft/class_1799;method_56704(Lnet/minecraft/class_1935;I)Lnet/minecraft/class_1799;official bLdkg;b(Lduz;I)Ldkg;
-
areEqual
Returns whether the given item stacks are equal, including the item count and components.- Returns:
- whether the given item stacks are equal, including the item count and components
- See Also:
- Mappings:
Namespace Name Mixin selector named areEqualLnet/minecraft/item/ItemStack;areEqual(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)Zintermediary method_7973Lnet/minecraft/class_1799;method_7973(Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)Zofficial aLdkg;a(Ldkg;Ldkg;)Z
-
stacksEqual
Deprecated.- Mappings:
Namespace Name Mixin selector named stacksEqualLnet/minecraft/item/ItemStack;stacksEqual(Ljava/util/List;Ljava/util/List;)Zintermediary method_57362Lnet/minecraft/class_1799;method_57362(Ljava/util/List;Ljava/util/List;)Zofficial aLdkg;a(Ljava/util/List;Ljava/util/List;)Z
-
areItemsEqual
Returns whether the given item stacks contain the same item, regardless of item count or components.- Returns:
- whether the given item stacks contain the same item, regardless of item count or components
- See Also:
- Mappings:
Namespace Name Mixin selector named areItemsEqualLnet/minecraft/item/ItemStack;areItemsEqual(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)Zintermediary method_7984Lnet/minecraft/class_1799;method_7984(Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)Zofficial bLdkg;b(Ldkg;Ldkg;)Z
-
areItemsAndComponentsEqual
Returns whether the given item stacks' items and components are equal.If this returns
true, the two item stacks can be combined into one, as long as the resulting item count does not exceed the maximum item count- Returns:
- whether the given item stacks' items and components are equal
- See Also:
- Mappings:
Namespace Name Mixin selector named areItemsAndComponentsEqualLnet/minecraft/item/ItemStack;areItemsAndComponentsEqual(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)Zintermediary method_31577Lnet/minecraft/class_1799;method_31577(Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)Zofficial cLdkg;c(Ldkg;Ldkg;)Z
-
shouldSkipHandAnimationOnSwap
public static boolean shouldSkipHandAnimationOnSwap(ItemStack from, ItemStack to, Predicate<ComponentType<?>> skippedComponent) - Mappings:
Namespace Name Mixin selector named shouldSkipHandAnimationOnSwapLnet/minecraft/item/ItemStack;shouldSkipHandAnimationOnSwap(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;Ljava/util/function/Predicate;)Zintermediary method_75222Lnet/minecraft/class_1799;method_75222(Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;Ljava/util/function/Predicate;)Zofficial aLdkg;a(Ldkg;Ldkg;Ljava/util/function/Predicate;)Z
-
createOptionalCodec
- Mappings:
Namespace Name Mixin selector named createOptionalCodecLnet/minecraft/item/ItemStack;createOptionalCodec(Ljava/lang/String;)Lcom/mojang/serialization/MapCodec;intermediary method_56702Lnet/minecraft/class_1799;method_56702(Ljava/lang/String;)Lcom/mojang/serialization/MapCodec;official aLdkg;a(Ljava/lang/String;)Lcom/mojang/serialization/MapCodec;
-
hashCode
- Mappings:
Namespace Name Mixin selector named hashCodeLnet/minecraft/item/ItemStack;hashCode(Lnet/minecraft/item/ItemStack;)Iintermediary method_57355Lnet/minecraft/class_1799;method_57355(Lnet/minecraft/class_1799;)Iofficial bLdkg;b(Ldkg;)I
-
listHashCode
Deprecated.- Mappings:
Namespace Name Mixin selector named listHashCodeLnet/minecraft/item/ItemStack;listHashCode(Ljava/util/List;)Iintermediary method_57361Lnet/minecraft/class_1799;method_57361(Ljava/util/List;)Iofficial aLdkg;a(Ljava/util/List;)I
-
toString
-
inventoryTick
- Mappings:
Namespace Name Mixin selector named inventoryTickLnet/minecraft/item/ItemStack;inventoryTick(Lnet/minecraft/world/World;Lnet/minecraft/entity/Entity;Lnet/minecraft/entity/EquipmentSlot;)Vintermediary method_7917Lnet/minecraft/class_1799;method_7917(Lnet/minecraft/class_1937;Lnet/minecraft/class_1297;Lnet/minecraft/class_1304;)Vofficial aLdkg;a(Ldva;Lcga;Lcgl;)V
-
onCraftByPlayer
- Mappings:
Namespace Name Mixin selector named onCraftByPlayerLnet/minecraft/item/ItemStack;onCraftByPlayer(Lnet/minecraft/entity/player/PlayerEntity;I)Vintermediary method_7982Lnet/minecraft/class_1799;method_7982(Lnet/minecraft/class_1657;I)Vofficial aLdkg;a(Ldcc;I)V
-
onCraftByCrafter
- Mappings:
Namespace Name Mixin selector named onCraftByCrafterLnet/minecraft/item/ItemStack;onCraftByCrafter(Lnet/minecraft/world/World;)Vintermediary method_54466Lnet/minecraft/class_1799;method_54466(Lnet/minecraft/class_1937;)Vofficial aLdkg;a(Ldva;)V
-
getMaxUseTime
- Mappings:
Namespace Name Mixin selector named getMaxUseTimeLnet/minecraft/item/ItemStack;getMaxUseTime(Lnet/minecraft/entity/LivingEntity;)Iintermediary method_7935Lnet/minecraft/class_1799;method_7935(Lnet/minecraft/class_1309;)Iofficial aLdkg;a(Lchc;)I
-
getUseAction
- Mappings:
Namespace Name Mixin selector named getUseActionLnet/minecraft/item/ItemStack;getUseAction()Lnet/minecraft/item/consume/UseAction;intermediary method_7976Lnet/minecraft/class_1799;method_7976()Lnet/minecraft/class_1839;official wLdkg;w()Ldki;
-
onStoppedUsing
- Mappings:
Namespace Name Mixin selector named onStoppedUsingLnet/minecraft/item/ItemStack;onStoppedUsing(Lnet/minecraft/world/World;Lnet/minecraft/entity/LivingEntity;I)Vintermediary method_7930Lnet/minecraft/class_1799;method_7930(Lnet/minecraft/class_1937;Lnet/minecraft/class_1309;I)Vofficial aLdkg;a(Ldva;Lchc;I)V
-
isUsedOnRelease
public boolean isUsedOnRelease()- Mappings:
Namespace Name Mixin selector named isUsedOnReleaseLnet/minecraft/item/ItemStack;isUsedOnRelease()Zintermediary method_7967Lnet/minecraft/class_1799;method_7967()Zofficial xLdkg;x()Z
-
set
Sets the componenttypefor this item stack tovalue.If
valueisnull, the component is removed and the base component is unset. To reverse the stack-specific change, instead pass the default value asvalue.- Returns:
- the previous value set
- See Also:
- Mappings:
Namespace Name Mixin selector named setLnet/minecraft/item/ItemStack;set(Lnet/minecraft/component/ComponentType;Ljava/lang/Object;)Ljava/lang/Object;intermediary method_57379Lnet/minecraft/class_1799;method_57379(Lnet/minecraft/class_9331;Ljava/lang/Object;)Ljava/lang/Object;official bLdkg;b(Lkj;Ljava/lang/Object;)Ljava/lang/Object;
-
set
- Mappings:
Namespace Name Mixin selector named setLnet/minecraft/item/ItemStack;set(Lnet/minecraft/component/Component;)Ljava/lang/Object;intermediary method_74887Lnet/minecraft/class_1799;method_74887(Lnet/minecraft/class_9336;)Ljava/lang/Object;official aLdkg;a(Lkm;)Ljava/lang/Object;
-
copy
- Mappings:
Namespace Name Mixin selector named copyLnet/minecraft/item/ItemStack;copy(Lnet/minecraft/component/ComponentType;Lnet/minecraft/component/ComponentsAccess;)Vintermediary method_66697Lnet/minecraft/class_1799;method_66697(Lnet/minecraft/class_9331;Lnet/minecraft/class_9473;)Vofficial aLdkg;a(Lkj;Lkf;)V
-
apply
public <T,U> @Nullable T apply(ComponentType<T> type, T defaultValue, U change, BiFunction<T, U, T> applier) Sets the componenttypeby passing the current value andchangetoapplier, then setting its return value as the value. If the component is missing,defaultValueis used as the default.In practice,
applieris a reference to a method of the component class with one parameter, that returns a new instance of the component with the specific value changed tochange. For example, adding a lore can be accomplished by passing reference toLoreComponent.with(net.minecraft.text.Text)and the added lore, likestack.apply(DataComponentTypes.LORE, LoreComponent.DEFAULT, text, LoreComponent::with).- Returns:
- the previous value set
- See Also:
- Implementation Note:
- This is the same as setting
applier.apply(stack.getOrDefault(type, defaultValue), change). - Mappings:
Namespace Name Mixin selector named applyLnet/minecraft/item/ItemStack;apply(Lnet/minecraft/component/ComponentType;Ljava/lang/Object;Ljava/lang/Object;Ljava/util/function/BiFunction;)Ljava/lang/Object;intermediary method_57367Lnet/minecraft/class_1799;method_57367(Lnet/minecraft/class_9331;Ljava/lang/Object;Ljava/lang/Object;Ljava/util/function/BiFunction;)Ljava/lang/Object;official aLdkg;a(Lkj;Ljava/lang/Object;Ljava/lang/Object;Ljava/util/function/BiFunction;)Ljava/lang/Object;
-
apply
Sets the componenttypeby passing the current value (ordefaultValueif the component is missing) toapplierand then setting its return value as the value.- Returns:
- the previous value set
- See Also:
- Implementation Note:
- This is the same as setting
applier.apply(stack.getOrDefault(type, defaultValue)). - Mappings:
Namespace Name Mixin selector named applyLnet/minecraft/item/ItemStack;apply(Lnet/minecraft/component/ComponentType;Ljava/lang/Object;Ljava/util/function/UnaryOperator;)Ljava/lang/Object;intermediary method_57368Lnet/minecraft/class_1799;method_57368(Lnet/minecraft/class_9331;Ljava/lang/Object;Ljava/util/function/UnaryOperator;)Ljava/lang/Object;official aLdkg;a(Lkj;Ljava/lang/Object;Ljava/util/function/UnaryOperator;)Ljava/lang/Object;
-
remove
Removes the componenttype. If it is in the stack's base component, it is unset and the component becomes missing. To reverse the stack-specific change, instead pass the default value asvalue.- Returns:
- the previous value set
- Mappings:
Namespace Name Mixin selector named removeLnet/minecraft/item/ItemStack;remove(Lnet/minecraft/component/ComponentType;)Ljava/lang/Object;intermediary method_57381Lnet/minecraft/class_1799;method_57381(Lnet/minecraft/class_9331;)Ljava/lang/Object;official eLdkg;e(Lkj;)Ljava/lang/Object;
-
applyChanges
- Mappings:
Namespace Name Mixin selector named applyChangesLnet/minecraft/item/ItemStack;applyChanges(Lnet/minecraft/component/ComponentChanges;)Vintermediary method_59692Lnet/minecraft/class_1799;method_59692(Lnet/minecraft/class_9326;)Vofficial aLdkg;a(Lki;)V
-
applyUnvalidatedChanges
- Mappings:
Namespace Name Mixin selector named applyUnvalidatedChangesLnet/minecraft/item/ItemStack;applyUnvalidatedChanges(Lnet/minecraft/component/ComponentChanges;)Vintermediary method_57366Lnet/minecraft/class_1799;method_57366(Lnet/minecraft/class_9326;)Vofficial bLdkg;b(Lki;)V
-
applyComponentsFrom
- Mappings:
Namespace Name Mixin selector named applyComponentsFromLnet/minecraft/item/ItemStack;applyComponentsFrom(Lnet/minecraft/component/ComponentMap;)Vintermediary method_57365Lnet/minecraft/class_1799;method_57365(Lnet/minecraft/class_9323;)Vofficial bLdkg;b(Lkh;)V
-
getName
Returns the custom name of the stack if it exists, or the item's name.- Returns:
- the custom name of the stack if it exists, or the item's name
- Mappings:
Namespace Name Mixin selector named getNameLnet/minecraft/item/ItemStack;getName()Lnet/minecraft/text/Text;intermediary method_7964Lnet/minecraft/class_1799;method_7964()Lnet/minecraft/class_2561;official yLdkg;y()Lyi;
-
getCustomName
Returns the custom name or book title of the stack if it exists, ornull.- Returns:
- the custom name or book title of the stack if it exists, or
null - Mappings:
Namespace Name Mixin selector named getCustomNameLnet/minecraft/item/ItemStack;getCustomName()Lnet/minecraft/text/Text;intermediary method_65130Lnet/minecraft/class_1799;method_65130()Lnet/minecraft/class_2561;official zLdkg;z()Lyi;
-
getItemName
- Mappings:
Namespace Name Mixin selector named getItemNameLnet/minecraft/item/ItemStack;getItemName()Lnet/minecraft/text/Text;intermediary method_63693Lnet/minecraft/class_1799;method_63693()Lnet/minecraft/class_2561;official ALdkg;A()Lyi;
-
getFormattedName
- Mappings:
Namespace Name Mixin selector named getFormattedNameLnet/minecraft/item/ItemStack;getFormattedName()Lnet/minecraft/text/Text;intermediary method_63015Lnet/minecraft/class_1799;method_63015()Lnet/minecraft/class_2561;official BLdkg;B()Lyi;
-
appendComponentTooltip
public <T extends TooltipAppender> void appendComponentTooltip(ComponentType<T> componentType, Item.TooltipContext context, TooltipDisplayComponent displayComponent, Consumer<Text> textConsumer, TooltipType type) - Mappings:
Namespace Name Mixin selector named appendComponentTooltipLnet/minecraft/item/ItemStack;appendComponentTooltip(Lnet/minecraft/component/ComponentType;Lnet/minecraft/item/Item$TooltipContext;Lnet/minecraft/component/type/TooltipDisplayComponent;Ljava/util/function/Consumer;Lnet/minecraft/item/tooltip/TooltipType;)Vintermediary method_57369Lnet/minecraft/class_1799;method_57369(Lnet/minecraft/class_9331;Lnet/minecraft/class_1792$class_9635;Lnet/minecraft/class_10712;Ljava/util/function/Consumer;Lnet/minecraft/class_1836;)Vofficial aLdkg;a(Lkj;Ldkc$b;Ldnp;Ljava/util/function/Consumer;Ldlw;)V
-
getTooltip
public List<Text> getTooltip(Item.TooltipContext context, @Nullable PlayerEntity player, TooltipType type) - Mappings:
Namespace Name Mixin selector named getTooltipLnet/minecraft/item/ItemStack;getTooltip(Lnet/minecraft/item/Item$TooltipContext;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/item/tooltip/TooltipType;)Ljava/util/List;intermediary method_7950Lnet/minecraft/class_1799;method_7950(Lnet/minecraft/class_1792$class_9635;Lnet/minecraft/class_1657;Lnet/minecraft/class_1836;)Ljava/util/List;official aLdkg;a(Ldkc$b;Ldcc;Ldlw;)Ljava/util/List;
-
appendTooltip
public void appendTooltip(Item.TooltipContext context, TooltipDisplayComponent displayComponent, @Nullable PlayerEntity player, TooltipType type, Consumer<Text> textConsumer) - Mappings:
Namespace Name Mixin selector named appendTooltipLnet/minecraft/item/ItemStack;appendTooltip(Lnet/minecraft/item/Item$TooltipContext;Lnet/minecraft/component/type/TooltipDisplayComponent;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/item/tooltip/TooltipType;Ljava/util/function/Consumer;)Vintermediary method_67194Lnet/minecraft/class_1799;method_67194(Lnet/minecraft/class_1792$class_9635;Lnet/minecraft/class_10712;Lnet/minecraft/class_1657;Lnet/minecraft/class_1836;Ljava/util/function/Consumer;)Vofficial aLdkg;a(Ldkc$b;Ldnp;Ldcc;Ldlw;Ljava/util/function/Consumer;)V
-
appendTooltipIfComponentExists
private void appendTooltipIfComponentExists(ComponentType<?> type, Text tooltip, TooltipDisplayComponent displayComponent, Consumer<Text> textConsumer) - Mappings:
Namespace Name Mixin selector named appendTooltipIfComponentExistsLnet/minecraft/item/ItemStack;appendTooltipIfComponentExists(Lnet/minecraft/component/ComponentType;Lnet/minecraft/text/Text;Lnet/minecraft/component/type/TooltipDisplayComponent;Ljava/util/function/Consumer;)Vintermediary method_75223Lnet/minecraft/class_1799;method_75223(Lnet/minecraft/class_9331;Lnet/minecraft/class_2561;Lnet/minecraft/class_10712;Ljava/util/function/Consumer;)Vofficial aLdkg;a(Lkj;Lyi;Ldnp;Ljava/util/function/Consumer;)V
-
appendAttributeModifiersTooltip
private void appendAttributeModifiersTooltip(Consumer<Text> textConsumer, TooltipDisplayComponent displayComponent, @Nullable PlayerEntity player) - Mappings:
Namespace Name Mixin selector named appendAttributeModifiersTooltipLnet/minecraft/item/ItemStack;appendAttributeModifiersTooltip(Ljava/util/function/Consumer;Lnet/minecraft/component/type/TooltipDisplayComponent;Lnet/minecraft/entity/player/PlayerEntity;)Vintermediary method_57363Lnet/minecraft/class_1799;method_57363(Ljava/util/function/Consumer;Lnet/minecraft/class_10712;Lnet/minecraft/class_1657;)Vofficial aLdkg;a(Ljava/util/function/Consumer;Ldnp;Ldcc;)V
-
hasGlint
public boolean hasGlint()- Mappings:
Namespace Name Mixin selector named hasGlintLnet/minecraft/item/ItemStack;hasGlint()Zintermediary method_7958Lnet/minecraft/class_1799;method_7958()Zofficial CLdkg;C()Z
-
getRarity
- Mappings:
Namespace Name Mixin selector named getRarityLnet/minecraft/item/ItemStack;getRarity()Lnet/minecraft/util/Rarity;intermediary method_7932Lnet/minecraft/class_1799;method_7932()Lnet/minecraft/class_1814;official DLdkg;D()Ldlc;
-
isEnchantable
public boolean isEnchantable()Returns whether this item stack can be enchanted with an enchanting table.This is not used for other methods of enchanting like anvils.
- Returns:
- whether this item stack can be enchanted with an enchanting table
- Mappings:
Namespace Name Mixin selector named isEnchantableLnet/minecraft/item/ItemStack;isEnchantable()Zintermediary method_7923Lnet/minecraft/class_1799;method_7923()Zofficial ELdkg;E()Z
-
addEnchantment
Enchants this item with the given enchantment and level.This should not be used with enchanted books, as the book itself is not enchanted and therefore does not store enchantments under
DataComponentTypes.ENCHANTMENTS.- See Also:
- Mappings:
Namespace Name Mixin selector named addEnchantmentLnet/minecraft/item/ItemStack;addEnchantment(Lnet/minecraft/registry/entry/RegistryEntry;I)Vintermediary method_7978Lnet/minecraft/class_1799;method_7978(Lnet/minecraft/class_6880;I)Vofficial aLdkg;a(Ljf;I)V
-
hasEnchantments
public boolean hasEnchantments()Returns whether the item stack has any enchantments.This will return
falsefor enchanted books, as the book itself is not enchanted and therefore does not store enchantments underDataComponentTypes.ENCHANTMENTS.- Returns:
- whether the item stack has any enchantments
- See Also:
- Mappings:
Namespace Name Mixin selector named hasEnchantmentsLnet/minecraft/item/ItemStack;hasEnchantments()Zintermediary method_7942Lnet/minecraft/class_1799;method_7942()Zofficial FLdkg;F()Z
-
getEnchantments
- Mappings:
Namespace Name Mixin selector named getEnchantmentsLnet/minecraft/item/ItemStack;getEnchantments()Lnet/minecraft/component/type/ItemEnchantmentsComponent;intermediary method_58657Lnet/minecraft/class_1799;method_58657()Lnet/minecraft/class_9304;official GLdkg;G()Ldrg;
-
isInFrame
public boolean isInFrame()Returns whether the item stack is in an item frame.- Returns:
- whether the item stack is in an item frame
- See Also:
- Mappings:
Namespace Name Mixin selector named isInFrameLnet/minecraft/item/ItemStack;isInFrame()Zintermediary method_7961Lnet/minecraft/class_1799;method_7961()Zofficial HLdkg;H()Z
-
setHolder
Sets the stack's holder toholder.This is used by item frames and item entities, and does not need to be called for other entities.
- See Also:
- Mappings:
Namespace Name Mixin selector named setHolderLnet/minecraft/item/ItemStack;setHolder(Lnet/minecraft/entity/Entity;)Vintermediary method_27320Lnet/minecraft/class_1799;method_27320(Lnet/minecraft/class_1297;)Vofficial aLdkg;a(Lcga;)V
-
getFrame
Returns the item frame that holds the stack, ornullif inapplicable.- Returns:
- the item frame that holds the stack, or
nullif inapplicable - See Also:
- Mappings:
Namespace Name Mixin selector named getFrameLnet/minecraft/item/ItemStack;getFrame()Lnet/minecraft/entity/decoration/ItemFrameEntity;intermediary method_7945Lnet/minecraft/class_1799;method_7945()Lnet/minecraft/class_1533;official ILdkg;I()Lcxz;
-
getHolder
Returns the entity that holds the stack, ornullif inapplicable.- Returns:
- the entity that holds the stack, or
nullif inapplicable - See Also:
- Mappings:
Namespace Name Mixin selector named getHolderLnet/minecraft/item/ItemStack;getHolder()Lnet/minecraft/entity/Entity;intermediary method_27319Lnet/minecraft/class_1799;method_27319()Lnet/minecraft/class_1297;official JLdkg;J()Lcga;
-
applyAttributeModifier
public void applyAttributeModifier(AttributeModifierSlot slot, TriConsumer<RegistryEntry<EntityAttribute>, EntityAttributeModifier, AttributeModifiersComponent.Display> attributeModifierConsumer) - Mappings:
Namespace Name Mixin selector named applyAttributeModifierLnet/minecraft/item/ItemStack;applyAttributeModifier(Lnet/minecraft/component/type/AttributeModifierSlot;Lorg/apache/commons/lang3/function/TriConsumer;)Vintermediary method_60617Lnet/minecraft/class_1799;method_60617(Lnet/minecraft/class_9274;Lorg/apache/commons/lang3/function/TriConsumer;)Vofficial aLdkg;a(Lcgm;Lorg/apache/commons/lang3/function/TriConsumer;)V
-
applyAttributeModifiers
public void applyAttributeModifiers(EquipmentSlot slot, BiConsumer<RegistryEntry<EntityAttribute>, EntityAttributeModifier> attributeModifierConsumer) - Mappings:
Namespace Name Mixin selector named applyAttributeModifiersLnet/minecraft/item/ItemStack;applyAttributeModifiers(Lnet/minecraft/entity/EquipmentSlot;Ljava/util/function/BiConsumer;)Vintermediary method_57354Lnet/minecraft/class_1799;method_57354(Lnet/minecraft/class_1304;Ljava/util/function/BiConsumer;)Vofficial aLdkg;a(Lcgl;Ljava/util/function/BiConsumer;)V
-
toHoverableText
Returns a text consisting of the bracketed stack name that can be hovered to show the item stack's tooltip.- Returns:
- a text consisting of the bracketed stack name that can be hovered to show the item stack's tooltip
- Mappings:
Namespace Name Mixin selector named toHoverableTextLnet/minecraft/item/ItemStack;toHoverableText()Lnet/minecraft/text/Text;intermediary method_7954Lnet/minecraft/class_1799;method_7954()Lnet/minecraft/class_2561;official KLdkg;K()Lyi;
-
getSwingAnimation
- Mappings:
Namespace Name Mixin selector named getSwingAnimationLnet/minecraft/item/ItemStack;getSwingAnimation()Lnet/minecraft/component/type/SwingAnimationComponent;intermediary method_75218Lnet/minecraft/class_1799;method_75218()Lnet/minecraft/class_12126;official LLdkg;L()Ldnn;
-
canPlaceOn
- Mappings:
Namespace Name Mixin selector named canPlaceOnLnet/minecraft/item/ItemStack;canPlaceOn(Lnet/minecraft/block/pattern/CachedBlockPosition;)Zintermediary method_57357Lnet/minecraft/class_1799;method_57357(Lnet/minecraft/class_2694;)Zofficial aLdkg;a(Lemy;)Z
-
canBreak
- Mappings:
Namespace Name Mixin selector named canBreakLnet/minecraft/item/ItemStack;canBreak(Lnet/minecraft/block/pattern/CachedBlockPosition;)Zintermediary method_57373Lnet/minecraft/class_1799;method_57373(Lnet/minecraft/class_2694;)Zofficial bLdkg;b(Lemy;)Z
-
getBobbingAnimationTime
public int getBobbingAnimationTime()- Mappings:
Namespace Name Mixin selector named getBobbingAnimationTimeLnet/minecraft/item/ItemStack;getBobbingAnimationTime()Iintermediary method_7965Lnet/minecraft/class_1799;method_7965()Iofficial MLdkg;M()I
-
setBobbingAnimationTime
public void setBobbingAnimationTime(int bobbingAnimationTime) - Mappings:
Namespace Name Mixin selector named setBobbingAnimationTimeLnet/minecraft/item/ItemStack;setBobbingAnimationTime(I)Vintermediary method_7912Lnet/minecraft/class_1799;method_7912(I)Vofficial dLdkg;d(I)V
-
getCount
public int getCount()Returns the count of items in this item stack.- Returns:
- the count of items in this item stack
- Mappings:
Namespace Name Mixin selector named getCountLnet/minecraft/item/ItemStack;getCount()Iintermediary method_7947Lnet/minecraft/class_1799;method_7947()Iofficial NLdkg;N()I
-
setCount
public void setCount(int count) Sets the count of items in this item stack.- Parameters:
count- the count of items- Mappings:
Namespace Name Mixin selector named setCountLnet/minecraft/item/ItemStack;setCount(I)Vintermediary method_7939Lnet/minecraft/class_1799;method_7939(I)Vofficial eLdkg;e(I)V
-
capCount
public void capCount(int maxCount) Sets the count of items in this item stack to not exceedmaxCount.- Mappings:
Namespace Name Mixin selector named capCountLnet/minecraft/item/ItemStack;capCount(I)Vintermediary method_58408Lnet/minecraft/class_1799;method_58408(I)Vofficial fLdkg;f(I)V
-
increment
public void increment(int amount) Increments the count of items in this item stack.- Parameters:
amount- the amount to increment- Mappings:
Namespace Name Mixin selector named incrementLnet/minecraft/item/ItemStack;increment(I)Vintermediary method_7933Lnet/minecraft/class_1799;method_7933(I)Vofficial gLdkg;g(I)V
-
decrement
public void decrement(int amount) Decrements the count of items in this item stack.- Parameters:
amount- the amount to decrement- Mappings:
Namespace Name Mixin selector named decrementLnet/minecraft/item/ItemStack;decrement(I)Vintermediary method_7934Lnet/minecraft/class_1799;method_7934(I)Vofficial hLdkg;h(I)V
-
decrementUnlessCreative
Decrements the count of items in this item stack, unlessentityis a creative mode player.- Mappings:
Namespace Name Mixin selector named decrementUnlessCreativeLnet/minecraft/item/ItemStack;decrementUnlessCreative(ILnet/minecraft/entity/LivingEntity;)Vintermediary method_57008Lnet/minecraft/class_1799;method_57008(ILnet/minecraft/class_1309;)Vofficial aLdkg;a(ILchc;)V
-
splitUnlessCreative
- Mappings:
Namespace Name Mixin selector named splitUnlessCreativeLnet/minecraft/item/ItemStack;splitUnlessCreative(ILnet/minecraft/entity/LivingEntity;)Lnet/minecraft/item/ItemStack;intermediary method_60504Lnet/minecraft/class_1799;method_60504(ILnet/minecraft/class_1309;)Lnet/minecraft/class_1799;official bLdkg;b(ILchc;)Ldkg;
-
usageTick
- Mappings:
Namespace Name Mixin selector named usageTickLnet/minecraft/item/ItemStack;usageTick(Lnet/minecraft/world/World;Lnet/minecraft/entity/LivingEntity;I)Vintermediary method_7949Lnet/minecraft/class_1799;method_7949(Lnet/minecraft/class_1937;Lnet/minecraft/class_1309;I)Vofficial bLdkg;b(Ldva;Lchc;I)V
-
onItemEntityDestroyed
- Mappings:
Namespace Name Mixin selector named onItemEntityDestroyedLnet/minecraft/item/ItemStack;onItemEntityDestroyed(Lnet/minecraft/entity/ItemEntity;)Vintermediary method_33262Lnet/minecraft/class_1799;method_33262(Lnet/minecraft/class_1542;)Vofficial aLdkg;a(Lcyh;)V
-
takesDamageFrom
- Mappings:
Namespace Name Mixin selector named takesDamageFromLnet/minecraft/item/ItemStack;takesDamageFrom(Lnet/minecraft/entity/damage/DamageSource;)Zintermediary method_58407Lnet/minecraft/class_1799;method_58407(Lnet/minecraft/class_1282;)Zofficial aLdkg;a(Lcen;)Z
-
canRepairWith
- Mappings:
Namespace Name Mixin selector named canRepairWithLnet/minecraft/item/ItemStack;canRepairWith(Lnet/minecraft/item/ItemStack;)Zintermediary method_61655Lnet/minecraft/class_1799;method_61655(Lnet/minecraft/class_1799;)Zofficial cLdkg;c(Ldkg;)Z
-
canMine
- Mappings:
Namespace Name Mixin selector named canMineLnet/minecraft/item/ItemStack;canMine(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/player/PlayerEntity;)Zintermediary method_66334Lnet/minecraft/class_1799;method_66334(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1657;)Zofficial aLdkg;a(Lemu;Ldva;Liv;Ldcc;)Z
-
getDamageSource
- Mappings:
Namespace Name Mixin selector named getDamageSourceLnet/minecraft/item/ItemStack;getDamageSource(Lnet/minecraft/entity/LivingEntity;Ljava/util/function/Supplier;)Lnet/minecraft/entity/damage/DamageSource;intermediary method_75220Lnet/minecraft/class_1799;method_75220(Lnet/minecraft/class_1309;Ljava/util/function/Supplier;)Lnet/minecraft/class_1282;official aLdkg;a(Lchc;Ljava/util/function/Supplier;)Lcen;
-