Package net.minecraft.world.item
Class Item
- All Implemented Interfaces:
ItemLike
,IForgeItem
,IForgeRegistryEntry<Item>
- Direct Known Subclasses:
AirItem
,ArmorItem
,ArmorStandItem
,ArrowItem
,BannerPatternItem
,BlockItem
,BoatItem
,BoneMealItem
,BookItem
,BottleItem
,BowlFoodItem
,BucketItem
,BundleItem
,ChorusFruitItem
,CompassItem
,ComplexItem
,CustomElytraTest.CustomElytra
,CustomShieldTest.CustomShieldItem
,CustomTooltipTest.CustomItemWithTooltip
,DebugStickItem
,DyeItem
,EggItem
,ElytraItem
,EnchantedBookItem
,EnchantedGoldenAppleItem
,EndCrystalItem
,EnderEyeItem
,EnderpearlItem
,ExperienceBottleItem
,FireChargeItem
,FireworkRocketItem
,FireworkStarItem
,FishingRodItem
,FlintAndSteelItem
,FoodOnAStickItem
,GravityAttributeTest.ItemGravityStick
,HangingEntityItem
,HiddenTooltipPartsTest.TestItem
,HoneyBottleItem
,HoneycombItem
,HorseArmorItem
,ItemFluidContainer
,KnowledgeBookItem
,LeadItem
,MilkBucketItem
,MinecartItem
,NameTagItem
,PotionItem
,ProjectileWeaponItem
,RecordItem
,SaddleItem
,ShearsItem
,ShieldItem
,SimpleFoiledItem
,SnowballItem
,SpawnEggItem
,SpyglassItem
,SuspiciousStewItem
,TieredItem
,TridentItem
,WritableBookItem
,WrittenBookItem
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.registries.ForgeRegistryEntry
ForgeRegistryEntry.UncheckedRegistryEntry<V extends IForgeRegistryEntry<V>>
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final UUID
protected static final UUID
private final Holder.Reference<Item>
protected final boolean
protected final CreativeModeTab
private final Item
private String
static final int
private final FoodProperties
private final boolean
private static final org.slf4j.Logger
static final int
static final int
private final int
private final int
private final Rarity
private Object
Fields inherited from class net.minecraftforge.registries.ForgeRegistryEntry
delegate
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
allowdedIn
(CreativeModeTab p_41390_) void
appendHoverText
(ItemStack p_41421_, Level p_41422_, List<Component> p_41423_, TooltipFlag p_41424_) asItem()
Deprecated.static Item
Deprecated.static Item
byId
(int p_41446_) boolean
canAttackBlock
(BlockState p_41441_, Level p_41442_, BlockPos p_41443_, Player p_41444_) boolean
boolean
canBeHurtBy
(DamageSource p_41387_) boolean
void
fillItemCategory
(CreativeModeTab p_41391_, NonNullList<ItemStack> p_41392_) finishUsingItem
(ItemStack p_41409_, Level p_41410_, LivingEntity p_41411_) int
getBarColor
(ItemStack p_150901_) int
getBarWidth
(ItemStack p_150900_) final Item
Deprecated.com.google.common.collect.Multimap<Attribute,
AttributeModifier> getDefaultAttributeModifiers
(EquipmentSlot p_41388_) Deprecated.getDescriptionId
(ItemStack p_41455_) float
getDestroySpeed
(ItemStack p_41425_, BlockState p_41426_) int
Deprecated.static int
final CreativeModeTab
final int
Deprecated.final int
Deprecated.protected String
protected static BlockHitResult
getPlayerPOVHitResult
(Level p_41436_, Player p_41437_, ClipContext.Fluid p_41438_) getTooltipImage
(ItemStack p_150902_) getUseAnimation
(ItemStack p_41452_) int
getUseDuration
(ItemStack p_41454_) boolean
Deprecated.boolean
hurtEnemy
(ItemStack p_41395_, LivingEntity p_41396_, LivingEntity p_41397_) private void
void
initializeClient
(Consumer<IItemRenderProperties> consumer) interactLivingEntity
(ItemStack p_41398_, Player p_41399_, LivingEntity p_41400_, InteractionHand p_41401_) void
inventoryTick
(ItemStack p_41404_, Level p_41405_, Entity p_41406_, int p_41407_, boolean p_41408_) boolean
isBarVisible
(ItemStack p_150899_) boolean
boolean
isCorrectToolForDrops
(BlockState p_41450_) boolean
isEdible()
boolean
isEnchantable
(ItemStack p_41456_) boolean
boolean
boolean
isRepairable
(ItemStack stack) Called by CraftingManager to determine if an item is reparable.boolean
isValidRepairItem
(ItemStack p_41402_, ItemStack p_41403_) boolean
mineBlock
(ItemStack p_41416_, Level p_41417_, BlockState p_41418_, BlockPos p_41419_, LivingEntity p_41420_) void
onCraftedBy
(ItemStack p_41447_, Level p_41448_, Player p_41449_) void
onDestroyed
(ItemEntity p_150887_) void
onUseTick
(Level p_41428_, LivingEntity p_41429_, ItemStack p_41430_, int p_41431_) Deprecated.Forge: Use damage source sensitive versionboolean
overrideOtherStackedOnMe
(ItemStack p_150892_, ItemStack p_150893_, Slot p_150894_, ClickAction p_150895_, Player p_150896_, SlotAccess p_150897_) boolean
overrideStackedOnOther
(ItemStack p_150888_, Slot p_150889_, ClickAction p_150890_, Player p_150891_) void
releaseUsing
(ItemStack p_41412_, Level p_41413_, LivingEntity p_41414_, int p_41415_) boolean
toString()
use
(Level p_41432_, Player p_41433_, InteractionHand p_41434_) useOn
(UseOnContext p_41427_) boolean
useOnRelease
(ItemStack p_41464_) void
verifyTagAfterLoad
(CompoundTag p_150898_) Methods inherited from class net.minecraftforge.registries.ForgeRegistryEntry
getRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraftforge.common.extensions.IForgeItem
canApplyAtEnchantingTable, canContinueUsing, canDisableShield, canElytraFly, canEquip, canPerformAction, canWalkOnPowderedSnow, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getArmorTexture, getAttributeModifiers, getBurnTime, getContainerItem, getCreativeTabs, getCreatorModId, getDamage, getDefaultTooltipHideFlags, getEntityLifespan, getEquipmentSlot, getFoodProperties, getHighlightTip, getItemEnchantability, getItemStackLimit, getMaxDamage, getShareTag, getSweepHitBox, getXpRepairRatio, hasContainerItem, hasCustomEntity, initCapabilities, isBookEnchantable, isCorrectToolForDrops, isDamageable, isDamaged, isEnderMask, isPiglinCurrency, makesPiglinsNeutral, onArmorTick, onBlockStartBreak, onDestroyed, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onHorseArmorTick, onItemUseFirst, onLeftClickEntity, onUsingTick, readShareTag, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
BY_BLOCK
-
BASE_ATTACK_DAMAGE_UUID
-
BASE_ATTACK_SPEED_UUID
-
MAX_STACK_SIZE
public static final int MAX_STACK_SIZE- See Also:
-
EAT_DURATION
public static final int EAT_DURATION- See Also:
-
MAX_BAR_WIDTH
public static final int MAX_BAR_WIDTH- See Also:
-
builtInRegistryHolder
-
category
-
rarity
-
maxStackSize
private final int maxStackSize -
maxDamage
private final int maxDamage -
isFireResistant
private final boolean isFireResistant -
craftingRemainingItem
-
descriptionId
-
foodProperties
-
canRepair
protected final boolean canRepair -
renderProperties
-
-
Constructor Details
-
Item
-
-
Method Details
-
getId
-
byId
-
byBlock
Deprecated. -
builtInRegistryHolder
Deprecated. -
onUseTick
@Deprecated public void onUseTick(Level p_41428_, LivingEntity p_41429_, ItemStack p_41430_, int p_41431_) Deprecated.Forge: Use damage source sensitive version -
onDestroyed
-
verifyTagAfterLoad
-
canAttackBlock
public boolean canAttackBlock(BlockState p_41441_, Level p_41442_, BlockPos p_41443_, Player p_41444_) -
asItem
-
useOn
-
getDestroySpeed
-
use
public InteractionResultHolder<ItemStack> use(Level p_41432_, Player p_41433_, InteractionHand p_41434_) -
finishUsingItem
-
getMaxStackSize
Deprecated. -
getMaxDamage
Deprecated. -
canBeDepleted
public boolean canBeDepleted() -
isBarVisible
-
getBarWidth
-
getBarColor
-
overrideStackedOnOther
public boolean overrideStackedOnOther(ItemStack p_150888_, Slot p_150889_, ClickAction p_150890_, Player p_150891_) -
overrideOtherStackedOnMe
public boolean overrideOtherStackedOnMe(ItemStack p_150892_, ItemStack p_150893_, Slot p_150894_, ClickAction p_150895_, Player p_150896_, SlotAccess p_150897_) -
hurtEnemy
-
mineBlock
public boolean mineBlock(ItemStack p_41416_, Level p_41417_, BlockState p_41418_, BlockPos p_41419_, LivingEntity p_41420_) -
isCorrectToolForDrops
-
interactLivingEntity
public InteractionResult interactLivingEntity(ItemStack p_41398_, Player p_41399_, LivingEntity p_41400_, InteractionHand p_41401_) -
getDescription
-
toString
-
getOrCreateDescriptionId
-
getDescriptionId
-
getDescriptionId
-
shouldOverrideMultiplayerNbt
public boolean shouldOverrideMultiplayerNbt() -
getCraftingRemainingItem
Deprecated. -
hasCraftingRemainingItem
Deprecated. -
inventoryTick
-
onCraftedBy
-
isComplex
public boolean isComplex() -
getUseAnimation
-
getUseDuration
-
releaseUsing
-
appendHoverText
public void appendHoverText(ItemStack p_41421_, @Nullable Level p_41422_, List<Component> p_41423_, TooltipFlag p_41424_) -
getTooltipImage
-
getName
-
isFoil
-
getRarity
-
isEnchantable
-
getPlayerPOVHitResult
protected static BlockHitResult getPlayerPOVHitResult(Level p_41436_, Player p_41437_, ClipContext.Fluid p_41438_) -
getEnchantmentValue
public int getEnchantmentValue() -
fillItemCategory
-
allowdedIn
-
getItemCategory
-
isValidRepairItem
-
getDefaultAttributeModifiers
@Deprecated public com.google.common.collect.Multimap<Attribute,AttributeModifier> getDefaultAttributeModifiers(EquipmentSlot p_41388_) Deprecated. -
isRepairable
Description copied from interface:IForgeItem
Called by CraftingManager to determine if an item is reparable.- Specified by:
isRepairable
in interfaceIForgeItem
- Returns:
- True if reparable
-
useOnRelease
-
getDefaultInstance
-
isEdible
public boolean isEdible() -
getFoodProperties
Deprecated. -
getDrinkingSound
-
getEatingSound
-
isFireResistant
public boolean isFireResistant() -
canBeHurtBy
-
getEquipSound
-
canFitInsideContainerItems
public boolean canFitInsideContainerItems() -
getRenderPropertiesInternal
-
initClient
private void initClient() -
initializeClient
-