类 ItemStack
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<ItemStack>
net.minecraft.world.item.ItemStack
- 所有已实现的接口:
ICapabilityProvider
,ICapabilityProviderImpl<ItemStack>
,ICapabilitySerializable<CompoundTag>
,IForgeItemStack
,INBTSerializable<CompoundTag>
-
嵌套类概要
嵌套类从类继承的嵌套类/接口 net.minecraftforge.common.capabilities.CapabilityProvider
CapabilityProvider.AsField<B extends ICapabilityProviderImpl<B>>
-
字段概要
字段修饰符和类型字段说明private AdventureModeCheck
private AdventureModeCheck
static final DecimalFormat
private CompoundTag
static final com.mojang.serialization.Codec<ItemStack>
private int
private final Holder.Reference<Item>
private static final Component
private static final int
static final ItemStack
private Entity
private final Item
已过时。private static final org.slf4j.Logger
private static final Style
private int
private CompoundTag
private static final String
private static final String
static final String
static final String
static final String
static final String
static final String
private static final String
static final String
private static final String
private static final String
-
构造器概要
构造器限定符构造器说明private
private
ItemStack
(CompoundTag pCompoundTag) private
ItemStack
(ItemLike p_41604_, int p_41605_, Optional<CompoundTag> p_41606_) ItemStack
(ItemLike p_41604_, int p_41605_, CompoundTag p_41606_) -
方法概要
修饰符和类型方法说明void
addAttributeModifier
(Attribute pAttribute, AttributeModifier pModifier, EquipmentSlot pSlot) void
addTagElement
(String pKey, Tag pTag) static void
appendEnchantmentNames
(List<Component> pTooltipComponents, ListTag pStoredEnchantments) copy()
copyWithCount
(int pCount) void
void
enchant
(Enchantment pEnchantment, int pLevel) private static Collection<Component>
expandBlockState
(String pStateString) finishUsingItem
(Level pLevel, LivingEntity pLivingEntity) private void
Set up forge's ItemStack additions.com.google.common.collect.Multimap<Attribute,
AttributeModifier> int
int
int
int
getCount()
int
float
getDestroySpeed
(BlockState pState) getFrame()
private int
getItem()
int
int
getOrCreateTagElement
(String pKey) int
getTag()
getTagElement
(String pKey) getTags()
getTooltipLines
(Player pPlayer, TooltipFlag pIsAdvanced) int
void
grow
(int pIncrement) boolean
hasAdventureModeBreakTagForBlock
(Registry<Block> pBlockRegistry, BlockInWorld pBlock) boolean
hasAdventureModePlaceTagForBlock
(Registry<Block> pBlockRegistry, BlockInWorld pBlock) boolean
boolean
hasFoil()
boolean
hasTag()
void
boolean
hurt
(int pAmount, RandomSource pRandom, ServerPlayer pUser) <T extends LivingEntity>
voidhurtAndBreak
(int pAmount, T pEntity, Consumer<T> pOnBroken) void
hurtEnemy
(LivingEntity pEntity, Player pPlayer) interactLivingEntity
(Player pPlayer, LivingEntity pEntity, InteractionHand pUsedHand) void
inventoryTick
(Level pLevel, Entity pEntity, int pInventorySlot, boolean pIsCurrentItem) boolean
boolean
boolean
boolean
boolean
boolean
isCorrectToolForDrops
(BlockState pState) boolean
boolean
boolean
isEdible()
boolean
isEmpty()
boolean
boolean
boolean
isFramed()
boolean
isItemEnabled
(FeatureFlagSet pEnabledFlags) static boolean
isSameItem
(ItemStack pStack, ItemStack pOther) static boolean
isSameItemSameTags
(ItemStack pStack, ItemStack pOther) boolean
static boolean
void
mineBlock
(Level pLevel, BlockState pState, BlockPos pPos, Player pPlayer) static ItemStack
of
(CompoundTag pCompoundTag) void
onCraftedBy
(Level pLevel, Player pPlayer, int pAmount) void
onDestroyed
(ItemEntity pItemEntity) 已过时。Forge: Use damage source sensitive versionprivate InteractionResult
onItemUse
(UseOnContext pContext, Function<UseOnContext, InteractionResult> callback) onItemUseFirst
(UseOnContext pContext) void
onUseTick
(Level pLevel, LivingEntity pLivingEntity, int pCount) boolean
overrideOtherStackedOnMe
(ItemStack pStack, Slot pSlot, ClickAction pAction, Player pPlayer, SlotAccess pAccess) boolean
overrideStackedOnOther
(Slot pSlot, ClickAction pAction, Player pPlayer) void
releaseUsing
(Level pLevel, LivingEntity pLivingEntity, int pTimeLeft) void
removeTagKey
(String pKey) void
save
(CompoundTag pCompoundTag) void
setCount
(int pCount) void
setDamageValue
(int pDamage) void
setEntityRepresentation
(Entity pEntity) setHoverName
(Component pNameComponent) void
setPopTime
(int pPopTime) void
setRepairCost
(int pCost) void
setTag
(CompoundTag p_41752_) private static boolean
shouldShowInTooltip
(int pHideFlags, ItemStack.TooltipPart pPart) void
shrink
(int pDecrement) split
(int pAmount) toString()
use
(Level pLevel, Player pPlayer, InteractionHand pUsedHand) useOn
(UseOnContext pContext) boolean
从类继承的方法 net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, getCapability, invalidateCaps, reviveCaps, serializeCaps
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
从接口继承的方法 net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability, getCapability
从接口继承的方法 net.minecraftforge.common.extensions.IForgeItemStack
areShareTagsEqual, canApplyAtEnchantingTable, canDisableShield, canElytraFly, canEquip, canGrindstoneRepair, canPerformAction, canWalkOnPowderedSnow, doesSneakBypassUse, elytraFlightTick, equals, getAllEnchantments, getBurnTime, getCraftingRemainingItem, getEnchantmentLevel, getEnchantmentValue, getEntityLifespan, getEquipmentSlot, getFoodProperties, getHighlightTip, getShareTag, getSweepHitBox, getXpRepairRatio, hasCraftingRemainingItem, isBookEnchantable, isEnderMask, isNotReplaceableByPickAction, isPiglinCurrency, isRepairable, makesPiglinsNeutral, onArmorTick, onBlockStartBreak, onDestroyed, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onHorseArmorTick, onStopUsing, readShareTag, serializeNBT, shouldCauseBlockBreakReset
-
字段详细资料
-
CODEC
-
delegate
-
capNBT
-
LOGGER
private static final org.slf4j.Logger LOGGER -
EMPTY
-
ATTRIBUTE_MODIFIER_FORMAT
-
TAG_ENCH
- 另请参阅:
-
TAG_DISPLAY
- 另请参阅:
-
TAG_DISPLAY_NAME
- 另请参阅:
-
TAG_LORE
- 另请参阅:
-
TAG_DAMAGE
- 另请参阅:
-
TAG_COLOR
- 另请参阅:
-
TAG_UNBREAKABLE
- 另请参阅:
-
TAG_REPAIR_COST
- 另请参阅:
-
TAG_CAN_DESTROY_BLOCK_LIST
- 另请参阅:
-
TAG_CAN_PLACE_ON_BLOCK_LIST
- 另请参阅:
-
TAG_HIDE_FLAGS
- 另请参阅:
-
DISABLED_ITEM_TOOLTIP
-
DONT_HIDE_TOOLTIP
private static final int DONT_HIDE_TOOLTIP- 另请参阅:
-
LORE_STYLE
-
count
private int count -
popTime
private int popTime -
item
已过时。 -
tag
-
entityRepresentation
-
adventureBreakCheck
-
adventurePlaceCheck
-
-
构造器详细资料
-
ItemStack
-
ItemStack
-
ItemStack
-
ItemStack
-
ItemStack
-
ItemStack
-
ItemStack
-
ItemStack
-
-
方法详细资料
-
getTooltipImage
-
of
-
isEmpty
public boolean isEmpty() -
isItemEnabled
-
split
-
copyAndClear
-
getItem
-
getItemHolder
-
is
-
is
-
is
-
is
-
getTags
-
useOn
-
onItemUseFirst
- 指定者:
onItemUseFirst
在接口中IForgeItemStack
-
onItemUse
private InteractionResult onItemUse(UseOnContext pContext, Function<UseOnContext, InteractionResult> callback) -
getDestroySpeed
-
use
public InteractionResultHolder<ItemStack> use(Level pLevel, Player pPlayer, InteractionHand pUsedHand) -
finishUsingItem
-
save
-
getMaxStackSize
public int getMaxStackSize() -
isStackable
public boolean isStackable() -
isDamageableItem
public boolean isDamageableItem() -
isDamaged
public boolean isDamaged() -
getDamageValue
public int getDamageValue() -
setDamageValue
public void setDamageValue(int pDamage) -
getMaxDamage
public int getMaxDamage() -
hurt
-
hurtAndBreak
-
isBarVisible
public boolean isBarVisible() -
getBarWidth
public int getBarWidth() -
getBarColor
public int getBarColor() -
overrideStackedOnOther
-
overrideOtherStackedOnMe
public boolean overrideOtherStackedOnMe(ItemStack pStack, Slot pSlot, ClickAction pAction, Player pPlayer, SlotAccess pAccess) -
hurtEnemy
-
mineBlock
-
isCorrectToolForDrops
-
interactLivingEntity
public InteractionResult interactLivingEntity(Player pPlayer, LivingEntity pEntity, InteractionHand pUsedHand) -
copy
-
copyWithCount
-
matches
-
isSameItem
-
isSameItemSameTags
-
getDescriptionId
-
toString
-
inventoryTick
-
onCraftedBy
-
getUseDuration
public int getUseDuration() -
getUseAnimation
-
releaseUsing
-
useOnRelease
public boolean useOnRelease() -
hasTag
public boolean hasTag() -
getTag
-
getOrCreateTag
-
getOrCreateTagElement
-
getTagElement
-
removeTagKey
-
getEnchantmentTags
-
setTag
-
getHoverName
-
setHoverName
-
resetHoverName
public void resetHoverName() -
hasCustomHoverName
public boolean hasCustomHoverName() -
getTooltipLines
-
shouldShowInTooltip
-
getHideFlags
private int getHideFlags() -
hideTooltipPart
-
appendEnchantmentNames
-
expandBlockState
-
hasFoil
public boolean hasFoil() -
getRarity
-
isEnchantable
public boolean isEnchantable() -
enchant
-
isEnchanted
public boolean isEnchanted() -
addTagElement
-
isFramed
public boolean isFramed() -
setEntityRepresentation
-
getFrame
-
getEntityRepresentation
-
getBaseRepairCost
public int getBaseRepairCost() -
setRepairCost
public void setRepairCost(int pCost) -
getAttributeModifiers
public com.google.common.collect.Multimap<Attribute,AttributeModifier> getAttributeModifiers(EquipmentSlot pSlot) -
addAttributeModifier
public void addAttributeModifier(Attribute pAttribute, AttributeModifier pModifier, @Nullable EquipmentSlot pSlot) -
getDisplayName
-
hasAdventureModePlaceTagForBlock
public boolean hasAdventureModePlaceTagForBlock(Registry<Block> pBlockRegistry, BlockInWorld pBlock) -
hasAdventureModeBreakTagForBlock
public boolean hasAdventureModeBreakTagForBlock(Registry<Block> pBlockRegistry, BlockInWorld pBlock) -
getPopTime
public int getPopTime() -
setPopTime
public void setPopTime(int pPopTime) -
getCount
public int getCount() -
setCount
public void setCount(int pCount) -
grow
public void grow(int pIncrement) -
shrink
public void shrink(int pDecrement) -
onUseTick
-
onDestroyed
已过时。Forge: Use damage source sensitive version -
isEdible
public boolean isEdible() -
deserializeNBT
- 指定者:
deserializeNBT
在接口中INBTSerializable<CompoundTag>
-
forgeInit
private void forgeInit()Set up forge's ItemStack additions. -
getDrinkingSound
-
getEatingSound
-