Package net.minecraft.item
Class Item
- All Implemented Interfaces:
IItemProvider
,IForgeItem
,IForgeRegistryEntry<Item>
- Direct Known Subclasses:
AbstractMapItem
,AirItem
,ArmorItem
,ArmorStandItem
,ArrowItem
,BannerPatternItem
,BlockItem
,BoatItem
,BoneMealItem
,BookItem
,BucketItem
,ChorusFruitItem
,CompassItem
,CustomElytraTest.CustomElytra
,DebugStickItem
,DyeItem
,EggItem
,ElytraItem
,EnchantedBookItem
,EnchantedGoldenAppleItem
,EnderCrystalItem
,EnderEyeItem
,EnderPearlItem
,ExperienceBottleItem
,FireChargeItem
,FireworkRocketItem
,FireworkStarItem
,FishingRodItem
,FlintAndSteelItem
,GlassBottleItem
,GravityAttributeTest.ItemGravityStick
,HangingEntityItem
,HoneyBottleItem
,HorseArmorItem
,ItemFluidContainer
,KnowledgeBookItem
,LeadItem
,MilkBucketItem
,MinecartItem
,MusicDiscItem
,NameTagItem
,OnAStickItem
,PotionItem
,SaddleItem
,ShearsItem
,ShieldItem
,ShootableItem
,SimpleFoiledItem
,SnowballItem
,SoupItem
,SpawnEggItem
,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
protected final boolean
protected final ItemGroup
private final Item
private String
private final Food
private final boolean
private final Supplier<ItemStackTileEntityRenderer>
private final int
private final int
protected static final Random
private final Rarity
private final ReverseTagWrapper<Item>
Fields inherited from class net.minecraftforge.registries.ForgeRegistryEntry
delegate
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
allowdedIn
(ItemGroup p_194125_1_) void
appendHoverText
(ItemStack p_77624_1_, World p_77624_2_, List<ITextComponent> p_77624_3_, ITooltipFlag p_77624_4_) asItem()
static Item
Deprecated.static Item
byId
(int p_150899_0_) boolean
canAttackBlock
(BlockState p_195938_1_, World p_195938_2_, BlockPos p_195938_3_, PlayerEntity p_195938_4_) boolean
boolean
canBeHurtBy
(DamageSource p_234685_1_) void
fillItemCategory
(ItemGroup p_150895_1_, NonNullList<ItemStack> p_150895_2_) finishUsingItem
(ItemStack p_77654_1_, World p_77654_2_, LivingEntity p_77654_3_) final Item
Deprecated.com.google.common.collect.Multimap<Attribute,
AttributeModifier> getDefaultAttributeModifiers
(EquipmentSlotType p_111205_1_) Deprecated.getDescriptionId
(ItemStack p_77667_1_) float
getDestroySpeed
(ItemStack p_150893_1_, BlockState p_150893_2_) int
int
getHarvestLevel
(ItemStack stack, ToolType tool, PlayerEntity player, BlockState blockState) Queries the harvest level of this item stack for the specified tool class, Returns -1 if this tool is not of the specified typestatic int
final ItemGroup
final int
Deprecated.final int
Deprecated.protected String
protected static BlockRayTraceResult
getPlayerPOVHitResult
(World p_219968_0_, PlayerEntity p_219968_1_, RayTraceContext.FluidMode p_219968_2_) getTags()
Retrieves a list of tags names this is known to be associated with.getToolTypes
(ItemStack stack) getUseAnimation
(ItemStack p_77661_1_) int
getUseDuration
(ItemStack p_77626_1_) boolean
Deprecated.boolean
hurtEnemy
(ItemStack p_77644_1_, LivingEntity p_77644_2_, LivingEntity p_77644_3_) interactLivingEntity
(ItemStack p_111207_1_, PlayerEntity p_111207_2_, LivingEntity p_111207_3_, Hand p_111207_4_) void
inventoryTick
(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) boolean
boolean
boolean
isCorrectToolForDrops
(BlockState p_150897_1_) boolean
isEdible()
boolean
isEnchantable
(ItemStack p_77616_1_) boolean
boolean
boolean
isRepairable
(ItemStack stack) Called by CraftingManager to determine if an item is reparable.boolean
isValidRepairItem
(ItemStack p_82789_1_, ItemStack p_82789_2_) boolean
mineBlock
(ItemStack p_179218_1_, World p_179218_2_, BlockState p_179218_3_, BlockPos p_179218_4_, LivingEntity p_179218_5_) void
onCraftedBy
(ItemStack p_77622_1_, World p_77622_2_, PlayerEntity p_77622_3_) void
onUseTick
(World p_219972_1_, LivingEntity p_219972_2_, ItemStack p_219972_3_, int p_219972_4_) void
releaseUsing
(ItemStack p_77615_1_, World p_77615_2_, LivingEntity p_77615_3_, int p_77615_4_) boolean
toString()
use
(World p_77659_1_, PlayerEntity p_77659_2_, Hand p_77659_3_) useOn
(ItemUseContext p_195939_1_) boolean
useOnRelease
(ItemStack p_219970_1_) boolean
verifyTagAfterLoad
(CompoundNBT p_179215_1_) 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, canHarvestBlock, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getArmorModel, getArmorTexture, getAttributeModifiers, getBurnTime, getBurnTime, getContainerItem, getCreativeTabs, getCreatorModId, getDamage, getDurabilityForDisplay, getEntityLifespan, getEquipmentSlot, getFontRenderer, getHighlightTip, getItem, getItemEnchantability, getItemStackLimit, getMaxDamage, getRGBDurabilityForDisplay, getShareTag, getSmeltingExperience, getXpRepairRatio, hasContainerItem, hasCustomEntity, initCapabilities, isBookEnchantable, isDamageable, isDamaged, isEnderMask, isPiglinCurrency, isShield, makesPiglinsNeutral, onArmorTick, onBlockStartBreak, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onHorseArmorTick, onItemUseFirst, onLeftClickEntity, onUsingTick, readShareTag, renderHelmetOverlay, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation, showDurabilityBar
-
Field Details
-
BY_BLOCK
-
BASE_ATTACK_DAMAGE_UUID
-
BASE_ATTACK_SPEED_UUID
-
random
-
category
-
rarity
-
maxStackSize
private final int maxStackSize -
maxDamage
private final int maxDamage -
isFireResistant
private final boolean isFireResistant -
craftingRemainingItem
-
descriptionId
-
foodProperties
-
ister
-
toolClasses
-
reverseTags
-
canRepair
protected final boolean canRepair
-
-
Constructor Details
-
Item
-
-
Method Details
-
getId
-
byId
-
byBlock
Deprecated. -
onUseTick
public void onUseTick(World p_219972_1_, LivingEntity p_219972_2_, ItemStack p_219972_3_, int p_219972_4_) -
verifyTagAfterLoad
-
canAttackBlock
public boolean canAttackBlock(BlockState p_195938_1_, World p_195938_2_, BlockPos p_195938_3_, PlayerEntity p_195938_4_) -
asItem
- Specified by:
asItem
in interfaceIItemProvider
-
useOn
-
getDestroySpeed
-
use
-
finishUsingItem
-
getMaxStackSize
Deprecated. -
getMaxDamage
Deprecated. -
canBeDepleted
public boolean canBeDepleted() -
hurtEnemy
-
mineBlock
public boolean mineBlock(ItemStack p_179218_1_, World p_179218_2_, BlockState p_179218_3_, BlockPos p_179218_4_, LivingEntity p_179218_5_) -
isCorrectToolForDrops
-
interactLivingEntity
public ActionResultType interactLivingEntity(ItemStack p_111207_1_, PlayerEntity p_111207_2_, LivingEntity p_111207_3_, Hand p_111207_4_) -
getDescription
-
toString
-
getOrCreateDescriptionId
-
getDescriptionId
-
getDescriptionId
-
shouldOverrideMultiplayerNbt
public boolean shouldOverrideMultiplayerNbt() -
getCraftingRemainingItem
Deprecated. -
hasCraftingRemainingItem
Deprecated. -
inventoryTick
-
onCraftedBy
-
isComplex
public boolean isComplex() -
getUseAnimation
-
getUseDuration
-
releaseUsing
public void releaseUsing(ItemStack p_77615_1_, World p_77615_2_, LivingEntity p_77615_3_, int p_77615_4_) -
appendHoverText
public void appendHoverText(ItemStack p_77624_1_, @Nullable World p_77624_2_, List<ITextComponent> p_77624_3_, ITooltipFlag p_77624_4_) -
getName
-
isFoil
-
getRarity
-
isEnchantable
-
getPlayerPOVHitResult
protected static BlockRayTraceResult getPlayerPOVHitResult(World p_219968_0_, PlayerEntity p_219968_1_, RayTraceContext.FluidMode p_219968_2_) -
getEnchantmentValue
public int getEnchantmentValue() -
fillItemCategory
-
allowdedIn
-
getItemCategory
-
isValidRepairItem
-
getDefaultAttributeModifiers
@Deprecated public com.google.common.collect.Multimap<Attribute,AttributeModifier> getDefaultAttributeModifiers(EquipmentSlotType p_111205_1_) 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
-
getToolTypes
- Specified by:
getToolTypes
in interfaceIForgeItem
-
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 interfaceIForgeItem
- Parameters:
stack
- This item stack instanceplayer
- The player trying to harvest the given blockstateblockState
- The block to harvest- Returns:
- Harvest level, or -1 if not the specified tool type.
-
getItemStackTileEntityRenderer
- Specified by:
getItemStackTileEntityRenderer
in interfaceIForgeItem
- Returns:
- This Item's renderer, or the default instance if it does not have one.
-
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 interfaceIForgeItem
-
useOnRelease
-
getDefaultInstance
-
is
-
isEdible
public boolean isEdible() -
getFoodProperties
-
getDrinkingSound
-
getEatingSound
-
isFireResistant
public boolean isFireResistant() -
canBeHurtBy
-