类 Item
java.lang.Object
net.minecraft.world.item.Item
- 所有已实现的接口:
FeatureElement
,ItemLike
,IForgeItem
- 直接已知子类:
AirItem
,ArmorItem
,ArmorStandItem
,ArrowItem
,BannerPatternItem
,BlockItem
,BoatItem
,BoneMealItem
,BookItem
,BottleItem
,BowlFoodItem
,BrushItem
,BucketItem
,BundleItem
,ChorusFruitItem
,CompassItem
,ComplexItem
,DebugStickItem
,DiscFragmentItem
,DyeItem
,EggItem
,ElytraItem
,EnchantedBookItem
,EnchantedGoldenAppleItem
,EndCrystalItem
,EnderEyeItem
,EnderpearlItem
,ExperienceBottleItem
,FireChargeItem
,FireworkRocketItem
,FireworkStarItem
,FishingRodItem
,FlintAndSteelItem
,FoodOnAStickItem
,GlowInkSacItem
,HangingEntityItem
,HoneyBottleItem
,HoneycombItem
,HorseArmorItem
,InkSacItem
,InstrumentItem
,ItemFluidContainer
,KnowledgeBookItem
,LeadItem
,MilkBucketItem
,MinecartItem
,NameTagItem
,PotionItem
,ProjectileWeaponItem
,RecordItem
,SaddleItem
,ShearsItem
,ShieldItem
,SimpleFoiledItem
,SmithingTemplateItem
,SnowballItem
,SpawnEggItem
,SpyglassItem
,SuspiciousStewItem
,TieredItem
,TridentItem
,WritableBookItem
,WrittenBookItem
-
嵌套类概要
嵌套类 -
字段概要
字段修饰符和类型字段说明protected static final UUID
protected static final UUID
private final Holder.Reference<Item>
protected final boolean
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
private final FeatureFlagSet
从接口继承的字段 net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void
appendHoverText
(ItemStack pStack, Level pLevel, List<Component> pTooltipComponents, TooltipFlag pIsAdvanced) asItem()
已过时。static Item
已过时。static Item
byId
(int pId) boolean
canAttackBlock
(BlockState pState, Level pLevel, BlockPos pPos, Player pPlayer) boolean
boolean
canBeHurtBy
(DamageSource pDamageSource) boolean
finishUsingItem
(ItemStack pStack, Level pLevel, LivingEntity pLivingEntity) int
getBarColor
(ItemStack pStack) int
getBarWidth
(ItemStack pStack) final Item
已过时。com.google.common.collect.Multimap<Attribute,
AttributeModifier> 已过时。getDescriptionId
(ItemStack pStack) float
getDestroySpeed
(ItemStack pStack, BlockState pState) int
已过时。已过时。static int
final int
已过时。final int
已过时。protected String
protected static BlockHitResult
getPlayerPOVHitResult
(Level pLevel, Player pPlayer, ClipContext.Fluid pFluidMode) getTooltipImage
(ItemStack pStack) getUseAnimation
(ItemStack pStack) int
getUseDuration
(ItemStack pStack) boolean
已过时。boolean
hurtEnemy
(ItemStack pStack, LivingEntity pTarget, LivingEntity pAttacker) private void
void
initializeClient
(Consumer<IClientItemExtensions> consumer) interactLivingEntity
(ItemStack pStack, Player pPlayer, LivingEntity pInteractionTarget, InteractionHand pUsedHand) void
inventoryTick
(ItemStack pStack, Level pLevel, Entity pEntity, int pSlotId, boolean pIsSelected) boolean
isBarVisible
(ItemStack pStack) boolean
boolean
isCorrectToolForDrops
(BlockState pBlock) boolean
isEdible()
boolean
isEnchantable
(ItemStack pStack) boolean
boolean
boolean
isRepairable
(ItemStack stack) Called by CraftingManager to determine if an item is reparable.boolean
isValidRepairItem
(ItemStack pStack, ItemStack pRepairCandidate) boolean
mineBlock
(ItemStack pStack, Level pLevel, BlockState pState, BlockPos pPos, LivingEntity pMiningEntity) void
onCraftedBy
(ItemStack pStack, Level pLevel, Player pPlayer) void
onDestroyed
(ItemEntity pItemEntity) 已过时。void
onUseTick
(Level pLevel, LivingEntity pLivingEntity, ItemStack pStack, int pRemainingUseDuration) boolean
overrideOtherStackedOnMe
(ItemStack pStack, ItemStack pOther, Slot pSlot, ClickAction pAction, Player pPlayer, SlotAccess pAccess) boolean
overrideStackedOnOther
(ItemStack pStack, Slot pSlot, ClickAction pAction, Player pPlayer) void
releaseUsing
(ItemStack pStack, Level pLevel, LivingEntity pLivingEntity, int pTimeCharged) boolean
toString()
use
(Level pLevel, Player pPlayer, InteractionHand pUsedHand) useOn
(UseOnContext pContext) boolean
useOnRelease
(ItemStack pStack) void
从类继承的方法 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, canContinueUsing, canDisableShield, canElytraFly, canEquip, canGrindstoneRepair, canPerformAction, canWalkOnPowderedSnow, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getAllEnchantments, getArmorTexture, getAttributeModifiers, getBurnTime, getCraftingRemainingItem, getCreatorModId, getDamage, getDefaultTooltipHideFlags, getEnchantmentLevel, getEnchantmentValue, getEntityLifespan, getEquipmentSlot, getFoodProperties, getHighlightTip, getMaxDamage, getMaxStackSize, getShareTag, getSweepHitBox, getXpRepairRatio, hasCraftingRemainingItem, hasCustomEntity, initCapabilities, isBookEnchantable, isCorrectToolForDrops, isDamageable, isDamaged, isEnderMask, isNotReplaceableByPickAction, isPiglinCurrency, makesPiglinsNeutral, onArmorTick, onBlockStartBreak, onDestroyed, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onHorseArmorTick, onItemUseFirst, onLeftClickEntity, onStopUsing, readShareTag, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation
-
字段详细资料
-
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- 另请参阅:
-
EAT_DURATION
public static final int EAT_DURATION- 另请参阅:
-
MAX_BAR_WIDTH
public static final int MAX_BAR_WIDTH- 另请参阅:
-
builtInRegistryHolder
-
rarity
-
maxStackSize
private final int maxStackSize -
maxDamage
private final int maxDamage -
isFireResistant
private final boolean isFireResistant -
craftingRemainingItem
-
descriptionId
-
foodProperties
-
requiredFeatures
-
canRepair
protected final boolean canRepair -
renderProperties
-
-
构造器详细资料
-
Item
-
-
方法详细资料
-
getId
-
byId
-
byBlock
已过时。 -
builtInRegistryHolder
已过时。 -
onUseTick
public void onUseTick(Level pLevel, LivingEntity pLivingEntity, ItemStack pStack, int pRemainingUseDuration) -
onDestroyed
已过时。 -
verifyTagAfterLoad
-
canAttackBlock
-
asItem
-
useOn
-
getDestroySpeed
-
use
public InteractionResultHolder<ItemStack> use(Level pLevel, Player pPlayer, InteractionHand pUsedHand) -
finishUsingItem
-
getMaxStackSize
已过时。 -
getMaxDamage
已过时。 -
canBeDepleted
public boolean canBeDepleted() -
isBarVisible
-
getBarWidth
-
getBarColor
-
overrideStackedOnOther
public boolean overrideStackedOnOther(ItemStack pStack, Slot pSlot, ClickAction pAction, Player pPlayer) -
overrideOtherStackedOnMe
public boolean overrideOtherStackedOnMe(ItemStack pStack, ItemStack pOther, Slot pSlot, ClickAction pAction, Player pPlayer, SlotAccess pAccess) -
hurtEnemy
-
mineBlock
public boolean mineBlock(ItemStack pStack, Level pLevel, BlockState pState, BlockPos pPos, LivingEntity pMiningEntity) -
isCorrectToolForDrops
-
interactLivingEntity
public InteractionResult interactLivingEntity(ItemStack pStack, Player pPlayer, LivingEntity pInteractionTarget, InteractionHand pUsedHand) -
getDescription
-
toString
-
getOrCreateDescriptionId
-
getDescriptionId
-
getDescriptionId
-
shouldOverrideMultiplayerNbt
public boolean shouldOverrideMultiplayerNbt() -
getCraftingRemainingItem
已过时。 -
hasCraftingRemainingItem
已过时。 -
inventoryTick
-
onCraftedBy
-
isComplex
public boolean isComplex() -
getUseAnimation
-
getUseDuration
-
releaseUsing
public void releaseUsing(ItemStack pStack, Level pLevel, LivingEntity pLivingEntity, int pTimeCharged) -
appendHoverText
public void appendHoverText(ItemStack pStack, @Nullable Level pLevel, List<Component> pTooltipComponents, TooltipFlag pIsAdvanced) -
getTooltipImage
-
getName
-
isFoil
-
getRarity
-
isEnchantable
-
getPlayerPOVHitResult
protected static BlockHitResult getPlayerPOVHitResult(Level pLevel, Player pPlayer, ClipContext.Fluid pFluidMode) -
getEnchantmentValue
已过时。Forge: Use ItemStack sensitive version. -
isValidRepairItem
-
getDefaultAttributeModifiers
@Deprecated public com.google.common.collect.Multimap<Attribute,AttributeModifier> getDefaultAttributeModifiers(EquipmentSlot pSlot) 已过时。 -
isRepairable
从接口复制的说明:IForgeItem
Called by CraftingManager to determine if an item is reparable.- 指定者:
isRepairable
在接口中IForgeItem
- 返回:
- True if reparable
-
useOnRelease
-
getDefaultInstance
-
isEdible
public boolean isEdible() -
getFoodProperties
已过时。 -
getDrinkingSound
-
getEatingSound
-
isFireResistant
public boolean isFireResistant() -
canBeHurtBy
-
canFitInsideContainerItems
public boolean canFitInsideContainerItems() -
requiredFeatures
- 指定者:
requiredFeatures
在接口中FeatureElement
-
getRenderPropertiesInternal
-
initClient
private void initClient() -
initializeClient
-
Use damage source sensitive version