Class Item

    • Field Detail

      • BY_BLOCK

        public static final java.util.Map<Block,​Item> BY_BLOCK
      • BASE_ATTACK_DAMAGE_UUID

        protected static final java.util.UUID BASE_ATTACK_DAMAGE_UUID
      • BASE_ATTACK_SPEED_UUID

        protected static final java.util.UUID BASE_ATTACK_SPEED_UUID
      • random

        protected static final java.util.Random random
      • category

        protected final ItemGroup category
      • rarity

        private final Rarity rarity
      • maxStackSize

        private final int maxStackSize
      • maxDamage

        private final int maxDamage
      • isFireResistant

        private final boolean isFireResistant
      • craftingRemainingItem

        private final Item craftingRemainingItem
      • descriptionId

        @Nullable
        private java.lang.String descriptionId
      • foodProperties

        @Nullable
        private final Food foodProperties
      • toolClasses

        private final java.util.Map<ToolType,​java.lang.Integer> toolClasses
      • canRepair

        protected final boolean canRepair
    • Method Detail

      • getId

        public static int getId​(Item p_150891_0_)
      • byId

        public static Item byId​(int p_150899_0_)
      • byBlock

        @Deprecated
        public static Item byBlock​(Block p_150898_0_)
        Deprecated.
      • verifyTagAfterLoad

        public boolean verifyTagAfterLoad​(CompoundNBT p_179215_1_)
      • getDestroySpeed

        public float getDestroySpeed​(ItemStack p_150893_1_,
                                     BlockState p_150893_2_)
      • getMaxStackSize

        @Deprecated
        public final int getMaxStackSize()
        Deprecated.
      • getMaxDamage

        @Deprecated
        public final int getMaxDamage()
        Deprecated.
      • canBeDepleted

        public boolean canBeDepleted()
      • isCorrectToolForDrops

        public boolean isCorrectToolForDrops​(BlockState p_150897_1_)
      • toString

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

        protected java.lang.String getOrCreateDescriptionId()
      • getDescriptionId

        public java.lang.String getDescriptionId()
      • getDescriptionId

        public java.lang.String getDescriptionId​(ItemStack p_77667_1_)
      • shouldOverrideMultiplayerNbt

        public boolean shouldOverrideMultiplayerNbt()
      • getCraftingRemainingItem

        @Nullable
        @Deprecated
        public final Item getCraftingRemainingItem()
        Deprecated.
      • hasCraftingRemainingItem

        @Deprecated
        public boolean hasCraftingRemainingItem()
        Deprecated.
      • inventoryTick

        public void inventoryTick​(ItemStack p_77663_1_,
                                  World p_77663_2_,
                                  Entity p_77663_3_,
                                  int p_77663_4_,
                                  boolean p_77663_5_)
      • isComplex

        public boolean isComplex()
      • getUseDuration

        public int getUseDuration​(ItemStack p_77626_1_)
      • isFoil

        public boolean isFoil​(ItemStack p_77636_1_)
      • isEnchantable

        public boolean isEnchantable​(ItemStack p_77616_1_)
      • getEnchantmentValue

        public int getEnchantmentValue()
      • allowdedIn

        protected boolean allowdedIn​(ItemGroup p_194125_1_)
      • getItemCategory

        @Nullable
        public final ItemGroup getItemCategory()
      • isValidRepairItem

        public boolean isValidRepairItem​(ItemStack p_82789_1_,
                                         ItemStack p_82789_2_)
      • isRepairable

        public boolean isRepairable​(ItemStack stack)
        Description copied from interface: IForgeItem
        Called by CraftingManager to determine if an item is reparable.
        Specified by:
        isRepairable in interface IForgeItem
        Returns:
        True if reparable
      • getHarvestLevel

        public int getHarvestLevel​(ItemStack stack,
                                   ToolType tool,
                                   @Nullable
                                   PlayerEntity player,
                                   @Nullable
                                   BlockState blockState)
        Description copied from interface: IForgeItem
        Queries the harvest level of this item stack for the specified tool class, Returns -1 if this tool is not of the specified type
        Specified by:
        getHarvestLevel in interface IForgeItem
        Parameters:
        stack - This item stack instance
        player - The player trying to harvest the given blockstate
        blockState - The block to harvest
        Returns:
        Harvest level, or -1 if not the specified tool type.
      • getTags

        public java.util.Set<ResourceLocation> getTags()
        Description copied from interface: IForgeItem
        Retrieves a list of tags names this is known to be associated with. This should be used in favor of TagCollection.getOwningTags, as this caches the result and automatically updates when the TagCollection changes.
        Specified by:
        getTags in interface IForgeItem
      • useOnRelease

        public boolean useOnRelease​(ItemStack p_219970_1_)
      • getDefaultInstance

        public ItemStack getDefaultInstance()
      • is

        public boolean is​(ITag<Item> p_206844_1_)
      • isEdible

        public boolean isEdible()
      • getFoodProperties

        @Nullable
        public Food getFoodProperties()
      • getDrinkingSound

        public SoundEvent getDrinkingSound()
      • getEatingSound

        public SoundEvent getEatingSound()
      • isFireResistant

        public boolean isFireResistant()
      • canBeHurtBy

        public boolean canBeHurtBy​(DamageSource p_234685_1_)