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 ClassesNested classes/interfaces inherited from class net.minecraftforge.registries.ForgeRegistryEntry
ForgeRegistryEntry.UncheckedRegistryEntry<V extends IForgeRegistryEntry<V>> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final UUIDprotected static final UUIDprotected final booleanprotected final ItemGroupprivate final Itemprivate Stringprivate final Foodprivate final booleanprivate final Supplier<ItemStackTileEntityRenderer>private final intprivate final intprotected static final Randomprivate final Rarityprivate final ReverseTagWrapper<Item>Fields inherited from class net.minecraftforge.registries.ForgeRegistryEntry
delegate -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanallowdedIn(ItemGroup p_194125_1_) voidappendHoverText(ItemStack p_77624_1_, World p_77624_2_, List<ITextComponent> p_77624_3_, ITooltipFlag p_77624_4_) asItem()static ItemDeprecated.static ItembyId(int p_150899_0_) booleancanAttackBlock(BlockState p_195938_1_, World p_195938_2_, BlockPos p_195938_3_, PlayerEntity p_195938_4_) booleanbooleancanBeHurtBy(DamageSource p_234685_1_) voidfillItemCategory(ItemGroup p_150895_1_, NonNullList<ItemStack> p_150895_2_) finishUsingItem(ItemStack p_77654_1_, World p_77654_2_, LivingEntity p_77654_3_) final ItemDeprecated.com.google.common.collect.Multimap<Attribute,AttributeModifier> getDefaultAttributeModifiers(EquipmentSlotType p_111205_1_) Deprecated.getDescriptionId(ItemStack p_77667_1_) floatgetDestroySpeed(ItemStack p_150893_1_, BlockState p_150893_2_) intintgetHarvestLevel(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 intfinal ItemGroupfinal intDeprecated.final intDeprecated.protected Stringprotected static BlockRayTraceResultgetPlayerPOVHitResult(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_) intgetUseDuration(ItemStack p_77626_1_) booleanDeprecated.booleanhurtEnemy(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_) voidinventoryTick(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) booleanbooleanbooleanisCorrectToolForDrops(BlockState p_150897_1_) booleanisEdible()booleanisEnchantable(ItemStack p_77616_1_) booleanbooleanbooleanisRepairable(ItemStack stack) Called by CraftingManager to determine if an item is reparable.booleanisValidRepairItem(ItemStack p_82789_1_, ItemStack p_82789_2_) booleanmineBlock(ItemStack p_179218_1_, World p_179218_2_, BlockState p_179218_3_, BlockPos p_179218_4_, LivingEntity p_179218_5_) voidonCraftedBy(ItemStack p_77622_1_, World p_77622_2_, PlayerEntity p_77622_3_) voidonUseTick(World p_219972_1_, LivingEntity p_219972_2_, ItemStack p_219972_3_, int p_219972_4_) voidreleaseUsing(ItemStack p_77615_1_, World p_77615_2_, LivingEntity p_77615_3_, int p_77615_4_) booleantoString()use(World p_77659_1_, PlayerEntity p_77659_2_, Hand p_77659_3_) useOn(ItemUseContext p_195939_1_) booleanuseOnRelease(ItemStack p_219970_1_) booleanverifyTagAfterLoad(CompoundNBT p_179215_1_) Methods inherited from class net.minecraftforge.registries.ForgeRegistryEntry
getRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
asItemin 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:IForgeItemCalled by CraftingManager to determine if an item is reparable.- Specified by:
isRepairablein interfaceIForgeItem- Returns:
- True if reparable
-
getToolTypes
- Specified by:
getToolTypesin interfaceIForgeItem
-
getHarvestLevel
public int getHarvestLevel(ItemStack stack, ToolType tool, @Nullable PlayerEntity player, @Nullable BlockState blockState) Description copied from interface:IForgeItemQueries 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:
getHarvestLevelin 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:
getItemStackTileEntityRendererin interfaceIForgeItem- Returns:
- This Item's renderer, or the default instance if it does not have one.
-
getTags
Description copied from interface:IForgeItemRetrieves 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:
getTagsin interfaceIForgeItem
-
useOnRelease
-
getDefaultInstance
-
is
-
isEdible
public boolean isEdible() -
getFoodProperties
-
getDrinkingSound
-
getEatingSound
-
isFireResistant
public boolean isFireResistant() -
canBeHurtBy
-