类 Item
java.lang.Object
net.minecraft.world.item.Item
- 所有已实现的接口:
FeatureElement
,ItemLike
,IForgeItem
- 直接已知子类:
AirItem
,AnimalArmorItem
,ArmorItem
,ArmorStandItem
,ArrowItem
,BannerPatternItem
,BlockItem
,BoatItem
,BoneMealItem
,BottleItem
,BrushItem
,BucketItem
,BundleItem
,CompassItem
,DebugStickItem
,DiggerItem
,DiscFragmentItem
,DyeItem
,EggItem
,EmptyMapItem
,EndCrystalItem
,EnderEyeItem
,EnderpearlItem
,ExperienceBottleItem
,FireChargeItem
,FireworkRocketItem
,FireworkStarItem
,FishingRodItem
,FlintAndSteelItem
,FoodOnAStickItem
,GlowInkSacItem
,HangingEntityItem
,HoneycombItem
,InkSacItem
,InstrumentItem
,KnowledgeBookItem
,LeadItem
,MaceItem
,MapItem
,MinecartItem
,NameTagItem
,PotionItem
,ProjectileWeaponItem
,SaddleItem
,ShearsItem
,ShieldItem
,SmithingTemplateItem
,SnowballItem
,SpawnEggItem
,SpyglassItem
,SwordItem
,TridentItem
,WindChargeItem
,WritableBookItem
,WrittenBookItem
-
嵌套类概要
嵌套类 -
字段概要
字段修饰符和类型字段说明static final int
static final ResourceLocation
static final ResourceLocation
private DataComponentMap
private final Holder.Reference
<Item> private final DataComponentMap
private final Item
static final int
protected final String
private static final org.slf4j.Logger
static final int
private Object
private final FeatureFlagSet
static final StreamCodec
<RegistryFriendlyByteBuf, Holder<Item>> 从接口继承的字段 net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void
appendHoverText
(ItemStack p_41421_, Item.TooltipContext p_333372_, List<Component> p_41423_, TooltipFlag p_41424_) asItem()
已过时。static Item
已过时。static Item
byId
(int p_41446_) boolean
canAttackBlock
(BlockState p_41441_, Level p_41442_, BlockPos p_41443_, Player p_41444_) boolean
finishUsingItem
(ItemStack p_41409_, Level p_41410_, LivingEntity p_41411_) float
getAttackDamageBonus
(Entity p_345227_, float p_327880_, DamageSource p_342960_) int
getBarColor
(ItemStack p_150901_) int
getBarWidth
(ItemStack p_150900_) final ItemStack
已过时。getDamageSource
(LivingEntity p_363041_) int
final String
float
getDestroySpeed
(ItemStack p_41425_, BlockState p_41426_) static int
final Component
getName()
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_, LivingEntity p_342054_) boolean
hurtEnemy
(ItemStack p_41395_, LivingEntity p_41396_, LivingEntity p_41397_) private void
void
initializeClient
(Consumer<IClientItemExtensions> 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
isCorrectToolForDrops
(ItemStack p_332232_, BlockState p_41450_) boolean
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
onCraftedPostProcess
(ItemStack p_312780_, Level p_312645_) 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_343373_, LivingEntity p_342300_, LivingEntity p_344220_) boolean
releaseUsing
(ItemStack p_41412_, Level p_41413_, LivingEntity p_41414_, int p_41415_) boolean
shouldPrintOpWarning
(ItemStack p_377756_, Player p_376409_) toString()
use
(Level p_41432_, Player p_41433_, InteractionHand p_41434_) useOn
(UseOnContext p_41427_) boolean
useOnRelease
(ItemStack p_41464_) void
verifyComponentsAfterLoad
(ItemStack p_336236_) 从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
从接口继承的方法 net.minecraft.world.flag.FeatureElement
isEnabled
从接口继承的方法 net.minecraftforge.common.extensions.IForgeItem
canApplyAtEnchantingTable, canApplyAtEnchantingTable, canContinueUsing, canDisableShield, canElytraFly, canEquip, canGrindstoneRepair, canPerformAction, canWalkOnPowderedSnow, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getBurnTime, getCapabilityProvider, getCapabilityProvider, getCraftingRemainder, getCreatorModId, getDefaultTooltipHideFlags, getEntityLifespan, getEquipmentSlot, getHighlightTip, getSweepHitBox, hasCustomEntity, isBookEnchantable, isMonsterDisguise, isNotReplaceableByPickAction, isPiglinCurrency, makesPiglinsNeutral, onBlockStartBreak, onDestroyed, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onHorseArmorTick, onInventoryTick, onItemUseFirst, onLeftClickEntity, onStopUsing, shouldCauseBlockBreakReset, shouldCauseReequipAnimation
-
字段详细资料
-
CODEC
-
LOGGER
private static final org.slf4j.Logger LOGGER -
STREAM_CODEC
-
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- 另请参阅:
-
builtInRegistryHolder
-
components
-
craftingRemainingItem
-
descriptionId
-
requiredFeatures
-
builtComponents
-
renderProperties
-
-
构造器详细资料
-
Item
-
-
方法详细资料
-
getId
-
byId
-
byBlock
已过时。 -
builtInRegistryHolder
已过时。 -
components
-
getDefaultMaxStackSize
public int getDefaultMaxStackSize() -
onUseTick
-
onDestroyed
已过时。 -
verifyComponentsAfterLoad
-
canAttackBlock
public boolean canAttackBlock(BlockState p_41441_, Level p_41442_, BlockPos p_41443_, Player p_41444_) -
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
已过时。Forge: useIForgeItemStack.getCraftingRemainder()
. -
inventoryTick
-
onCraftedBy
-
onCraftedPostProcess
-
getUseAnimation
-
getUseDuration
-
releaseUsing
public boolean releaseUsing(ItemStack p_41412_, Level p_41413_, LivingEntity p_41414_, int p_41415_) -
appendHoverText
public void appendHoverText(ItemStack p_41421_, Item.TooltipContext p_333372_, List<Component> p_41423_, TooltipFlag p_41424_) -
getTooltipImage
-
getDescriptionId
-
getName
-
getName
-
isFoil
-
getPlayerPOVHitResult
protected static BlockHitResult getPlayerPOVHitResult(Level p_41436_, Player p_41437_, ClipContext.Fluid p_41438_) -
useOnRelease
-
getDefaultInstance
-
getBreakingSound
-
canFitInsideContainerItems
public boolean canFitInsideContainerItems() -
requiredFeatures
- 指定者:
requiredFeatures
在接口中FeatureElement
-
shouldPrintOpWarning
-
getRenderPropertiesInternal
-
initClient
private void initClient() -
initializeClient
-
Use damage source sensitive version