Package net.minecraft.world.item
Class Item
java.lang.Object
net.minecraft.world.item.Item
- All Implemented Interfaces:
- FeatureElement,- ItemLike,- IForgeItem
- Direct Known Subclasses:
- AirItem,- ArmorItem,- ArmorStandItem,- ArrowItem,- BannerPatternItem,- BlockItem,- BoatItem,- BoneMealItem,- BookItem,- BottleItem,- BowlFoodItem,- BrushItem,- BucketItem,- BundleItem,- ChorusFruitItem,- CompassItem,- ComplexItem,- DebugStickItem,- DiscFragmentItem,- DyeItem,- EggItem,- ElytraItem,- EnchantedBookItem,- EnchantedGoldenAppleItem,- EndCrystalItem,- EnderEyeItem,- EnderpearlItem,- ExperienceBottleItem,- FireChargeItem,- FireworkRocketItem,- FireworkStarItem,- FishingRodItem,- FlintAndSteelItem,- FoodOnAStickItem,- GlowInkSacItem,- HangingEntityItem,- HoneyBottleItem,- HoneycombItem,- HorseArmorItem,- InkSacItem,- InstrumentItem,- ItemFluidContainer,- KnowledgeBookItem,- LeadItem,- MilkBucketItem,- MinecartItem,- NameTagItem,- PotionItem,- ProjectileWeaponItem,- RecordItem,- SaddleItem,- ShearsItem,- ShieldItem,- SimpleFoiledItem,- SmithingTemplateItem,- SnowballItem,- SpawnEggItem,- SpyglassItem,- SuspiciousStewItem,- TieredItem,- TridentItem,- WritableBookItem,- WrittenBookItem
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected static final UUIDprotected static final UUIDprivate final Holder.Reference<Item>protected final booleanprivate final Itemprivate Stringstatic final intprivate final FoodPropertiesprivate final booleanprivate static final org.slf4j.Loggerstatic final intstatic final intprivate final intprivate final intprivate final Rarityprivate Objectprivate final FeatureFlagSetFields inherited from interface net.minecraft.world.flag.FeatureElementFILTERED_REGISTRIES
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidappendHoverText(ItemStack p_41421_, Level p_41422_, List<Component> p_41423_, TooltipFlag p_41424_) asItem()Deprecated.static ItemDeprecated.static ItembyId(int p_41446_) booleancanAttackBlock(BlockState p_41441_, Level p_41442_, BlockPos p_41443_, Player p_41444_) booleanbooleancanBeHurtBy(DamageSource p_41387_) booleanfinishUsingItem(ItemStack p_41409_, Level p_41410_, LivingEntity p_41411_) intgetBarColor(ItemStack p_150901_) intgetBarWidth(ItemStack p_150900_) final ItemDeprecated.com.google.common.collect.Multimap<Attribute,AttributeModifier> getDefaultAttributeModifiers(EquipmentSlot p_41388_) Deprecated.getDescriptionId(ItemStack p_41455_) floatgetDestroySpeed(ItemStack p_41425_, BlockState p_41426_) intDeprecated.Deprecated.static intfinal intDeprecated.final intDeprecated.protected Stringprotected static BlockHitResultgetPlayerPOVHitResult(Level p_41436_, Player p_41437_, ClipContext.Fluid p_41438_) getTooltipImage(ItemStack p_150902_) getUseAnimation(ItemStack p_41452_) intgetUseDuration(ItemStack p_41454_) booleanDeprecated.booleanhurtEnemy(ItemStack p_41395_, LivingEntity p_41396_, LivingEntity p_41397_) private voidvoidinitializeClient(Consumer<IClientItemExtensions> consumer) interactLivingEntity(ItemStack p_41398_, Player p_41399_, LivingEntity p_41400_, InteractionHand p_41401_) voidinventoryTick(ItemStack p_41404_, Level p_41405_, Entity p_41406_, int p_41407_, boolean p_41408_) booleanisBarVisible(ItemStack p_150899_) booleanbooleanisCorrectToolForDrops(BlockState p_41450_) booleanisEdible()booleanisEnchantable(ItemStack p_41456_) booleanbooleanbooleanisRepairable(ItemStack stack) Called by CraftingManager to determine if an item is reparable.booleanisValidRepairItem(ItemStack p_41402_, ItemStack p_41403_) booleanmineBlock(ItemStack p_41416_, Level p_41417_, BlockState p_41418_, BlockPos p_41419_, LivingEntity p_41420_) voidonCraftedBy(ItemStack p_41447_, Level p_41448_, Player p_41449_) voidonDestroyed(ItemEntity p_150887_) Deprecated.voidonUseTick(Level p_41428_, LivingEntity p_41429_, ItemStack p_41430_, int p_41431_) booleanoverrideOtherStackedOnMe(ItemStack p_150892_, ItemStack p_150893_, Slot p_150894_, ClickAction p_150895_, Player p_150896_, SlotAccess p_150897_) booleanoverrideStackedOnOther(ItemStack p_150888_, Slot p_150889_, ClickAction p_150890_, Player p_150891_) voidreleaseUsing(ItemStack p_41412_, Level p_41413_, LivingEntity p_41414_, int p_41415_) booleantoString()use(Level p_41432_, Player p_41433_, InteractionHand p_41434_) useOn(UseOnContext p_41427_) booleanuseOnRelease(ItemStack p_41464_) voidverifyTagAfterLoad(CompoundTag p_150898_) Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.flag.FeatureElementisEnabledMethods inherited from interface net.minecraftforge.common.extensions.IForgeItemcanApplyAtEnchantingTable, canContinueUsing, canDisableShield, canElytraFly, canEquip, canGrindstoneRepair, canPerformAction, canWalkOnPowderedSnow, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getAllEnchantments, getArmorTexture, getAttributeModifiers, getBurnTime, getCraftingRemainingItem, getCreatorModId, getDamage, getDefaultTooltipHideFlags, getEnchantmentLevel, getEnchantmentValue, getEntityLifespan, getEquipmentSlot, getFoodProperties, getHighlightTip, getMaxDamage, getMaxStackSize, getShareTag, getSweepHitBox, getXpRepairRatio, hasCraftingRemainingItem, hasCustomEntity, initCapabilities, isBookEnchantable, isCorrectToolForDrops, isDamageable, isDamaged, isEnderMask, isNotReplaceableByPickAction, isPiglinCurrency, makesPiglinsNeutral, onArmorTick, onBlockStartBreak, onDestroyed, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onHorseArmorTick, onInventoryTick, onItemUseFirst, onLeftClickEntity, onStopUsing, readShareTag, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation
- 
Field Details- 
LOGGERprivate static final org.slf4j.Logger LOGGER
- 
BY_BLOCK
- 
BASE_ATTACK_DAMAGE_UUID
- 
BASE_ATTACK_SPEED_UUID
- 
MAX_STACK_SIZEpublic static final int MAX_STACK_SIZE- See Also:
 
- 
EAT_DURATIONpublic static final int EAT_DURATION- See Also:
 
- 
MAX_BAR_WIDTHpublic static final int MAX_BAR_WIDTH- See Also:
 
- 
builtInRegistryHolder
- 
rarity
- 
maxStackSizeprivate final int maxStackSize
- 
maxDamageprivate final int maxDamage
- 
isFireResistantprivate final boolean isFireResistant
- 
craftingRemainingItem
- 
descriptionId
- 
foodProperties
- 
requiredFeatures
- 
canRepairprotected final boolean canRepair
- 
renderProperties
 
- 
- 
Constructor Details- 
Item
 
- 
- 
Method Details- 
getId
- 
byId
- 
byBlockDeprecated.
- 
builtInRegistryHolderDeprecated.
- 
onUseTick
- 
onDestroyedDeprecated.
- 
verifyTagAfterLoad
- 
canAttackBlockpublic boolean canAttackBlock(BlockState p_41441_, Level p_41442_, BlockPos p_41443_, Player p_41444_) 
- 
asItem
- 
useOn
- 
getDestroySpeed
- 
usepublic InteractionResultHolder<ItemStack> use(Level p_41432_, Player p_41433_, InteractionHand p_41434_) 
- 
finishUsingItem
- 
getMaxStackSizeDeprecated.
- 
getMaxDamageDeprecated.
- 
canBeDepletedpublic boolean canBeDepleted()
- 
isBarVisible
- 
getBarWidth
- 
getBarColor
- 
overrideStackedOnOtherpublic boolean overrideStackedOnOther(ItemStack p_150888_, Slot p_150889_, ClickAction p_150890_, Player p_150891_) 
- 
overrideOtherStackedOnMepublic boolean overrideOtherStackedOnMe(ItemStack p_150892_, ItemStack p_150893_, Slot p_150894_, ClickAction p_150895_, Player p_150896_, SlotAccess p_150897_) 
- 
hurtEnemy
- 
mineBlockpublic boolean mineBlock(ItemStack p_41416_, Level p_41417_, BlockState p_41418_, BlockPos p_41419_, LivingEntity p_41420_) 
- 
isCorrectToolForDrops
- 
interactLivingEntitypublic InteractionResult interactLivingEntity(ItemStack p_41398_, Player p_41399_, LivingEntity p_41400_, InteractionHand p_41401_) 
- 
getDescription
- 
toString
- 
getOrCreateDescriptionId
- 
getDescriptionId
- 
getDescriptionId
- 
shouldOverrideMultiplayerNbtpublic boolean shouldOverrideMultiplayerNbt()
- 
getCraftingRemainingItemDeprecated.
- 
hasCraftingRemainingItemDeprecated.
- 
inventoryTick
- 
onCraftedBy
- 
isComplexpublic boolean isComplex()
- 
getUseAnimation
- 
getUseDuration
- 
releaseUsing
- 
appendHoverTextpublic void appendHoverText(ItemStack p_41421_, @Nullable Level p_41422_, List<Component> p_41423_, TooltipFlag p_41424_) 
- 
getTooltipImage
- 
getName
- 
isFoil
- 
getRarity
- 
isEnchantable
- 
getPlayerPOVHitResultprotected static BlockHitResult getPlayerPOVHitResult(Level p_41436_, Player p_41437_, ClipContext.Fluid p_41438_) 
- 
getEnchantmentValueDeprecated.Forge: Use ItemStack sensitive version.
- 
isValidRepairItem
- 
getDefaultAttributeModifiers@Deprecated public com.google.common.collect.Multimap<Attribute,AttributeModifier> getDefaultAttributeModifiers(EquipmentSlot p_41388_) Deprecated.
- 
isRepairableDescription copied from interface:IForgeItemCalled by CraftingManager to determine if an item is reparable.- Specified by:
- isRepairablein interface- IForgeItem
- Returns:
- True if reparable
 
- 
useOnRelease
- 
getDefaultInstance
- 
isEdiblepublic boolean isEdible()
- 
getFoodPropertiesDeprecated.
- 
getDrinkingSound
- 
getEatingSound
- 
isFireResistantpublic boolean isFireResistant()
- 
canBeHurtBy
- 
canFitInsideContainerItemspublic boolean canFitInsideContainerItems()
- 
requiredFeatures- Specified by:
- requiredFeaturesin interface- FeatureElement
 
- 
getRenderPropertiesInternal
- 
initClientprivate void initClient()
- 
initializeClient
 
- 
Use damage source sensitive version