Class ItemStack
- All Implemented Interfaces:
ComponentHolder
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<? super 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
#encode(RegistryWrapper.WrapperLookup)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 cwq
-
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.Deprecated.private static final Loggerstatic 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> static 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, @Nullable PlayerEntity player) private voidappendAttributeModifierTooltip(Consumer<Text> textConsumer, @Nullable PlayerEntity player, RegistryEntry<EntityAttribute> attribute, EntityAttributeModifier modifier) private <T extends TooltipAppender>
voidappendTooltip(ComponentType<T> componentType, Item.TooltipContext context, Consumer<Text> textConsumer, TooltipType type) <T> 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> 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, BiConsumer<RegistryEntry<EntityAttribute>, EntityAttributeModifier> 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) booleanbooleanbooleancanRepairWith(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.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.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) voiddamage(int amount, LivingEntity entity, EquipmentSlot slot) Damages this item stack.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) fromNbt(RegistryWrapper.WrapperLookup registries, NbtElement nbt) static ItemStackfromNbtOrEmpty(RegistryWrapper.WrapperLookup registries, NbtCompound nbt) intintgetCount()Returns the count of items in this item stack.Returns the custom name or book title of the stack if it exists, ornull.intReturns the damage (lost durability) of the item stack.getFrame()Returns the item frame that holds the stack, ornullif inapplicable.Returns 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, 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.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(World world, 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> Tremove(ComponentType<? extends T> type) Removes the componenttype.<T> Tset(ComponentType<? super T> type, 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.booleansplit(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.toNbt(RegistryWrapper.WrapperLookup registries) toNbt(RegistryWrapper.WrapperLookup registries, NbtElement prefix) toNbtAllowEmpty(RegistryWrapper.WrapperLookup registries) 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) private 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, streamAll
-
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 kLcwq;k:Ljava/util/List;
-
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 aLcwq;a: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 bLcwq;b: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 cLcwq;c: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 dLcwq;d: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 eLcwq;e: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 fLcwq;f: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 gLcwq;g:Lyn;
-
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 hLcwq;h:Lyn;
-
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 iLcwq;i:Lyn;
-
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 lLcwq;l: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 jLcwq;j:Lcwq;
-
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 mLcwq;m:Lwp;
-
count
private int count- Mappings:
Namespace Name Mixin selector named countLnet/minecraft/item/ItemStack;count:Iintermediary field_8031Lnet/minecraft/class_1799;field_8031:Iofficial nLcwq;n: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 oLcwq;o: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 pLcwq;p:Lcwm;
-
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 qLcwq;q:Lkw;
-
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 rLcwq;r:Lbum;
-
-
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>Lcwq;<init>(Ldgi;)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>Lcwq;<init>(Ljr;)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>Lcwq;<init>(Ljr;ILks;)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>Lcwq;<init>(Ljr;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>Lcwq;<init>(Ldgi;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>Lcwq;<init>(Ldgi;ILkw;)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>Lcwq;<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 cLcwq;c(Lcwq;)Lcom/mojang/serialization/DataResult;
-
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 aLcwq;a(Lyn;)Lyn;
-
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 bLcwq;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 aLkq;a()Lkr;
-
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 cLcwq;c()Lkr;
-
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 dLcwq;d()Lks;
-
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 eLcwq;e()Lkr;
-
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 cLcwq;c(Lku;)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 aLcwq;a(Lkr;)Lcom/mojang/serialization/DataResult;
-
fromNbt
- Mappings:
Namespace Name Mixin selector named fromNbtLnet/minecraft/item/ItemStack;fromNbt(Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;Lnet/minecraft/nbt/NbtElement;)Ljava/util/Optional;intermediary method_57360Lnet/minecraft/class_1799;method_57360(Lnet/minecraft/class_7225$class_7874;Lnet/minecraft/class_2520;)Ljava/util/Optional;official aLcwq;a(Ljt$a;Lun;)Ljava/util/Optional;
-
fromNbtOrEmpty
- Mappings:
Namespace Name Mixin selector named fromNbtOrEmptyLnet/minecraft/item/ItemStack;fromNbtOrEmpty(Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;Lnet/minecraft/nbt/NbtCompound;)Lnet/minecraft/item/ItemStack;intermediary method_57359Lnet/minecraft/class_1799;method_57359(Lnet/minecraft/class_7225$class_7874;Lnet/minecraft/class_2487;)Lnet/minecraft/class_1799;official aLcwq;a(Ljt$a;Ltq;)Lcwq;
-
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 fLcwq;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 aLcwq;a(Lcru;)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 aLcwq;a(I)Lcwq;
-
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 gLcwq;g()Lcwq;
-
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 hLcwq;h()Lcwm;
-
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 iLcwq;i()Ljr;
-
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 aLcwq;a(Laxf;)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 aLcwq;a(Lcwm;)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 aLcwq;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 aLcwq;a(Ljr;)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 aLcwq;a(Ljv;)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 jLcwq;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 aLcwq;a(Ldaj;)Lbsl;
-
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 aLcwq;a(Ldwy;)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 aLcwq;a(Ldgj;Lcoy;Lbsk;)Lbsl;
-
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 aLcwq;a(Ldgj;Lbvi;)Lcwq;
-
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 aLcwq;a(Lbvi;Lcwq;)Lcwq;
-
toNbt
- Mappings:
Namespace Name Mixin selector named toNbtLnet/minecraft/item/ItemStack;toNbt(Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;Lnet/minecraft/nbt/NbtElement;)Lnet/minecraft/nbt/NbtElement;intermediary method_57376Lnet/minecraft/class_1799;method_57376(Lnet/minecraft/class_7225$class_7874;Lnet/minecraft/class_2520;)Lnet/minecraft/class_2520;official bLcwq;b(Ljt$a;Lun;)Lun;
-
toNbt
- Mappings:
Namespace Name Mixin selector named toNbtLnet/minecraft/item/ItemStack;toNbt(Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Lnet/minecraft/nbt/NbtElement;intermediary method_57358Lnet/minecraft/class_1799;method_57358(Lnet/minecraft/class_7225$class_7874;)Lnet/minecraft/class_2520;official aLcwq;a(Ljt$a;)Lun;
-
toNbtAllowEmpty
- Mappings:
Namespace Name Mixin selector named toNbtAllowEmptyLnet/minecraft/item/ItemStack;toNbtAllowEmpty(Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Lnet/minecraft/nbt/NbtElement;intermediary method_57375Lnet/minecraft/class_1799;method_57375(Lnet/minecraft/class_7225$class_7874;)Lnet/minecraft/class_2520;official bLcwq;b(Ljt$a;)Lun;
-
getMaxCount
public int getMaxCount()- Mappings:
Namespace Name Mixin selector named getMaxCountLnet/minecraft/item/ItemStack;getMaxCount()Iintermediary method_7914Lnet/minecraft/class_1799;method_7914()Iofficial kLcwq;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 lLcwq;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 mLcwq;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 nLcwq;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 oLcwq;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 bLcwq;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 pLcwq;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 qLcwq;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 rLcwq;r()Z
-
damage
public void damage(int amount, ServerWorld world, @Nullable @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 aLcwq;a(ILard;Lare;Ljava/util/function/Consumer;)V
-
calculateDamage
private int calculateDamage(int baseDamage, ServerWorld world, @Nullable @Nullable ServerPlayerEntity player) - 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 aLcwq;a(ILard;Lare;)I
-
onDurabilityChange
private void onDurabilityChange(int damage, @Nullable @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 aLcwq;a(ILare;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 aLcwq;a(ILcoy;)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 aLcwq;a(ILbvi;Lbuu;)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 aLcwq;a(ILdgi;Lbvi;Lbuu;)Lcwq;
-
isItemBarVisible
public boolean isItemBarVisible()- Mappings:
Namespace Name Mixin selector named isItemBarVisibleLnet/minecraft/item/ItemStack;isItemBarVisible()Zintermediary method_31578Lnet/minecraft/class_1799;method_31578()Zofficial sLcwq;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 tLcwq;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 uLcwq;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 aLcwq;a(Lcua;Lcsn;Lcoy;)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 aLcwq;a(Lcwq;Lcua;Lcsn;Lcoy;Lbwa;)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 aLcwq;a(Lbvi;Lbvi;)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 bLcwq;b(Lbvi;Lbvi;)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 aLcwq;a(Ldgj;Ldwy;Lji;Lcoy;)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 bLcwq;b(Ldwy;)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 aLcwq;a(Lcoy;Lbvi;Lbsk;)Lbsl;
-
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 vLcwq;v()Lcwq;
-
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
- 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 cLcwq;c(I)Lcwq;
-
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 aLcwq;a(Ldgi;)Lcwq;
-
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 aLcwq;a(Ldgi;I)Lcwq;
-
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 bLcwq;b(Ldgi;I)Lcwq;
-
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 aLcwq;a(Lcwq;Lcwq;)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 aLcwq;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 bLcwq;b(Lcwq;Lcwq;)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 cLcwq;c(Lcwq;Lcwq;)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 aLcwq;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 aLcwq;a(Lcwq;)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 aLcwq;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;IZ)Vintermediary method_7917Lnet/minecraft/class_1799;method_7917(Lnet/minecraft/class_1937;Lnet/minecraft/class_1297;IZ)Vofficial aLcwq;a(Ldgj;Lbum;IZ)V
-
onCraftByPlayer
- Mappings:
Namespace Name Mixin selector named onCraftByPlayerLnet/minecraft/item/ItemStack;onCraftByPlayer(Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;I)Vintermediary method_7982Lnet/minecraft/class_1799;method_7982(Lnet/minecraft/class_1937;Lnet/minecraft/class_1657;I)Vofficial aLcwq;a(Ldgj;Lcoy;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 aLcwq;a(Ldgj;)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 aLcwq;a(Lbvi;)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 wLcwq;w()Lcws;
-
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 aLcwq;a(Ldgj;Lbvi;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 xLcwq;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 bLcwq;b(Lku;Ljava/lang/Object;)Ljava/lang/Object;
-
apply
@Nullable public <T,U> 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 aLcwq;a(Lku;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 aLcwq;a(Lku;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 dLcwq;d(Lku;)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 aLcwq;a(Lks;)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 bLcwq;b(Lks;)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 bLcwq;b(Lkr;)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 yLcwq;y()Lwp;
-
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 zLcwq;z()Lwp;
-
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 ALcwq;A()Lwp;
-
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 BLcwq;B()Lwp;
-
appendTooltip
private <T extends TooltipAppender> void appendTooltip(ComponentType<T> componentType, Item.TooltipContext context, Consumer<Text> textConsumer, TooltipType type) - Mappings:
Namespace Name Mixin selector named appendTooltipLnet/minecraft/item/ItemStack;appendTooltip(Lnet/minecraft/component/ComponentType;Lnet/minecraft/item/Item$TooltipContext;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;Ljava/util/function/Consumer;Lnet/minecraft/class_1836;)Vofficial aLcwq;a(Lku;Lcwm$b;Ljava/util/function/Consumer;Lcyi;)V
-
getTooltip
public List<Text> getTooltip(Item.TooltipContext context, @Nullable @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 aLcwq;a(Lcwm$b;Lcoy;Lcyi;)Ljava/util/List;
-
appendAttributeModifiersTooltip
private void appendAttributeModifiersTooltip(Consumer<Text> textConsumer, @Nullable @Nullable PlayerEntity player) - Mappings:
Namespace Name Mixin selector named appendAttributeModifiersTooltipLnet/minecraft/item/ItemStack;appendAttributeModifiersTooltip(Ljava/util/function/Consumer;Lnet/minecraft/entity/player/PlayerEntity;)Vintermediary method_57363Lnet/minecraft/class_1799;method_57363(Ljava/util/function/Consumer;Lnet/minecraft/class_1657;)Vofficial aLcwq;a(Ljava/util/function/Consumer;Lcoy;)V
-
appendAttributeModifierTooltip
private void appendAttributeModifierTooltip(Consumer<Text> textConsumer, @Nullable @Nullable PlayerEntity player, RegistryEntry<EntityAttribute> attribute, EntityAttributeModifier modifier) - Mappings:
Namespace Name Mixin selector named appendAttributeModifierTooltipLnet/minecraft/item/ItemStack;appendAttributeModifierTooltip(Ljava/util/function/Consumer;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/registry/entry/RegistryEntry;Lnet/minecraft/entity/attribute/EntityAttributeModifier;)Vintermediary method_57364Lnet/minecraft/class_1799;method_57364(Ljava/util/function/Consumer;Lnet/minecraft/class_1657;Lnet/minecraft/class_6880;Lnet/minecraft/class_1322;)Vofficial aLcwq;a(Ljava/util/function/Consumer;Lcoy;Ljr;Lbwo;)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 CLcwq;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 DLcwq;D()Lcxn;
-
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 ELcwq;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 aLcwq;a(Ljr;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 FLcwq;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 GLcwq;G()Lddg;
-
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 HLcwq;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 aLcwq;a(Lbum;)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 ILcwq;I()Lckw;
-
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 JLcwq;J()Lbum;
-
applyAttributeModifier
public void applyAttributeModifier(AttributeModifierSlot slot, BiConsumer<RegistryEntry<EntityAttribute>, EntityAttributeModifier> attributeModifierConsumer) - Mappings:
Namespace Name Mixin selector named applyAttributeModifierLnet/minecraft/item/ItemStack;applyAttributeModifier(Lnet/minecraft/component/type/AttributeModifierSlot;Ljava/util/function/BiConsumer;)Vintermediary method_60617Lnet/minecraft/class_1799;method_60617(Lnet/minecraft/class_9274;Ljava/util/function/BiConsumer;)Vofficial aLcwq;a(Lbuv;Ljava/util/function/BiConsumer;)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 aLcwq;a(Lbuu;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 KLcwq;K()Lwp;
-
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 aLcwq;a(Ldxc;)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 bLcwq;b(Ldxc;)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 LLcwq;L()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 dLcwq;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 MLcwq;M()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 eLcwq;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 fLcwq;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 gLcwq;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 hLcwq;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 aLcwq;a(ILbvi;)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 bLcwq;b(ILbvi;)Lcwq;
-
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 bLcwq;b(Ldgj;Lbvi;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 aLcwq;a(Lcld;)V
-
getBreakSound
- Mappings:
Namespace Name Mixin selector named getBreakSoundLnet/minecraft/item/ItemStack;getBreakSound()Lnet/minecraft/sound/SoundEvent;intermediary method_57351Lnet/minecraft/class_1799;method_57351()Lnet/minecraft/class_3414;official NLcwq;N()Lavz;
-
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 aLcwq;a(Lbtc;)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 bLcwq;b(Lcwq;)Z
-