类 Item
java.lang.Object
net.minecraft.world.item.Item
- 所有已实现的接口:
FeatureElement
,ItemLike
,IItemExtension
- 直接已知子类:
AirItem
,ArmorStandItem
,ArrowItem
,AxeItem
,BlockItem
,BoatItem
,BoneMealItem
,BottleItem
,BrushItem
,BucketItem
,BundleItem
,CompassItem
,CustomFluidContainerTest.CustomFluidContainer
,CustomShieldTest.CustomShieldItem
,CustomTooltipTest.CustomItemWithTooltip
,DebugStickItem
,DiscFragmentItem
,DyeItem
,EggItem
,EmptyMapItem
,EndCrystalItem
,EnderEyeItem
,EnderpearlItem
,ExperienceBottleItem
,FireChargeItem
,FireworkRocketItem
,FishingRodItem
,FlintAndSteelItem
,FoodOnAStickItem
,GlowInkSacItem
,HangingEntityItem
,HoeItem
,HoneycombItem
,InkSacItem
,InstrumentItem
,ItemUseAnimationTest.ThingItem
,KnowledgeBookItem
,LeadItem
,MaceItem
,MapItem
,MayFlyAttributeTest.InvertedTelescope
,MinecartItem
,NameTagItem
,PotionItem
,ProjectileWeaponItem
,ShearsItem
,ShieldItem
,ShovelItem
,SmithingTemplateItem
,SnowballItem
,SpawnEggItem
,SpyglassItem
,StopUsingItemTest.InvertedTelescope
,TridentItem
,WindChargeItem
,WritableBookItem
,WrittenBookItem
-
嵌套类概要
嵌套类 -
字段概要
字段修饰符和类型字段说明static final int
protected static final int
static final ResourceLocation
static final ResourceLocation
private final Holder.Reference
<Item> protected final boolean
private DataComponentMap
private final Item
static final int
protected final String
private static final org.slf4j.Logger
static final int
private final FeatureFlagSet
static final StreamCodec
<RegistryFriendlyByteBuf, Holder<Item>> 从接口继承的字段 net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void
appendHoverText
(ItemStack p_41421_, Item.TooltipContext p_339594_, TooltipDisplay p_399753_, Consumer<Component> p_399884_, TooltipFlag p_41424_) 已过时。asItem()
已过时。static Item
已过时。static Item
byId
(int p_41446_) boolean
canDestroyBlock
(ItemStack p_394530_, BlockState p_394066_, Level p_394541_, BlockPos p_394506_, LivingEntity p_394296_) boolean
finishUsingItem
(ItemStack p_41409_, Level p_41410_, LivingEntity p_41411_) float
getAttackDamageBonus
(Entity p_345249_, float p_336179_, DamageSource p_345403_) int
getBarColor
(ItemStack p_150901_) int
getBarWidth
(ItemStack p_150900_) final ItemStack
已过时。getDamageSource
(LivingEntity p_373049_) int
final String
float
getDestroySpeed
(ItemStack p_41425_, BlockState p_41426_) static int
final Component
getName()
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_, LivingEntity p_344979_) void
hurtEnemy
(ItemStack p_41395_, LivingEntity p_41396_, LivingEntity p_41397_) interactLivingEntity
(ItemStack p_41398_, Player p_41399_, LivingEntity p_41400_, InteractionHand p_41401_) void
inventoryTick
(ItemStack p_41404_, ServerLevel p_401805_, Entity p_41406_, EquipmentSlot p_401900_) boolean
isBarVisible
(ItemStack p_150899_) boolean
isCombineRepairable
(ItemStack stack) Determines if an item is repairable by combining, used by Repair recipes and Grindstone.boolean
isCorrectToolForDrops
(ItemStack p_336002_, BlockState p_41450_) boolean
boolean
mineBlock
(ItemStack p_41416_, Level p_41417_, BlockState p_41418_, BlockPos p_41419_, LivingEntity p_41420_) void
已过时。void
onCraftedBy
(ItemStack p_41447_, Player p_41449_) void
onCraftedPostProcess
(ItemStack p_307483_, Level p_307537_) void
onDestroyed
(ItemEntity p_150887_) 已过时。void
onUseTick
(Level p_41428_, LivingEntity p_41429_, ItemStack p_41430_, int p_41431_) boolean
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
postHurtEnemy
(ItemStack p_346136_, LivingEntity p_346250_, LivingEntity p_346014_) boolean
releaseUsing
(ItemStack p_41412_, Level p_41413_, LivingEntity p_41414_, int p_41415_) boolean
shouldPrintOpWarning
(ItemStack p_390446_, Player p_390503_) toString()
use
(Level p_41432_, Player p_41433_, InteractionHand p_41434_) useOn
(UseOnContext p_41427_) boolean
useOnRelease
(ItemStack p_41464_) void
verifyComponentsAfterLoad
(ItemStack p_331627_) 从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
从接口继承的方法 net.minecraft.world.flag.FeatureElement
isEnabled
从接口继承的方法 net.neoforged.neoforge.common.extensions.IItemExtension
applyEnchantments, canBeHurtBy, canContinueUsing, canEquip, canGrindstoneRepair, canPerformAction, canWalkOnPowderedSnow, createEntity, damageItem, doesSneakBypassUse, getAllEnchantments, getBurnTime, getCraftingRemainder, getCreatorModId, getDamage, getDefaultAttributeModifiers, getEnchantmentLevel, getEntityLifespan, getEquipmentSlot, getHighlightTip, getMaxDamage, getMaxStackSize, getSweepHitBox, getXpRepairRatio, hasCustomEntity, isDamageable, isDamaged, isGazeDisguise, isNotReplaceableByPickAction, isPiglinCurrency, isPrimaryItemFor, makesPiglinsNeutral, onAnimalArmorTick, onDestroyed, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onItemUseFirst, onLeftClickEntity, onStopUsing, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation, supportsEnchantment
-
字段详细资料
-
CODEC
-
STREAM_CODEC
-
LOGGER
private static final org.slf4j.Logger LOGGER -
BY_BLOCK
-
BASE_ATTACK_DAMAGE_ID
-
BASE_ATTACK_SPEED_ID
-
DEFAULT_MAX_STACK_SIZE
public static final int DEFAULT_MAX_STACK_SIZE- 另请参阅:
-
ABSOLUTE_MAX_STACK_SIZE
public static final int ABSOLUTE_MAX_STACK_SIZE- 另请参阅:
-
MAX_BAR_WIDTH
public static final int MAX_BAR_WIDTH- 另请参阅:
-
APPROXIMATELY_INFINITE_USE_DURATION
protected static final int APPROXIMATELY_INFINITE_USE_DURATION- 另请参阅:
-
builtInRegistryHolder
-
components
-
craftingRemainingItem
-
descriptionId
-
requiredFeatures
-
canCombineRepair
protected final boolean canCombineRepair
-
-
构造器详细资料
-
Item
-
-
方法详细资料
-
getId
-
byId
-
byBlock
已过时。 -
builtInRegistryHolder
已过时。 -
components
-
modifyDefaultComponentsFrom
已过时。Neo: do not use, usethe event
instead -
getDefaultMaxStackSize
public int getDefaultMaxStackSize() -
onUseTick
-
onDestroyed
已过时。 -
verifyComponentsAfterLoad
-
canDestroyBlock
public boolean canDestroyBlock(ItemStack p_394530_, BlockState p_394066_, Level p_394541_, BlockPos p_394506_, LivingEntity p_394296_) -
asItem
-
useOn
-
getDestroySpeed
-
use
-
finishUsingItem
-
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_) -
getAttackDamageBonus
-
getDamageSource
-
hurtEnemy
-
postHurtEnemy
-
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_) -
toString
-
getCraftingRemainder
已过时。 -
inventoryTick
public void inventoryTick(ItemStack p_41404_, ServerLevel p_401805_, Entity p_41406_, @Nullable EquipmentSlot p_401900_) -
onCraftedBy
-
onCraftedPostProcess
-
getUseAnimation
-
getUseDuration
-
releaseUsing
public boolean releaseUsing(ItemStack p_41412_, Level p_41413_, LivingEntity p_41414_, int p_41415_) -
appendHoverText
@Deprecated public void appendHoverText(ItemStack p_41421_, Item.TooltipContext p_339594_, TooltipDisplay p_399753_, Consumer<Component> p_399884_, TooltipFlag p_41424_) 已过时。 -
getTooltipImage
-
getDescriptionId
-
getName
-
getName
-
isFoil
-
getPlayerPOVHitResult
public static BlockHitResult getPlayerPOVHitResult(Level p_41436_, Player p_41437_, ClipContext.Fluid p_41438_) -
useOnRelease
-
isCombineRepairable
从接口复制的说明:IItemExtension
Determines if an item is repairable by combining, used by Repair recipes and Grindstone.- 指定者:
isCombineRepairable
在接口中IItemExtension
- 返回:
- True if repairable by combining
-
getDefaultInstance
-
canFitInsideContainerItems
public boolean canFitInsideContainerItems() -
requiredFeatures
- 指定者:
requiredFeatures
在接口中FeatureElement
-
shouldPrintOpWarning
-
the event
instead