Class ItemStack
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 NBT. 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.
NBT operations
NBT serialization
An Item Stack can be serialized withwriteNbt(NbtCompound), and deserialized with fromNbt(NbtCompound).
 | Key | Type | Purpose | 
|---|---|---|
| id | NbtString | The identifier of the item. | 
| Count | NbtByte | The count of items in the stack. | 
| tag | NbtCompound | The item stack's custom NBT. | 
Custom NBT
The item stack's custom NBT may be used to store extra information, like the block entity data for shulker boxes, or the damage of a damageable item, etc.Various methods are available to interact with the custom NBT, some methods might refer to a "sub NBT", a sub NBT is a child element of the custom NBT.
| Category | Method | Summary | 
|---|---|---|
| Custom NBT | hasNbt() | Returns whether the item stack has custom NBT. | 
| Custom NBT | getNbt() | Returns the custom NBT of the item stack. | 
| Custom NBT | getOrCreateNbt() | Returns the custom NBT of the item stack, or creates one if absent, mutating the stack. | 
| Custom NBT | setNbt(NbtCompound) | Sets the custom NBT of the item stack. | 
| Sub Custom NBT | getSubNbt(String) | Returns the sub NBT compound at the specified key. | 
| Sub Custom NBT | getOrCreateSubNbt(String) | Returns the sub NBT compound at the specified key, or create one if absent, mutating the stack. | 
| Sub Custom NBT | removeSubNbt(String) | Removes the sub NBT element at the specified key. | 
| Sub Custom NBT | setSubNbt(String, NbtElement) | Sets the sub NBT element at the specified key. | 
- Mappings:
- Namespace - Name - official - cmy- intermediary - net/minecraft/class_1799- named - net/minecraft/item/ItemStack
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ItemStack>private intprivate static final Stringprivate static final Stringstatic final com.mojang.serialization.Codec<ItemStack>static final StringThe key of the item's color in the display NBT, whose value is "color".private intstatic final com.mojang.serialization.MapCodec<ItemStack>static final StringThe key of the damage in an item stack's custom NBT, whose value is "Damage".private @Nullable BlockPredicatesCheckerprivate static final Textstatic final StringThe key of the display NBT in an item stack's custom NBT, whose value is "display".static final ItemStackThe empty item stack that holds no item.static final StringThe key of the enchantments in an item stack's custom NBT, whose value is "Enchantments".private static final intprivate static final Stringstatic final com.mojang.serialization.Codec<ItemStack>Deprecated.private static final com.mojang.serialization.Codec<Item>private static final Loggerstatic final StringThe key of the item stack's lore in the display NBT, whose value is "Lore".private static final Stylestatic final DecimalFormatstatic final StringThe key of the item stack's name in the display NBT, whose value is "Name".private @Nullable NbtCompoundRepresents the item stack's custom NBT.private @Nullable BlockPredicatesCheckerstatic final com.mojang.serialization.Codec<ItemStack>private static final StringThe key of the repair cost in an item stack's custom NBT, whose value is "RepairCost".private static final StringThe key of the unbreakable boolean in an item stack's custom NBT, whose value is "Unbreakable".
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprivateItemStack(ItemConvertible item) ItemStack(ItemConvertible item, int count) privateItemStack(NbtCompound nbt) ItemStack(RegistryEntry<Item> entry) ItemStack(RegistryEntry<Item> itemEntry, int count) ItemStack(RegistryEntry<Item> item, int count, Optional<NbtCompound> nbt) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddAttributeModifier(EntityAttribute attribute, EntityAttributeModifier modifier, @Nullable EquipmentSlot slot) Adds an attribute modifier to this stack.voidaddEnchantment(Enchantment enchantment, int level) Enchants this item with the given enchantment and level.voidaddHideFlag(ItemStack.TooltipSection tooltipSection) static voidappendEnchantments(List<Text> tooltip, NbtList enchantments) static booleanReturns whether the given item stacks are equal, including the item count and NBT.static booleanareItemsEqual(ItemStack left, ItemStack right) static booleancanCombine(ItemStack stack, ItemStack otherStack) Returns whether the given item stacks' items and NBT are equal.booleancanDestroy(Registry<Block> blockRegistry, CachedBlockPosition pos) booleancanPlaceOn(Registry<Block> blockRegistry, CachedBlockPosition pos) copy()Returns a copy of this item stack, including the item count, NBT, and bobbing animation time.copyWithCount(int count) booleandamage(int amount, Random random, @Nullable ServerPlayerEntity player) Damages this item stack.<T extends LivingEntity>
 voidDamages this item stack.voiddecrement(int amount) Decrements the count of items in this item stack.finishUsing(World world, LivingEntity user) static ItemStackfromNbt(NbtCompound nbt) Returns the item stack deserialized from the NBT, orEMPTYif it fails to deserialize.Returns a multimap of attribute modifiers forslot.intintgetCount()Returns the count of items in this item stack.intReturns the damage (lost durability) of the item stack.Returns an NBT list of enchantments.getFrame()Returns the item frame that holds the stack, ornullif inapplicable.private intReturns 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).intintintfloatgetName()Returns the custom name of the stack if it exists, or the item's name.getNbt()Returns the custom NBT of this item stack, may benull.Returns the custom NBT of this item stack, or creates the custom NBT if the item stack did not have a custom NBT previously, mutating the stack.getOrCreateSubNbt(String key) Returns the compound NBT at the specified key in this item stack's NBT, or a new compound added to the stack if absent.intReturns the stack's repair cost used in anvils.Returns the NBT compound at the specified key in this item stack's custom NBT, may benull.getTooltip(@Nullable PlayerEntity player, TooltipContext context) booleanReturns whether this item stack has a custom name.booleanReturns whether the item stack has any enchantments.booleanhasGlint()booleanhasNbt()Returns whether this item stack has custom NBT.voidincrement(int amount) Increments the count of items in this item stack.voidinventoryTick(World world, Entity entity, int slot, boolean selected) 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.booleanisFood()booleanReturns whether the item is intag.booleanReturns whether the item stack is in an item frame.booleanbooleanisItemEnabled(FeatureSet enabledFeatures) booleanReturns whether the item isitem.private static booleanisSectionVisible(int flags, ItemStack.TooltipSection tooltipSection) Determines whether the given tooltip section will be visible according to the given flags.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.booleanitemMatches(RegistryEntryList<Item> registryEntryList) booleanonClicked(ItemStack stack, Slot slot, ClickType clickType, PlayerEntity player, StackReference cursorStackReference) voidonCraftByCrafter(World world) voidonCraftByPlayer(World world, PlayerEntity player, int amount) voidonItemEntityDestroyed(ItemEntity entity) booleanonStackClicked(Slot slot, ClickType clickType, PlayerEntity player) voidonStoppedUsing(World world, LivingEntity user, int remainingUseTicks) private static Collection<Text>parseBlockTag(String tag) voidpostHit(LivingEntity target, PlayerEntity attacker) voidpostMine(World world, BlockState state, BlockPos pos, PlayerEntity miner) voidRemoves the custom name and other NBT compounds that are now empty after the removal of the custom name from this item stack.voidremoveSubNbt(String key) Removes the sub NBT element at the specified key in this item stack's custom NBT.voidsetBobbingAnimationTime(int bobbingAnimationTime) voidsetCount(int count) Sets the count of items in this item stack.setCustomName(@Nullable Text name) Sets the custom name of this item stack toname.voidsetDamage(int damage) Sets the stack's damage todamage.voidSets the stack's holder toholder.voidsetNbt(@Nullable NbtCompound nbt) Sets the custom NBT of this item stack.voidsetRepairCost(int repairCost) Sets the stack's repair cost used in anvils torepairCost.voidsetSubNbt(String key, NbtElement element) Sets the given NBT element in the item stack's custom NBT at the specified key.split(int amount) Returns the copy of the stack "split" from the current stack with item count being at mostamount.Returns a stream of all tags the item is in.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) writeNbt(NbtCompound nbt) Writes the serialized item stack into the givenNbtCompound.
- 
Field Details- 
CODEC- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a:Lcom/mojang/serialization/Codec;- intermediary - field_24671- Lnet/minecraft/class_1799;field_24671:Lcom/mojang/serialization/Codec;- named - CODEC- Lnet/minecraft/item/ItemStack;CODEC:Lcom/mojang/serialization/Codec;
 
- 
ITEM_CODEC- Mappings:
- Namespace - Name - Mixin selector - official - n- Lcmy;n:Lcom/mojang/serialization/Codec;- intermediary - field_47312- Lnet/minecraft/class_1799;field_47312:Lcom/mojang/serialization/Codec;- named - ITEM_CODEC- Lnet/minecraft/item/ItemStack;ITEM_CODEC:Lcom/mojang/serialization/Codec;
 
- 
ADVANCEMENT_DISPLAY_CODEC- Mappings:
- Namespace - Name - Mixin selector - official - b- Lcmy;b:Lcom/mojang/serialization/Codec;- intermediary - field_47308- Lnet/minecraft/class_1799;field_47308:Lcom/mojang/serialization/Codec;- named - ADVANCEMENT_DISPLAY_CODEC- Lnet/minecraft/item/ItemStack;ADVANCEMENT_DISPLAY_CODEC:Lcom/mojang/serialization/Codec;
 
- 
RECIPE_RESULT_CODEC- Mappings:
- Namespace - Name - Mixin selector - official - c- Lcmy;c:Lcom/mojang/serialization/Codec;- intermediary - field_47309- Lnet/minecraft/class_1799;field_47309:Lcom/mojang/serialization/Codec;- named - RECIPE_RESULT_CODEC- Lnet/minecraft/item/ItemStack;RECIPE_RESULT_CODEC:Lcom/mojang/serialization/Codec;
 
- 
INGREDIENT_ENTRY_CODEC- Mappings:
- Namespace - Name - Mixin selector - official - d- Lcmy;d:Lcom/mojang/serialization/Codec;- intermediary - field_47310- Lnet/minecraft/class_1799;field_47310:Lcom/mojang/serialization/Codec;- named - INGREDIENT_ENTRY_CODEC- Lnet/minecraft/item/ItemStack;INGREDIENT_ENTRY_CODEC:Lcom/mojang/serialization/Codec;
 
- 
CUTTING_RECIPE_RESULT_CODEC- Mappings:
- Namespace - Name - Mixin selector - official - e- Lcmy;e:Lcom/mojang/serialization/MapCodec;- intermediary - field_47311- Lnet/minecraft/class_1799;field_47311:Lcom/mojang/serialization/MapCodec;- named - CUTTING_RECIPE_RESULT_CODEC- Lnet/minecraft/item/ItemStack;CUTTING_RECIPE_RESULT_CODEC:Lcom/mojang/serialization/MapCodec;
 
- 
LOGGER- Mappings:
- Namespace - Name - Mixin selector - official - o- Lcmy;o:Lorg/slf4j/Logger;- intermediary - field_8033- Lnet/minecraft/class_1799;field_8033:Lorg/slf4j/Logger;- named - LOGGER- Lnet/minecraft/item/ItemStack;LOGGER:Lorg/slf4j/Logger;
 
- 
EMPTYThe empty item stack that holds no item.This should never be mutated. - See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - f- Lcmy;f:Lcmy;- intermediary - field_8037- Lnet/minecraft/class_1799;field_8037:Lnet/minecraft/class_1799;- named - EMPTY- Lnet/minecraft/item/ItemStack;EMPTY:Lnet/minecraft/item/ItemStack;
 
- 
MODIFIER_FORMAT- Mappings:
- Namespace - Name - Mixin selector - official - g- Lcmy;g:Ljava/text/DecimalFormat;- intermediary - field_8029- Lnet/minecraft/class_1799;field_8029:Ljava/text/DecimalFormat;- named - MODIFIER_FORMAT- Lnet/minecraft/item/ItemStack;MODIFIER_FORMAT:Ljava/text/DecimalFormat;
 
- 
ENCHANTMENTS_KEYThe key of the enchantments in an item stack's custom NBT, whose value is "Enchantments".- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - h- Lcmy;h:Ljava/lang/String;- intermediary - field_30890- Lnet/minecraft/class_1799;field_30890:Ljava/lang/String;- named - ENCHANTMENTS_KEY- Lnet/minecraft/item/ItemStack;ENCHANTMENTS_KEY:Ljava/lang/String;
 
- 
DISPLAY_KEYThe key of the display NBT in an item stack's custom NBT, whose value is "display".- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - i- Lcmy;i:Ljava/lang/String;- intermediary - field_30893- Lnet/minecraft/class_1799;field_30893:Ljava/lang/String;- named - DISPLAY_KEY- Lnet/minecraft/item/ItemStack;DISPLAY_KEY:Ljava/lang/String;
 
- 
NAME_KEYThe key of the item stack's name in the display NBT, whose value is "Name".- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - j- Lcmy;j:Ljava/lang/String;- intermediary - field_30894- Lnet/minecraft/class_1799;field_30894:Ljava/lang/String;- named - NAME_KEY- Lnet/minecraft/item/ItemStack;NAME_KEY:Ljava/lang/String;
 
- 
LORE_KEYThe key of the item stack's lore in the display NBT, whose value is "Lore".- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - k- Lcmy;k:Ljava/lang/String;- intermediary - field_30895- Lnet/minecraft/class_1799;field_30895:Ljava/lang/String;- named - LORE_KEY- Lnet/minecraft/item/ItemStack;LORE_KEY:Ljava/lang/String;
 
- 
DAMAGE_KEYThe key of the damage in an item stack's custom NBT, whose value is "Damage".- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - l- Lcmy;l:Ljava/lang/String;- intermediary - field_30896- Lnet/minecraft/class_1799;field_30896:Ljava/lang/String;- named - DAMAGE_KEY- Lnet/minecraft/item/ItemStack;DAMAGE_KEY:Ljava/lang/String;
 
- 
COLOR_KEYThe key of the item's color in the display NBT, whose value is "color".- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - m- Lcmy;m:Ljava/lang/String;- intermediary - field_30897- Lnet/minecraft/class_1799;field_30897:Ljava/lang/String;- named - COLOR_KEY- Lnet/minecraft/item/ItemStack;COLOR_KEY:Ljava/lang/String;
 
- 
UNBREAKABLE_KEYThe key of the unbreakable boolean in an item stack's custom NBT, whose value is "Unbreakable".- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - p- Lcmy;p:Ljava/lang/String;- intermediary - field_30898- Lnet/minecraft/class_1799;field_30898:Ljava/lang/String;- named - UNBREAKABLE_KEY- Lnet/minecraft/item/ItemStack;UNBREAKABLE_KEY:Ljava/lang/String;
 
- 
REPAIR_COST_KEYThe key of the repair cost in an item stack's custom NBT, whose value is "RepairCost".- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - q- Lcmy;q:Ljava/lang/String;- intermediary - field_30899- Lnet/minecraft/class_1799;field_30899:Ljava/lang/String;- named - REPAIR_COST_KEY- Lnet/minecraft/item/ItemStack;REPAIR_COST_KEY:Ljava/lang/String;
 
- 
CAN_DESTROY_KEY- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - r- Lcmy;r:Ljava/lang/String;- intermediary - field_30900- Lnet/minecraft/class_1799;field_30900:Ljava/lang/String;- named - CAN_DESTROY_KEY- Lnet/minecraft/item/ItemStack;CAN_DESTROY_KEY:Ljava/lang/String;
 
- 
CAN_PLACE_ON_KEY- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - s- Lcmy;s:Ljava/lang/String;- intermediary - field_30901- Lnet/minecraft/class_1799;field_30901:Ljava/lang/String;- named - CAN_PLACE_ON_KEY- Lnet/minecraft/item/ItemStack;CAN_PLACE_ON_KEY:Ljava/lang/String;
 
- 
HIDE_FLAGS_KEY- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - t- Lcmy;t:Ljava/lang/String;- intermediary - field_30902- Lnet/minecraft/class_1799;field_30902:Ljava/lang/String;- named - HIDE_FLAGS_KEY- Lnet/minecraft/item/ItemStack;HIDE_FLAGS_KEY:Ljava/lang/String;
 
- 
DISABLED_TEXT- Mappings:
- Namespace - Name - Mixin selector - official - u- Lcmy;u:Lvf;- intermediary - field_40211- Lnet/minecraft/class_1799;field_40211:Lnet/minecraft/class_2561;- named - DISABLED_TEXT- Lnet/minecraft/item/ItemStack;DISABLED_TEXT:Lnet/minecraft/text/Text;
 
- 
field_30903private static final int field_30903- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - v- Lcmy;v:I- intermediary - field_30903- Lnet/minecraft/class_1799;field_30903:I- named - field_30903- Lnet/minecraft/item/ItemStack;field_30903:I
 
- 
LORE_STYLE- Mappings:
- Namespace - Name - Mixin selector - official - w- Lcmy;w:Lwc;- intermediary - field_24092- Lnet/minecraft/class_1799;field_24092:Lnet/minecraft/class_2583;- named - LORE_STYLE- Lnet/minecraft/item/ItemStack;LORE_STYLE:Lnet/minecraft/text/Style;
 
- 
countprivate int count- Mappings:
- Namespace - Name - Mixin selector - official - x- Lcmy;x:I- intermediary - field_8031- Lnet/minecraft/class_1799;field_8031:I- named - count- Lnet/minecraft/item/ItemStack;count:I
 
- 
bobbingAnimationTimeprivate int bobbingAnimationTime- Mappings:
- Namespace - Name - Mixin selector - official - y- Lcmy;y:I- intermediary - field_8030- Lnet/minecraft/class_1799;field_8030:I- named - bobbingAnimationTime- Lnet/minecraft/item/ItemStack;bobbingAnimationTime:I
 
- 
itemDeprecated.- Mappings:
- Namespace - Name - Mixin selector - official - z- Lcmy;z:Lcmt;- intermediary - field_8038- Lnet/minecraft/class_1799;field_8038:Lnet/minecraft/class_1792;- named - item- Lnet/minecraft/item/ItemStack;item:Lnet/minecraft/item/Item;
 
- 
nbtRepresents the item stack's custom NBT.Stored at the key tagin the serialized item stack NBT.- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - A- Lcmy;A:Lsn;- intermediary - field_8040- Lnet/minecraft/class_1799;field_8040:Lnet/minecraft/class_2487;- named - nbt- Lnet/minecraft/item/ItemStack;nbt:Lnet/minecraft/nbt/NbtCompound;
 
- 
holder- Mappings:
- Namespace - Name - Mixin selector - official - B- Lcmy;B:Lblv;- intermediary - field_24093- Lnet/minecraft/class_1799;field_24093:Lnet/minecraft/class_1297;- named - holder- Lnet/minecraft/item/ItemStack;holder:Lnet/minecraft/entity/Entity;
 
- 
destroyChecker- Mappings:
- Namespace - Name - Mixin selector - official - C- Lcmy;C:Lckg;- intermediary - field_34453- Lnet/minecraft/class_1799;field_34453:Lnet/minecraft/class_6538;- named - destroyChecker- Lnet/minecraft/item/ItemStack;destroyChecker:Lnet/minecraft/item/BlockPredicatesChecker;
 
- 
placeChecker- Mappings:
- Namespace - Name - Mixin selector - official - D- Lcmy;D:Lckg;- intermediary - field_34454- Lnet/minecraft/class_1799;field_34454:Lnet/minecraft/class_6538;- named - placeChecker- Lnet/minecraft/item/ItemStack;placeChecker:Lnet/minecraft/item/BlockPredicatesChecker;
 
 
- 
- 
Constructor Details- 
ItemStack- Mappings:
- Namespace - Name - Mixin selector - official - <init>- Lcmy;<init>(Lcto;)V- intermediary - <init>- Lnet/minecraft/class_1799;<init>(Lnet/minecraft/class_1935;)V- named - <init>- Lnet/minecraft/item/ItemStack;<init>(Lnet/minecraft/item/ItemConvertible;)V
 
- 
ItemStack- Mappings:
- Namespace - Name - Mixin selector - official - <init>- Lcmy;<init>(Lih;)V- intermediary - <init>- Lnet/minecraft/class_1799;<init>(Lnet/minecraft/class_6880;)V- named - <init>- Lnet/minecraft/item/ItemStack;<init>(Lnet/minecraft/registry/entry/RegistryEntry;)V
 
- 
ItemStack- Mappings:
- Namespace - Name - Mixin selector - official - <init>- Lcmy;<init>(Lih;ILjava/util/Optional;)V- intermediary - <init>- Lnet/minecraft/class_1799;<init>(Lnet/minecraft/class_6880;ILjava/util/Optional;)V- named - <init>- Lnet/minecraft/item/ItemStack;<init>(Lnet/minecraft/registry/entry/RegistryEntry;ILjava/util/Optional;)V
 
- 
ItemStack- Mappings:
- Namespace - Name - Mixin selector - official - <init>- Lcmy;<init>(Lih;I)V- intermediary - <init>- Lnet/minecraft/class_1799;<init>(Lnet/minecraft/class_6880;I)V- named - <init>- Lnet/minecraft/item/ItemStack;<init>(Lnet/minecraft/registry/entry/RegistryEntry;I)V
 
- 
ItemStack- Mappings:
- Namespace - Name - Mixin selector - official - <init>- Lcmy;<init>(Lcto;I)V- intermediary - <init>- Lnet/minecraft/class_1799;<init>(Lnet/minecraft/class_1935;I)V- named - <init>- Lnet/minecraft/item/ItemStack;<init>(Lnet/minecraft/item/ItemConvertible;I)V
 
- 
ItemStack- Mappings:
- Namespace - Name - Mixin selector - official - <init>- Lcmy;<init>(Ljava/lang/Void;)V- intermediary - <init>- Lnet/minecraft/class_1799;<init>(Ljava/lang/Void;)V- named - <init>- Lnet/minecraft/item/ItemStack;<init>(Ljava/lang/Void;)V
 
- 
ItemStack- Mappings:
- Namespace - Name - Mixin selector - official - <init>- Lcmy;<init>(Lsn;)V- intermediary - <init>- Lnet/minecraft/class_1799;<init>(Lnet/minecraft/class_2487;)V- named - <init>- Lnet/minecraft/item/ItemStack;<init>(Lnet/minecraft/nbt/NbtCompound;)V
 
 
- 
- 
Method Details- 
getTooltipData- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a()Ljava/util/Optional;- intermediary - method_32347- Lnet/minecraft/class_1799;method_32347()Ljava/util/Optional;- named - getTooltipData- Lnet/minecraft/item/ItemStack;getTooltipData()Ljava/util/Optional;
 
- 
fromNbtReturns the item stack deserialized from the NBT, orEMPTYif it fails to deserialize.- Returns:
- the item stack deserialized from the NBT, or EMPTYif it fails to deserialize
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Lsn;)Lcmy;- intermediary - method_7915- Lnet/minecraft/class_1799;method_7915(Lnet/minecraft/class_2487;)Lnet/minecraft/class_1799;- named - fromNbt- Lnet/minecraft/item/ItemStack;fromNbt(Lnet/minecraft/nbt/NbtCompound;)Lnet/minecraft/item/ItemStack;
 
- 
isEmptypublic boolean isEmpty()Returns whether this item stack is empty.- Returns:
- whether this item stack is empty
- Mappings:
- Namespace - Name - Mixin selector - official - b- Lcmy;b()Z- intermediary - method_7960- Lnet/minecraft/class_1799;method_7960()Z- named - isEmpty- Lnet/minecraft/item/ItemStack;isEmpty()Z
 
- 
isItemEnabled- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Lchs;)Z- intermediary - method_45435- Lnet/minecraft/class_1799;method_45435(Lnet/minecraft/class_7699;)Z- named - isItemEnabled- Lnet/minecraft/item/ItemStack;isItemEnabled(Lnet/minecraft/resource/featuretoggle/FeatureSet;)Z
 
- 
splitReturns 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 - official - a- Lcmy;a(I)Lcmy;- intermediary - method_7971- Lnet/minecraft/class_1799;method_7971(I)Lnet/minecraft/class_1799;- named - split- Lnet/minecraft/item/ItemStack;split(I)Lnet/minecraft/item/ItemStack;
 
- 
copyAndEmpty- Mappings:
- Namespace - Name - Mixin selector - official - c- Lcmy;c()Lcmy;- intermediary - method_51164- Lnet/minecraft/class_1799;method_51164()Lnet/minecraft/class_1799;- named - copyAndEmpty- Lnet/minecraft/item/ItemStack;copyAndEmpty()Lnet/minecraft/item/ItemStack;
 
- 
getItemReturns the item of this stack.- Returns:
- the item of this stack
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - d- Lcmy;d()Lcmt;- intermediary - method_7909- Lnet/minecraft/class_1799;method_7909()Lnet/minecraft/class_1792;- named - getItem- Lnet/minecraft/item/ItemStack;getItem()Lnet/minecraft/item/Item;
 
- 
getRegistryEntry- Mappings:
- Namespace - Name - Mixin selector - official - e- Lcmy;e()Lih;- intermediary - method_41409- Lnet/minecraft/class_1799;method_41409()Lnet/minecraft/class_6880;- named - getRegistryEntry- Lnet/minecraft/item/ItemStack;getRegistryEntry()Lnet/minecraft/registry/entry/RegistryEntry;
 
- 
isInReturns whether the item is intag.- Returns:
- whether the item is in tag
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Lasw;)Z- intermediary - method_31573- Lnet/minecraft/class_1799;method_31573(Lnet/minecraft/class_6862;)Z- named - isIn- Lnet/minecraft/item/ItemStack;isIn(Lnet/minecraft/registry/tag/TagKey;)Z
 
- 
isOfReturns whether the item isitem.- Returns:
- whether the item is item
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Lcmt;)Z- intermediary - method_31574- Lnet/minecraft/class_1799;method_31574(Lnet/minecraft/class_1792;)Z- named - isOf- Lnet/minecraft/item/ItemStack;isOf(Lnet/minecraft/item/Item;)Z
 
- 
itemMatchesReturns 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 - official - a- Lcmy;a(Ljava/util/function/Predicate;)Z- intermediary - method_41407- Lnet/minecraft/class_1799;method_41407(Ljava/util/function/Predicate;)Z- named - itemMatches- Lnet/minecraft/item/ItemStack;itemMatches(Ljava/util/function/Predicate;)Z
 
- 
itemMatchesReturns whether the item's registry entry matchesitemEntry.- Returns:
- whether the item's registry entry matches itemEntry
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Lih;)Z- intermediary - method_41406- Lnet/minecraft/class_1799;method_41406(Lnet/minecraft/class_6880;)Z- named - itemMatches- Lnet/minecraft/item/ItemStack;itemMatches(Lnet/minecraft/registry/entry/RegistryEntry;)Z
 
- 
itemMatches- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Lil;)Z- intermediary - method_53187- Lnet/minecraft/class_1799;method_53187(Lnet/minecraft/class_6885;)Z- named - itemMatches- Lnet/minecraft/item/ItemStack;itemMatches(Lnet/minecraft/registry/entry/RegistryEntryList;)Z
 
- 
streamTagsReturns 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 - official - f- Lcmy;f()Ljava/util/stream/Stream;- intermediary - method_40133- Lnet/minecraft/class_1799;method_40133()Ljava/util/stream/Stream;- named - streamTags- Lnet/minecraft/item/ItemStack;streamTags()Ljava/util/stream/Stream;
 
- 
useOnBlock- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Lcpj;)Lbkb;- intermediary - method_7981- Lnet/minecraft/class_1799;method_7981(Lnet/minecraft/class_1838;)Lnet/minecraft/class_1269;- named - useOnBlock- Lnet/minecraft/item/ItemStack;useOnBlock(Lnet/minecraft/item/ItemUsageContext;)Lnet/minecraft/util/ActionResult;
 
- 
getMiningSpeedMultiplier- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Ldjh;)F- intermediary - method_7924- Lnet/minecraft/class_1799;method_7924(Lnet/minecraft/class_2680;)F- named - getMiningSpeedMultiplier- Lnet/minecraft/item/ItemStack;getMiningSpeedMultiplier(Lnet/minecraft/block/BlockState;)F
 
- 
use- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Lctp;Lcfi;Lbka;)Lbkc;- intermediary - method_7913- Lnet/minecraft/class_1799;method_7913(Lnet/minecraft/class_1937;Lnet/minecraft/class_1657;Lnet/minecraft/class_1268;)Lnet/minecraft/class_1271;- named - use- Lnet/minecraft/item/ItemStack;use(Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/Hand;)Lnet/minecraft/util/TypedActionResult;
 
- 
finishUsing- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Lctp;Lbml;)Lcmy;- intermediary - method_7910- Lnet/minecraft/class_1799;method_7910(Lnet/minecraft/class_1937;Lnet/minecraft/class_1309;)Lnet/minecraft/class_1799;- named - finishUsing- Lnet/minecraft/item/ItemStack;finishUsing(Lnet/minecraft/world/World;Lnet/minecraft/entity/LivingEntity;)Lnet/minecraft/item/ItemStack;
 
- 
writeNbtWrites the serialized item stack into the givenNbtCompound.- Parameters:
- nbt- the NBT compound to write to
- Returns:
- the written NBT compound
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - b- Lcmy;b(Lsn;)Lsn;- intermediary - method_7953- Lnet/minecraft/class_1799;method_7953(Lnet/minecraft/class_2487;)Lnet/minecraft/class_2487;- named - writeNbt- Lnet/minecraft/item/ItemStack;writeNbt(Lnet/minecraft/nbt/NbtCompound;)Lnet/minecraft/nbt/NbtCompound;
 
- 
getMaxCountpublic int getMaxCount()- Mappings:
- Namespace - Name - Mixin selector - official - g- Lcmy;g()I- intermediary - method_7914- Lnet/minecraft/class_1799;method_7914()I- named - getMaxCount- Lnet/minecraft/item/ItemStack;getMaxCount()I
 
- 
isStackablepublic 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 - official - h- Lcmy;h()Z- intermediary - method_7946- Lnet/minecraft/class_1799;method_7946()Z- named - isStackable- Lnet/minecraft/item/ItemStack;isStackable()Z
 
- 
isDamageablepublic boolean isDamageable()Returns whether the item can be damaged (lose durability).Items with 0 max damage or item stacks with "Unbreakable" NBT set to 1bcannot be damaged.- Returns:
- whether the item can be damaged (lose durability)
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - i- Lcmy;i()Z- intermediary - method_7963- Lnet/minecraft/class_1799;method_7963()Z- named - isDamageable- Lnet/minecraft/item/ItemStack;isDamageable()Z
 
- 
isDamagedpublic 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 - official - j- Lcmy;j()Z- intermediary - method_7986- Lnet/minecraft/class_1799;method_7986()Z- named - isDamaged- Lnet/minecraft/item/ItemStack;isDamaged()Z
 
- 
getDamagepublic int getDamage()Returns the damage (lost durability) of the item stack.The damage is stored in NBT under "Damage" key. 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 - official - k- Lcmy;k()I- intermediary - method_7919- Lnet/minecraft/class_1799;method_7919()I- named - getDamage- Lnet/minecraft/item/ItemStack;getDamage()I
 
- 
setDamagepublic 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, Consumer).- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - b- Lcmy;b(I)V- intermediary - method_7974- Lnet/minecraft/class_1799;method_7974(I)V- named - setDamage- Lnet/minecraft/item/ItemStack;setDamage(I)V
 
- 
getMaxDamagepublic int getMaxDamage()- Mappings:
- Namespace - Name - Mixin selector - official - l- Lcmy;l()I- intermediary - method_7936- Lnet/minecraft/class_1799;method_7936()I- named - getMaxDamage- Lnet/minecraft/item/ItemStack;getMaxDamage()I
 
- 
damageDamages 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 unbreaking enchantment is applied toamountbefore damaging.If playeris notnull, this triggersCriteria.ITEM_DURABILITY_CHANGED.This method does not decrement the item count when the item "breaks". Callers should check the returned value and decrement themselves. - Parameters:
- player- the player that holds the stack to be damaged, or- nullif inapplicable
- Returns:
- whether the stack's damage is equal to or above the maximum damage (i.e. whether the item is "broken")
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(ILauv;Lane;)Z- intermediary - method_7970- Lnet/minecraft/class_1799;method_7970(ILnet/minecraft/class_5819;Lnet/minecraft/class_3222;)Z- named - damage- Lnet/minecraft/item/ItemStack;damage(ILnet/minecraft/util/math/random/Random;Lnet/minecraft/server/network/ServerPlayerEntity;)Z
 
- 
damageDamages 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 unbreaking enchantment is 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 call breakCallback, decrement the stack, and incrementStats.BROKENif the stack is held by a player. The callback should callLivingEntity.sendEquipmentBreakStatus(net.minecraft.entity.EquipmentSlot)orLivingEntity.sendToolBreakStatus(net.minecraft.util.Hand).- Parameters:
- entity- the entity that holds the stack to be damaged
- breakCallback- the callback that takes the entity holding the stack and is executed when the item breaks
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(ILbml;Ljava/util/function/Consumer;)V- intermediary - method_7956- Lnet/minecraft/class_1799;method_7956(ILnet/minecraft/class_1309;Ljava/util/function/Consumer;)V- named - damage- Lnet/minecraft/item/ItemStack;damage(ILnet/minecraft/entity/LivingEntity;Ljava/util/function/Consumer;)V
 
- 
isItemBarVisiblepublic boolean isItemBarVisible()- Mappings:
- Namespace - Name - Mixin selector - official - m- Lcmy;m()Z- intermediary - method_31578- Lnet/minecraft/class_1799;method_31578()Z- named - isItemBarVisible- Lnet/minecraft/item/ItemStack;isItemBarVisible()Z
 
- 
getItemBarSteppublic 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 - official - n- Lcmy;n()I- intermediary - method_31579- Lnet/minecraft/class_1799;method_31579()I- named - getItemBarStep- Lnet/minecraft/item/ItemStack;getItemBarStep()I
 
- 
getItemBarColorpublic 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 - official - o- Lcmy;o()I- intermediary - method_31580- Lnet/minecraft/class_1799;method_31580()I- named - getItemBarColor- Lnet/minecraft/item/ItemStack;getItemBarColor()I
 
- 
onStackClicked- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Lcjw;Lcij;Lcfi;)Z- intermediary - method_31575- Lnet/minecraft/class_1799;method_31575(Lnet/minecraft/class_1735;Lnet/minecraft/class_5536;Lnet/minecraft/class_1657;)Z- named - onStackClicked- Lnet/minecraft/item/ItemStack;onStackClicked(Lnet/minecraft/screen/slot/Slot;Lnet/minecraft/util/ClickType;Lnet/minecraft/entity/player/PlayerEntity;)Z
 
- 
onClickedpublic boolean onClicked(ItemStack stack, Slot slot, ClickType clickType, PlayerEntity player, StackReference cursorStackReference) - Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Lcmy;Lcjw;Lcij;Lcfi;Lbnd;)Z- intermediary - method_31576- Lnet/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;)Z- named - onClicked- Lnet/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;)Z
 
- 
postHit- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Lbml;Lcfi;)V- intermediary - method_7979- Lnet/minecraft/class_1799;method_7979(Lnet/minecraft/class_1309;Lnet/minecraft/class_1657;)V- named - postHit- Lnet/minecraft/item/ItemStack;postHit(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/player/PlayerEntity;)V
 
- 
postMine- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Lctp;Ldjh;Lhx;Lcfi;)V- intermediary - method_7952- Lnet/minecraft/class_1799;method_7952(Lnet/minecraft/class_1937;Lnet/minecraft/class_2680;Lnet/minecraft/class_2338;Lnet/minecraft/class_1657;)V- named - postMine- Lnet/minecraft/item/ItemStack;postMine(Lnet/minecraft/world/World;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/player/PlayerEntity;)V
 
- 
isSuitableForDetermines 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.isSuitableFor(net.minecraft.block.BlockState)
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - b- Lcmy;b(Ldjh;)Z- intermediary - method_7951- Lnet/minecraft/class_1799;method_7951(Lnet/minecraft/class_2680;)Z- named - isSuitableFor- Lnet/minecraft/item/ItemStack;isSuitableFor(Lnet/minecraft/block/BlockState;)Z
 
- 
useOnEntity- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Lcfi;Lbml;Lbka;)Lbkb;- intermediary - method_7920- Lnet/minecraft/class_1799;method_7920(Lnet/minecraft/class_1657;Lnet/minecraft/class_1309;Lnet/minecraft/class_1268;)Lnet/minecraft/class_1269;- named - useOnEntity- Lnet/minecraft/item/ItemStack;useOnEntity(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/util/Hand;)Lnet/minecraft/util/ActionResult;
 
- 
copyReturns a copy of this item stack, including the item count, NBT, and bobbing animation time.- Returns:
- a copy of this item stack, including the item count, NBT, and bobbing animation time
- Mappings:
- Namespace - Name - Mixin selector - official - p- Lcmy;p()Lcmy;- intermediary - method_7972- Lnet/minecraft/class_1799;method_7972()Lnet/minecraft/class_1799;- named - copy- Lnet/minecraft/item/ItemStack;copy()Lnet/minecraft/item/ItemStack;
 
- 
copyWithCount- Mappings:
- Namespace - Name - Mixin selector - official - c- Lcmy;c(I)Lcmy;- intermediary - method_46651- Lnet/minecraft/class_1799;method_46651(I)Lnet/minecraft/class_1799;- named - copyWithCount- Lnet/minecraft/item/ItemStack;copyWithCount(I)Lnet/minecraft/item/ItemStack;
 
- 
areEqualReturns whether the given item stacks are equal, including the item count and NBT.- Returns:
- whether the given item stacks are equal, including the item count and NBT
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Lcmy;Lcmy;)Z- intermediary - method_7973- Lnet/minecraft/class_1799;method_7973(Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)Z- named - areEqual- Lnet/minecraft/item/ItemStack;areEqual(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)Z
 
- 
areItemsEqual- Mappings:
- Namespace - Name - Mixin selector - official - b- Lcmy;b(Lcmy;Lcmy;)Z- intermediary - method_7984- Lnet/minecraft/class_1799;method_7984(Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)Z- named - areItemsEqual- Lnet/minecraft/item/ItemStack;areItemsEqual(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)Z
 
- 
canCombineReturns whether the given item stacks' items and NBT 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 NBT are equal
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - c- Lcmy;c(Lcmy;Lcmy;)Z- intermediary - method_31577- Lnet/minecraft/class_1799;method_31577(Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)Z- named - canCombine- Lnet/minecraft/item/ItemStack;canCombine(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)Z
 
- 
getTranslationKey- Mappings:
- Namespace - Name - Mixin selector - official - q- Lcmy;q()Ljava/lang/String;- intermediary - method_7922- Lnet/minecraft/class_1799;method_7922()Ljava/lang/String;- named - getTranslationKey- Lnet/minecraft/item/ItemStack;getTranslationKey()Ljava/lang/String;
 
- 
toString
- 
inventoryTick- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Lctp;Lblv;IZ)V- intermediary - method_7917- Lnet/minecraft/class_1799;method_7917(Lnet/minecraft/class_1937;Lnet/minecraft/class_1297;IZ)V- named - inventoryTick- Lnet/minecraft/item/ItemStack;inventoryTick(Lnet/minecraft/world/World;Lnet/minecraft/entity/Entity;IZ)V
 
- 
onCraftByPlayer- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Lctp;Lcfi;I)V- intermediary - method_7982- Lnet/minecraft/class_1799;method_7982(Lnet/minecraft/class_1937;Lnet/minecraft/class_1657;I)V- named - onCraftByPlayer- Lnet/minecraft/item/ItemStack;onCraftByPlayer(Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;I)V
 
- 
onCraftByCrafter- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Lctp;)V- intermediary - method_54466- Lnet/minecraft/class_1799;method_54466(Lnet/minecraft/class_1937;)V- named - onCraftByCrafter- Lnet/minecraft/item/ItemStack;onCraftByCrafter(Lnet/minecraft/world/World;)V
 
- 
getMaxUseTimepublic int getMaxUseTime()- Mappings:
- Namespace - Name - Mixin selector - official - r- Lcmy;r()I- intermediary - method_7935- Lnet/minecraft/class_1799;method_7935()I- named - getMaxUseTime- Lnet/minecraft/item/ItemStack;getMaxUseTime()I
 
- 
getUseAction- Mappings:
- Namespace - Name - Mixin selector - official - s- Lcmy;s()Lcos;- intermediary - method_7976- Lnet/minecraft/class_1799;method_7976()Lnet/minecraft/class_1839;- named - getUseAction- Lnet/minecraft/item/ItemStack;getUseAction()Lnet/minecraft/util/UseAction;
 
- 
onStoppedUsing- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Lctp;Lbml;I)V- intermediary - method_7930- Lnet/minecraft/class_1799;method_7930(Lnet/minecraft/class_1937;Lnet/minecraft/class_1309;I)V- named - onStoppedUsing- Lnet/minecraft/item/ItemStack;onStoppedUsing(Lnet/minecraft/world/World;Lnet/minecraft/entity/LivingEntity;I)V
 
- 
isUsedOnReleasepublic boolean isUsedOnRelease()- Mappings:
- Namespace - Name - Mixin selector - official - t- Lcmy;t()Z- intermediary - method_7967- Lnet/minecraft/class_1799;method_7967()Z- named - isUsedOnRelease- Lnet/minecraft/item/ItemStack;isUsedOnRelease()Z
 
- 
hasNbtpublic boolean hasNbt()Returns whether this item stack has custom NBT.- Returns:
- whether this item stack has custom NBT
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - u- Lcmy;u()Z- intermediary - method_7985- Lnet/minecraft/class_1799;method_7985()Z- named - hasNbt- Lnet/minecraft/item/ItemStack;hasNbt()Z
 
- 
getNbtReturns the custom NBT of this item stack, may benull.- Returns:
- the custom NBT of this item stack, may be null
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - v- Lcmy;v()Lsn;- intermediary - method_7969- Lnet/minecraft/class_1799;method_7969()Lnet/minecraft/class_2487;- named - getNbt- Lnet/minecraft/item/ItemStack;getNbt()Lnet/minecraft/nbt/NbtCompound;
 
- 
getOrCreateNbtReturns the custom NBT of this item stack, or creates the custom NBT if the item stack did not have a custom NBT previously, mutating the stack.This should not be used when reading the NBT, as this can modify the item stack. Use getNbt()with a check fornullinstead.- Returns:
- the custom NBT of this item stack
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - w- Lcmy;w()Lsn;- intermediary - method_7948- Lnet/minecraft/class_1799;method_7948()Lnet/minecraft/class_2487;- named - getOrCreateNbt- Lnet/minecraft/item/ItemStack;getOrCreateNbt()Lnet/minecraft/nbt/NbtCompound;
 
- 
getOrCreateSubNbtReturns the compound NBT at the specified key in this item stack's NBT, or a new compound added to the stack if absent.This should not be used when reading the NBT, as this can modify the item stack. Use getSubNbt(java.lang.String)with a check fornullinstead.- Returns:
- the compound NBT at the specified key in this item stack's NBT, or a new compound added to the stack if absent
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Ljava/lang/String;)Lsn;- intermediary - method_7911- Lnet/minecraft/class_1799;method_7911(Ljava/lang/String;)Lnet/minecraft/class_2487;- named - getOrCreateSubNbt- Lnet/minecraft/item/ItemStack;getOrCreateSubNbt(Ljava/lang/String;)Lnet/minecraft/nbt/NbtCompound;
 
- 
getSubNbtReturns the NBT compound at the specified key in this item stack's custom NBT, may benull.- Returns:
- the NBT compound at the specified key in this item stack's custom NBT, may be null
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - b- Lcmy;b(Ljava/lang/String;)Lsn;- intermediary - method_7941- Lnet/minecraft/class_1799;method_7941(Ljava/lang/String;)Lnet/minecraft/class_2487;- named - getSubNbt- Lnet/minecraft/item/ItemStack;getSubNbt(Ljava/lang/String;)Lnet/minecraft/nbt/NbtCompound;
 
- 
removeSubNbtRemoves the sub NBT element at the specified key in this item stack's custom NBT.- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - c- Lcmy;c(Ljava/lang/String;)V- intermediary - method_7983- Lnet/minecraft/class_1799;method_7983(Ljava/lang/String;)V- named - removeSubNbt- Lnet/minecraft/item/ItemStack;removeSubNbt(Ljava/lang/String;)V
 
- 
getEnchantmentsReturns an NBT list of enchantments.This will return an empty list for enchanted books, as the book itself is not enchanted and therefore does not store enchantments under "Enchantments" key. - Returns:
- an NBT list of enchantments
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - x- Lcmy;x()Lst;- intermediary - method_7921- Lnet/minecraft/class_1799;method_7921()Lnet/minecraft/class_2499;- named - getEnchantments- Lnet/minecraft/item/ItemStack;getEnchantments()Lnet/minecraft/nbt/NbtList;
 
- 
setNbtSets the custom NBT of this item stack.- Parameters:
- nbt- the custom NBT compound, may be- nullto reset
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - c- Lcmy;c(Lsn;)V- intermediary - method_7980- Lnet/minecraft/class_1799;method_7980(Lnet/minecraft/class_2487;)V- named - setNbt- Lnet/minecraft/item/ItemStack;setNbt(Lnet/minecraft/nbt/NbtCompound;)V
 
- 
getNameReturns 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 - official - y- Lcmy;y()Lvf;- intermediary - method_7964- Lnet/minecraft/class_1799;method_7964()Lnet/minecraft/class_2561;- named - getName- Lnet/minecraft/item/ItemStack;getName()Lnet/minecraft/text/Text;
 
- 
setCustomNameSets the custom name of this item stack toname. Ifnullis passed, this will remove the custom name (but does not remove other NBT compounds even if they are empty).- Returns:
- this item stack
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Lvf;)Lcmy;- intermediary - method_7977- Lnet/minecraft/class_1799;method_7977(Lnet/minecraft/class_2561;)Lnet/minecraft/class_1799;- named - setCustomName- Lnet/minecraft/item/ItemStack;setCustomName(Lnet/minecraft/text/Text;)Lnet/minecraft/item/ItemStack;
 
- 
removeCustomNamepublic void removeCustomName()Removes the custom name and other NBT compounds that are now empty after the removal of the custom name from this item stack.- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - z- Lcmy;z()V- intermediary - method_7925- Lnet/minecraft/class_1799;method_7925()V- named - removeCustomName- Lnet/minecraft/item/ItemStack;removeCustomName()V
 
- 
hasCustomNamepublic boolean hasCustomName()Returns whether this item stack has a custom name.- Returns:
- whether this item stack has a custom name
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - A- Lcmy;A()Z- intermediary - method_7938- Lnet/minecraft/class_1799;method_7938()Z- named - hasCustomName- Lnet/minecraft/item/ItemStack;hasCustomName()Z
 
- 
getTooltip- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Lcfi;Lcoq;)Ljava/util/List;- intermediary - method_7950- Lnet/minecraft/class_1799;method_7950(Lnet/minecraft/class_1657;Lnet/minecraft/class_1836;)Ljava/util/List;- named - getTooltip- Lnet/minecraft/item/ItemStack;getTooltip(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/client/item/TooltipContext;)Ljava/util/List;
 
- 
isSectionVisibleDetermines whether the given tooltip section will be visible according to the given flags.- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(ILcmy$a;)Z- intermediary - method_30267- Lnet/minecraft/class_1799;method_30267(ILnet/minecraft/class_1799$class_5422;)Z- named - isSectionVisible- Lnet/minecraft/item/ItemStack;isSectionVisible(ILnet/minecraft/item/ItemStack$TooltipSection;)Z
 
- 
getHideFlagsprivate int getHideFlags()- Mappings:
- Namespace - Name - Mixin selector - official - P- Lcmy;P()I- intermediary - method_30266- Lnet/minecraft/class_1799;method_30266()I- named - getHideFlags- Lnet/minecraft/item/ItemStack;getHideFlags()I
 
- 
addHideFlag- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Lcmy$a;)V- intermediary - method_30268- Lnet/minecraft/class_1799;method_30268(Lnet/minecraft/class_1799$class_5422;)V- named - addHideFlag- Lnet/minecraft/item/ItemStack;addHideFlag(Lnet/minecraft/item/ItemStack$TooltipSection;)V
 
- 
appendEnchantments- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Ljava/util/List;Lst;)V- intermediary - method_17870- Lnet/minecraft/class_1799;method_17870(Ljava/util/List;Lnet/minecraft/class_2499;)V- named - appendEnchantments- Lnet/minecraft/item/ItemStack;appendEnchantments(Ljava/util/List;Lnet/minecraft/nbt/NbtList;)V
 
- 
parseBlockTag- Mappings:
- Namespace - Name - Mixin selector - official - d- Lcmy;d(Ljava/lang/String;)Ljava/util/Collection;- intermediary - method_7937- Lnet/minecraft/class_1799;method_7937(Ljava/lang/String;)Ljava/util/Collection;- named - parseBlockTag- Lnet/minecraft/item/ItemStack;parseBlockTag(Ljava/lang/String;)Ljava/util/Collection;
 
- 
hasGlintpublic boolean hasGlint()- Mappings:
- Namespace - Name - Mixin selector - official - B- Lcmy;B()Z- intermediary - method_7958- Lnet/minecraft/class_1799;method_7958()Z- named - hasGlint- Lnet/minecraft/item/ItemStack;hasGlint()Z
 
- 
getRarity- Mappings:
- Namespace - Name - Mixin selector - official - C- Lcmy;C()Lcnp;- intermediary - method_7932- Lnet/minecraft/class_1799;method_7932()Lnet/minecraft/class_1814;- named - getRarity- Lnet/minecraft/item/ItemStack;getRarity()Lnet/minecraft/util/Rarity;
 
- 
isEnchantablepublic 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 - official - D- Lcmy;D()Z- intermediary - method_7923- Lnet/minecraft/class_1799;method_7923()Z- named - isEnchantable- Lnet/minecraft/item/ItemStack;isEnchantable()Z
 
- 
addEnchantmentEnchants 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 "Enchantments" key. - See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Lcrj;I)V- intermediary - method_7978- Lnet/minecraft/class_1799;method_7978(Lnet/minecraft/class_1887;I)V- named - addEnchantment- Lnet/minecraft/item/ItemStack;addEnchantment(Lnet/minecraft/enchantment/Enchantment;I)V
 
- 
hasEnchantmentspublic 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 under "Enchantments" key.- Returns:
- whether the item stack has any enchantments
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - E- Lcmy;E()Z- intermediary - method_7942- Lnet/minecraft/class_1799;method_7942()Z- named - hasEnchantments- Lnet/minecraft/item/ItemStack;hasEnchantments()Z
 
- 
setSubNbtSets the given NBT element in the item stack's custom NBT at the specified key.- Parameters:
- key- the key where to put the given- NbtElement
- element- the NBT element to put
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Ljava/lang/String;Ltk;)V- intermediary - method_7959- Lnet/minecraft/class_1799;method_7959(Ljava/lang/String;Lnet/minecraft/class_2520;)V- named - setSubNbt- Lnet/minecraft/item/ItemStack;setSubNbt(Ljava/lang/String;Lnet/minecraft/nbt/NbtElement;)V
 
- 
isInFramepublic 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 - official - F- Lcmy;F()Z- intermediary - method_7961- Lnet/minecraft/class_1799;method_7961()Z- named - isInFrame- Lnet/minecraft/item/ItemStack;isInFrame()Z
 
- 
setHolderSets 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 - official - a- Lcmy;a(Lblv;)V- intermediary - method_27320- Lnet/minecraft/class_1799;method_27320(Lnet/minecraft/class_1297;)V- named - setHolder- Lnet/minecraft/item/ItemStack;setHolder(Lnet/minecraft/entity/Entity;)V
 
- 
getFrameReturns 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 - official - G- Lcmy;G()Lcbn;- intermediary - method_7945- Lnet/minecraft/class_1799;method_7945()Lnet/minecraft/class_1533;- named - getFrame- Lnet/minecraft/item/ItemStack;getFrame()Lnet/minecraft/entity/decoration/ItemFrameEntity;
 
- 
getHolderReturns 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 - official - H- Lcmy;H()Lblv;- intermediary - method_27319- Lnet/minecraft/class_1799;method_27319()Lnet/minecraft/class_1297;- named - getHolder- Lnet/minecraft/item/ItemStack;getHolder()Lnet/minecraft/entity/Entity;
 
- 
getRepairCostpublic int getRepairCost()Returns the stack's repair cost used in anvils.This is the the value of the "RepairCost" key in NBT. - Returns:
- the stack's repair cost used in anvils
- Mappings:
- Namespace - Name - Mixin selector - official - I- Lcmy;I()I- intermediary - method_7928- Lnet/minecraft/class_1799;method_7928()I- named - getRepairCost- Lnet/minecraft/item/ItemStack;getRepairCost()I
 
- 
setRepairCostpublic void setRepairCost(int repairCost) Sets the stack's repair cost used in anvils torepairCost.This is the the value of the "RepairCost" key in NBT. - Mappings:
- Namespace - Name - Mixin selector - official - d- Lcmy;d(I)V- intermediary - method_7927- Lnet/minecraft/class_1799;method_7927(I)V- named - setRepairCost- Lnet/minecraft/item/ItemStack;setRepairCost(I)V
 
- 
getAttributeModifiersReturns a multimap of attribute modifiers forslot.If a custom attribute modifier exists under the AttributeModifierskey, this returns those modifiers only; otherwise, this returns the item's default attribute modifier.- Returns:
- a multimap of attribute modifiers for slot
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Lbma;)Lcom/google/common/collect/Multimap;- intermediary - method_7926- Lnet/minecraft/class_1799;method_7926(Lnet/minecraft/class_1304;)Lcom/google/common/collect/Multimap;- named - getAttributeModifiers- Lnet/minecraft/item/ItemStack;getAttributeModifiers(Lnet/minecraft/entity/EquipmentSlot;)Lcom/google/common/collect/Multimap;
 
- 
addAttributeModifierpublic void addAttributeModifier(EntityAttribute attribute, EntityAttributeModifier modifier, @Nullable @Nullable EquipmentSlot slot) Adds an attribute modifier to this stack.- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Lbnm;Lbnp;Lbma;)V- intermediary - method_7916- Lnet/minecraft/class_1799;method_7916(Lnet/minecraft/class_1320;Lnet/minecraft/class_1322;Lnet/minecraft/class_1304;)V- named - addAttributeModifier- Lnet/minecraft/item/ItemStack;addAttributeModifier(Lnet/minecraft/entity/attribute/EntityAttribute;Lnet/minecraft/entity/attribute/EntityAttributeModifier;Lnet/minecraft/entity/EquipmentSlot;)V
 
- 
toHoverableTextReturns 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 - official - J- Lcmy;J()Lvf;- intermediary - method_7954- Lnet/minecraft/class_1799;method_7954()Lnet/minecraft/class_2561;- named - toHoverableText- Lnet/minecraft/item/ItemStack;toHoverableText()Lnet/minecraft/text/Text;
 
- 
canPlaceOn- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Lit;Ldjl;)Z- intermediary - method_7944- Lnet/minecraft/class_1799;method_7944(Lnet/minecraft/class_2378;Lnet/minecraft/class_2694;)Z- named - canPlaceOn- Lnet/minecraft/item/ItemStack;canPlaceOn(Lnet/minecraft/registry/Registry;Lnet/minecraft/block/pattern/CachedBlockPosition;)Z
 
- 
canDestroy- Mappings:
- Namespace - Name - Mixin selector - official - b- Lcmy;b(Lit;Ldjl;)Z- intermediary - method_7940- Lnet/minecraft/class_1799;method_7940(Lnet/minecraft/class_2378;Lnet/minecraft/class_2694;)Z- named - canDestroy- Lnet/minecraft/item/ItemStack;canDestroy(Lnet/minecraft/registry/Registry;Lnet/minecraft/block/pattern/CachedBlockPosition;)Z
 
- 
getBobbingAnimationTimepublic int getBobbingAnimationTime()- Mappings:
- Namespace - Name - Mixin selector - official - K- Lcmy;K()I- intermediary - method_7965- Lnet/minecraft/class_1799;method_7965()I- named - getBobbingAnimationTime- Lnet/minecraft/item/ItemStack;getBobbingAnimationTime()I
 
- 
setBobbingAnimationTimepublic void setBobbingAnimationTime(int bobbingAnimationTime) - Mappings:
- Namespace - Name - Mixin selector - official - e- Lcmy;e(I)V- intermediary - method_7912- Lnet/minecraft/class_1799;method_7912(I)V- named - setBobbingAnimationTime- Lnet/minecraft/item/ItemStack;setBobbingAnimationTime(I)V
 
- 
getCountpublic 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 - official - L- Lcmy;L()I- intermediary - method_7947- Lnet/minecraft/class_1799;method_7947()I- named - getCount- Lnet/minecraft/item/ItemStack;getCount()I
 
- 
setCountpublic void setCount(int count) Sets the count of items in this item stack.- Parameters:
- count- the count of items
- Mappings:
- Namespace - Name - Mixin selector - official - f- Lcmy;f(I)V- intermediary - method_7939- Lnet/minecraft/class_1799;method_7939(I)V- named - setCount- Lnet/minecraft/item/ItemStack;setCount(I)V
 
- 
incrementpublic void increment(int amount) Increments the count of items in this item stack.- Parameters:
- amount- the amount to increment
- Mappings:
- Namespace - Name - Mixin selector - official - g- Lcmy;g(I)V- intermediary - method_7933- Lnet/minecraft/class_1799;method_7933(I)V- named - increment- Lnet/minecraft/item/ItemStack;increment(I)V
 
- 
decrementpublic void decrement(int amount) Decrements the count of items in this item stack.- Parameters:
- amount- the amount to decrement
- Mappings:
- Namespace - Name - Mixin selector - official - h- Lcmy;h(I)V- intermediary - method_7934- Lnet/minecraft/class_1799;method_7934(I)V- named - decrement- Lnet/minecraft/item/ItemStack;decrement(I)V
 
- 
usageTick- Mappings:
- Namespace - Name - Mixin selector - official - b- Lcmy;b(Lctp;Lbml;I)V- intermediary - method_7949- Lnet/minecraft/class_1799;method_7949(Lnet/minecraft/class_1937;Lnet/minecraft/class_1309;I)V- named - usageTick- Lnet/minecraft/item/ItemStack;usageTick(Lnet/minecraft/world/World;Lnet/minecraft/entity/LivingEntity;I)V
 
- 
onItemEntityDestroyed- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcmy;a(Lcbu;)V- intermediary - method_33262- Lnet/minecraft/class_1799;method_33262(Lnet/minecraft/class_1542;)V- named - onItemEntityDestroyed- Lnet/minecraft/item/ItemStack;onItemEntityDestroyed(Lnet/minecraft/entity/ItemEntity;)V
 
- 
isFoodpublic boolean isFood()- Mappings:
- Namespace - Name - Mixin selector - official - M- Lcmy;M()Z- intermediary - method_19267- Lnet/minecraft/class_1799;method_19267()Z- named - isFood- Lnet/minecraft/item/ItemStack;isFood()Z
 
- 
getDrinkSound- Mappings:
- Namespace - Name - Mixin selector - official - N- Lcmy;N()Larr;- intermediary - method_21832- Lnet/minecraft/class_1799;method_21832()Lnet/minecraft/class_3414;- named - getDrinkSound- Lnet/minecraft/item/ItemStack;getDrinkSound()Lnet/minecraft/sound/SoundEvent;
 
- 
getEatSound- Mappings:
- Namespace - Name - Mixin selector - official - O- Lcmy;O()Larr;- intermediary - method_21833- Lnet/minecraft/class_1799;method_21833()Lnet/minecraft/class_3414;- named - getEatSound- Lnet/minecraft/item/ItemStack;getEatSound()Lnet/minecraft/sound/SoundEvent;
 
 
-