Package net.minecraft.item
Class ItemStack
java.lang.Object
net.minecraft.item.ItemStack
public final class ItemStack extends Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ItemStack.TooltipSection
-
Field Summary
Fields Modifier and Type Field Description static com.mojang.serialization.Codec<ItemStack>
CODEC
private int
cooldown
private int
count
private boolean
empty
static ItemStack
EMPTY
private Entity
holder
private Item
item
Deprecated.private CachedBlockPosition
lastDestroyPos
private boolean
lastDestroyResult
private CachedBlockPosition
lastPlaceOnPos
private boolean
lastPlaceOnResult
private static Logger
LOGGER
private static Style
LORE_STYLE
static DecimalFormat
MODIFIER_FORMAT
private CompoundTag
tag
-
Constructor Summary
Constructors Modifier Constructor Description ItemStack(ItemConvertible item)
ItemStack(ItemConvertible item, int count)
private
ItemStack(ItemConvertible itemConvertible, int count, Optional<CompoundTag> optional)
private
ItemStack(CompoundTag tag)
-
Method Summary
-
Field Details
-
CODEC
-
LOGGER
-
EMPTY
-
MODIFIER_FORMAT
-
LORE_STYLE
-
count
private int count -
cooldown
private int cooldown -
item
Deprecated. -
tag
-
empty
private boolean empty -
holder
-
lastDestroyPos
-
lastDestroyResult
private boolean lastDestroyResult -
lastPlaceOnPos
-
lastPlaceOnResult
private boolean lastPlaceOnResult
-
-
Constructor Details
-
ItemStack
-
ItemStack
-
ItemStack
-
ItemStack
-
-
Method Details
-
updateEmptyState
private void updateEmptyState() -
fromTag
-
isEmpty
public boolean isEmpty() -
split
-
getItem
-
useOnBlock
-
getMiningSpeedMultiplier
-
use
-
finishUsing
-
toTag
-
getMaxCount
public int getMaxCount() -
isStackable
public boolean isStackable() -
isDamageable
public boolean isDamageable() -
isDamaged
public boolean isDamaged() -
getDamage
public int getDamage() -
setDamage
public void setDamage(int damage) -
getMaxDamage
public int getMaxDamage() -
damage
-
damage
-
postHit
-
postMine
-
isEffectiveOn
-
useOnEntity
-
copy
-
areTagsEqual
-
areEqual
-
isEqual
-
areItemsEqualIgnoreDamage
-
areItemsEqual
-
isItemEqualIgnoreDamage
-
isItemEqual
-
getTranslationKey
-
toString
-
inventoryTick
-
onCraft
-
getMaxUseTime
public int getMaxUseTime() -
getUseAction
-
onStoppedUsing
-
isUsedOnRelease
public boolean isUsedOnRelease() -
hasTag
public boolean hasTag() -
getTag
-
getOrCreateTag
-
getOrCreateSubTag
-
getSubTag
-
removeSubTag
-
getEnchantments
-
setTag
-
getName
-
setCustomName
-
removeCustomName
public void removeCustomName() -
hasCustomName
public boolean hasCustomName() -
getTooltip
@Environment(CLIENT) public List<Text> getTooltip(@Nullable PlayerEntity player, TooltipContext context) -
isSectionHidden
@Environment(CLIENT) private static boolean isSectionHidden(int flags, ItemStack.TooltipSection tooltipSection) -
getHideFlags
@Environment(CLIENT) private int getHideFlags() -
addHideFlag
-
appendEnchantments
-
parseBlockTag
-
hasGlint
public boolean hasGlint() -
getRarity
-
isEnchantable
public boolean isEnchantable() -
addEnchantment
-
hasEnchantments
public boolean hasEnchantments() -
putSubTag
-
isInFrame
public boolean isInFrame() -
setHolder
-
getFrame
-
getHolder
-
getRepairCost
public int getRepairCost() -
setRepairCost
public void setRepairCost(int repairCost) -
getAttributeModifiers
public Multimap<EntityAttribute,EntityAttributeModifier> getAttributeModifiers(EquipmentSlot equipmentSlot) -
addAttributeModifier
public void addAttributeModifier(EntityAttribute entityAttribute, EntityAttributeModifier modifier, @Nullable EquipmentSlot slot) -
toHoverableText
-
areBlocksEqual
private static boolean areBlocksEqual(CachedBlockPosition first, @Nullable CachedBlockPosition second) -
canDestroy
-
canPlaceOn
-
getCooldown
public int getCooldown() -
setCooldown
public void setCooldown(int cooldown) -
getCount
public int getCount() -
setCount
public void setCount(int count) -
increment
public void increment(int amount) -
decrement
public void decrement(int amount) -
usageTick
-
isFood
public boolean isFood() -
getDrinkSound
-
getEatSound
-