Class ItemStack

    • Field Detail

      • CODEC

        public static final com.mojang.serialization.Codec<ItemStack> CODEC
      • LOGGER

        private static final org.apache.logging.log4j.Logger LOGGER
      • ATTRIBUTE_MODIFIER_FORMAT

        public static final java.text.DecimalFormat ATTRIBUTE_MODIFIER_FORMAT
      • LORE_STYLE

        private static final Style LORE_STYLE
      • count

        private int count
      • popTime

        private int popTime
      • item

        @Deprecated
        private final Item item
        Deprecated.
      • emptyCacheFlag

        private boolean emptyCacheFlag
      • entityRepresentation

        private Entity entityRepresentation
      • cachedBreakBlockResult

        private boolean cachedBreakBlockResult
      • cachedPlaceBlockResult

        private boolean cachedPlaceBlockResult
    • Method Detail

      • updateEmptyCacheFlag

        private void updateEmptyCacheFlag()
      • isEmpty

        public boolean isEmpty()
      • split

        public ItemStack split​(int p_77979_1_)
      • getItem

        public Item getItem()
      • getDestroySpeed

        public float getDestroySpeed​(BlockState p_150997_1_)
      • getMaxStackSize

        public int getMaxStackSize()
      • isStackable

        public boolean isStackable()
      • isDamageableItem

        public boolean isDamageableItem()
      • isDamaged

        public boolean isDamaged()
      • getDamageValue

        public int getDamageValue()
      • setDamageValue

        public void setDamageValue​(int p_196085_1_)
      • getMaxDamage

        public int getMaxDamage()
      • hurt

        public boolean hurt​(int p_96631_1_,
                            java.util.Random p_96631_2_,
                            @Nullable
                            ServerPlayerEntity p_96631_3_)
      • hurtAndBreak

        public <T extends LivingEntity> void hurtAndBreak​(int p_222118_1_,
                                                          T p_222118_2_,
                                                          java.util.function.Consumer<T> p_222118_3_)
      • isCorrectToolForDrops

        public boolean isCorrectToolForDrops​(BlockState p_150998_1_)
      • tagMatches

        public static boolean tagMatches​(ItemStack p_77970_0_,
                                         ItemStack p_77970_1_)
      • matches

        public static boolean matches​(ItemStack p_77989_0_,
                                      ItemStack p_77989_1_)
      • matches

        private boolean matches​(ItemStack p_77959_1_)
      • isSame

        public static boolean isSame​(ItemStack p_179545_0_,
                                     ItemStack p_179545_1_)
      • isSameIgnoreDurability

        public static boolean isSameIgnoreDurability​(ItemStack p_185132_0_,
                                                     ItemStack p_185132_1_)
      • sameItem

        public boolean sameItem​(ItemStack p_77969_1_)
      • sameItemStackIgnoreDurability

        public boolean sameItemStackIgnoreDurability​(ItemStack p_185136_1_)
      • getDescriptionId

        public java.lang.String getDescriptionId()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • inventoryTick

        public void inventoryTick​(World p_77945_1_,
                                  Entity p_77945_2_,
                                  int p_77945_3_,
                                  boolean p_77945_4_)
      • onCraftedBy

        public void onCraftedBy​(World p_77980_1_,
                                PlayerEntity p_77980_2_,
                                int p_77980_3_)
      • getUseDuration

        public int getUseDuration()
      • getUseAnimation

        public UseAction getUseAnimation()
      • releaseUsing

        public void releaseUsing​(World p_77974_1_,
                                 LivingEntity p_77974_2_,
                                 int p_77974_3_)
      • useOnRelease

        public boolean useOnRelease()
      • hasTag

        public boolean hasTag()
      • getOrCreateTagElement

        public CompoundNBT getOrCreateTagElement​(java.lang.String p_190925_1_)
      • getTagElement

        @Nullable
        public CompoundNBT getTagElement​(java.lang.String p_179543_1_)
      • removeTagKey

        public void removeTagKey​(java.lang.String p_196083_1_)
      • getEnchantmentTags

        public ListNBT getEnchantmentTags()
      • setTag

        public void setTag​(@Nullable
                           CompoundNBT p_77982_1_)
      • resetHoverName

        public void resetHoverName()
      • hasCustomHoverName

        public boolean hasCustomHoverName()
      • getHideFlags

        private int getHideFlags()
      • appendEnchantmentNames

        public static void appendEnchantmentNames​(java.util.List<ITextComponent> p_222120_0_,
                                                  ListNBT p_222120_1_)
      • expandBlockState

        private static java.util.Collection<ITextComponent> expandBlockState​(java.lang.String p_206845_0_)
      • hasFoil

        public boolean hasFoil()
      • getRarity

        public Rarity getRarity()
      • isEnchantable

        public boolean isEnchantable()
      • enchant

        public void enchant​(Enchantment p_77966_1_,
                            int p_77966_2_)
      • isEnchanted

        public boolean isEnchanted()
      • addTagElement

        public void addTagElement​(java.lang.String p_77983_1_,
                                  INBT p_77983_2_)
      • isFramed

        public boolean isFramed()
      • setEntityRepresentation

        public void setEntityRepresentation​(@Nullable
                                            Entity p_234695_1_)
      • getEntityRepresentation

        @Nullable
        public Entity getEntityRepresentation()
      • getBaseRepairCost

        public int getBaseRepairCost()
      • setRepairCost

        public void setRepairCost​(int p_82841_1_)
      • getPopTime

        public int getPopTime()
      • setPopTime

        public void setPopTime​(int p_190915_1_)
      • getCount

        public int getCount()
      • setCount

        public void setCount​(int p_190920_1_)
      • grow

        public void grow​(int p_190917_1_)
      • shrink

        public void shrink​(int p_190918_1_)
      • onUseTick

        public void onUseTick​(World p_222121_1_,
                              LivingEntity p_222121_2_,
                              int p_222121_3_)
      • isEdible

        public boolean isEdible()
      • forgeInit

        private void forgeInit()
        Set up forge's ItemStack additions.
      • getDrinkingSound

        public SoundEvent getDrinkingSound()
      • getEatingSound

        public SoundEvent getEatingSound()