net.minecraft.world.item

public final class ItemStack

cfv
net.minecraft.world.item.ItemStack
net.minecraft.class_1799
net.minecraft.item.ItemStack
net.minecraft.src.C_1391_
net.minecraft.world.item.ItemStack

Field summary

Modifier and TypeField
public static final com.mojang.serialization.Codec<ItemStack>
a
CODEC
field_24671
CODEC
f_41582_
private static final org.slf4j.Logger
j
LOGGER
field_8033
LOGGER
f_41585_
public static final ItemStack
b
EMPTY
field_8037
EMPTY
f_41583_
public static final DecimalFormat
c
ATTRIBUTE_MODIFIER_FORMAT
field_8029
MODIFIER_FORMAT
f_41584_
public static final String
d
TAG_ENCH
field_30890
ENCHANTMENTS_KEY
f_150906_
public static final String
e
TAG_DISPLAY
field_30893
DISPLAY_KEY
f_150909_
public static final String
f
TAG_DISPLAY_NAME
field_30894
NAME_KEY
f_150910_
public static final String
g
TAG_LORE
field_30895
LORE_KEY
f_150911_
public static final String
h
TAG_DAMAGE
field_30896
DAMAGE_KEY
f_150912_
public static final String
i
TAG_COLOR
field_30897
COLOR_KEY
f_150913_
private static final String
k
TAG_UNBREAKABLE
field_30898
UNBREAKABLE_KEY
f_150914_
private static final String
l
TAG_REPAIR_COST
field_30899
REPAIR_COST_KEY
f_150915_
private static final String
m
TAG_CAN_DESTROY_BLOCK_LIST
field_30900
CAN_DESTROY_KEY
f_150916_
private static final String
n
TAG_CAN_PLACE_ON_BLOCK_LIST
field_30901
CAN_PLACE_ON_KEY
f_150917_
private static final String
o
TAG_HIDE_FLAGS
field_30902
HIDE_FLAGS_KEY
f_150918_
private static final Component
p
DISABLED_ITEM_TOOLTIP
field_40211
DISABLED_TEXT
f_243862_
private static final int
q
DONT_HIDE_TOOLTIP
field_30903
field_30903
f_150919_
private static final Style
r
LORE_STYLE
field_24092
LORE_STYLE
f_41586_
private int
s
count
field_8031
count
f_41587_
private int
t
popTime
field_8030
bobbingAnimationTime
f_41588_
private final Item
u
item
field_8038
item
f_41589_
private CompoundTag
v
tag
field_8040
nbt
f_41590_
private boolean
w
emptyCacheFlag
field_8036
empty
f_41591_
private Entity
x
entityRepresentation
field_24093
holder
f_41592_
private AdventureModeCheck
y
adventureBreakCheck
field_34453
destroyChecker
f_186360_
private AdventureModeCheck
z
adventurePlaceCheck
field_34454
placeChecker
f_186361_

Constructor summary

ModifierConstructor
public (ItemLike item)
public (Holder<Item> entry)
private (ItemLike item, int count, Optional<CompoundTag> nbt)
public (Holder<Item> itemEntry, int count)
public (ItemLike item, int count)
private (CompoundTag nbt)

Method summary

Modifier and TypeMethod
public Optional<TooltipComponent>
a()
getTooltipImage()
method_32347()
getTooltipData()
m_150921_()
private void
O()
updateEmptyCacheFlag()
method_7957()
updateEmptyState()
m_41617_()
public static ItemStack
a(re arg0)
of(CompoundTag arg0)
method_7915(class_2487 arg0)
fromNbt(NbtCompound nbt)
m_41712_(C_4917_ p_41713_)
public boolean
b()
isEmpty()
method_7960()
isEmpty()
m_41619_()
public boolean
a(cau arg0)
isItemEnabled(FeatureFlagSet arg0)
method_45435(class_7699 arg0)
isItemEnabled(FeatureSet enabledFeatures)
m_246617_(C_243488_ arg0)
public ItemStack
a(int arg0)
split(int arg0)
method_7971(int arg0)
split(int amount)
m_41620_(int arg0)
public Item
c()
getItem()
method_7909()
getItem()
m_41720_()
public Holder<Item>
d()
getItemHolder()
method_41409()
getRegistryEntry()
m_220173_()
public boolean
a(anv<cfq> arg0)
is(TagKey<Item> arg0)
method_31573(class_6862<class_1792> arg0)
isIn(TagKey<Item> tag)
m_204117_(C_203208_<C_1381_> arg0)
public boolean
a(cfq arg0)
is(Item arg0)
method_31574(class_1792 arg0)
isOf(Item item)
m_150930_(C_1381_ arg0)
public boolean
a(Predicate<hd<cfq>> arg0)
is(Predicate<Holder<Item>> arg0)
method_41407(Predicate<class_6880<class_1792>> arg0)
itemMatches(Predicate<RegistryEntry<Item>> predicate)
m_220167_(Predicate<C_203228_<C_1381_>> arg0)
public boolean
a(hd<cfq> arg0)
is(Holder<Item> arg0)
method_41406(class_6880<class_1792> arg0)
itemMatches(RegistryEntry<Item> itemEntry)
m_220165_(C_203228_<C_1381_> arg0)
public Stream<TagKey<Item>>
e()
getTags()
method_40133()
streamTags()
m_204131_()
public InteractionResult
a(cie arg0)
useOn(UseOnContext arg0)
method_7981(class_1838 arg0)
useOnBlock(ItemUsageContext context)
m_41661_(C_1450_ arg0)
public float
a(dbq arg0)
getDestroySpeed(BlockState arg0)
method_7924(class_2680 arg0)
getMiningSpeedMultiplier(BlockState state)
m_41691_(C_2064_ arg0)
public InteractionResultHolder<ItemStack>
a(cmi arg0, bym arg1, bdx arg2)
use(Level arg0, Player arg1, InteractionHand arg2)
method_7913(class_1937 arg0, class_1657 arg1, class_1268 arg2)
use(World world, PlayerEntity user, Hand hand)
m_41682_(C_1596_ p_41684_, C_1141_ p_41685_, C_470_ arg2)
public ItemStack
a(cmi arg0, bfx arg1)
finishUsingItem(Level arg0, LivingEntity arg1)
method_7910(class_1937 arg0, class_1309 arg1)
finishUsing(World world, LivingEntity user)
m_41671_(C_1596_ p_41673_, C_524_ arg1)
public CompoundTag
b(re arg0)
save(CompoundTag arg0)
method_7953(class_2487 arg0)
writeNbt(NbtCompound nbt)
m_41739_(C_4917_ arg0)
public int
f()
getMaxStackSize()
method_7914()
getMaxCount()
m_41741_()
public boolean
g()
isStackable()
method_7946()
isStackable()
m_41753_()
public boolean
h()
isDamageableItem()
method_7963()
isDamageable()
m_41763_()
public boolean
i()
isDamaged()
method_7986()
isDamaged()
m_41768_()
public int
j()
getDamageValue()
method_7919()
getDamage()
m_41773_()
public void
b(int arg0)
setDamageValue(int arg0)
method_7974(int arg0)
setDamage(int damage)
m_41721_(int arg0)
public int
k()
getMaxDamage()
method_7936()
getMaxDamage()
m_41776_()
public boolean
a(int arg0, apo arg1, aiq arg2)
hurt(int arg0, RandomSource arg1, ServerPlayer arg2)
method_7970(int arg0, class_5819 arg1, class_3222 arg2)
damage(int amount, Random random, ServerPlayerEntity player)
m_220157_(int p_220159_, C_212974_ p_220160_, C_13_ arg2)
public <T extends LivingEntity> void
a(int arg0, T arg1, Consumer<T> arg2)
hurtAndBreak(int arg0, T arg1, Consumer<T> arg2)
method_7956(int arg0, T arg1, Consumer<T> arg2)
damage(int amount, T entity, Consumer<T> breakCallback)
m_41622_(int p_41624_, T p_41625_, Consumer<T> arg2)
public boolean
l()
isBarVisible()
method_31578()
isItemBarVisible()
m_150947_()
public int
m()
getBarWidth()
method_31579()
getItemBarStep()
m_150948_()
public int
n()
getBarColor()
method_31580()
getItemBarColor()
m_150949_()
public boolean
a(ccw arg0, cbl arg1, bym arg2)
overrideStackedOnOther(Slot arg0, ClickAction arg1, Player arg2)
method_31575(class_1735 arg0, class_5536 arg1, class_1657 arg2)
onStackClicked(Slot slot, ClickType clickType, PlayerEntity player)
m_150926_(C_1305_ p_150928_, C_141163_ p_150929_, C_1141_ arg2)
public boolean
a(cfv arg0, ccw arg1, cbl arg2, bym arg3, bgq arg4)
overrideOtherStackedOnMe(ItemStack arg0, Slot arg1, ClickAction arg2, Player arg3, SlotAccess arg4)
method_31576(class_1799 arg0, class_1735 arg1, class_5536 arg2, class_1657 arg3, class_5630 arg4)
onClicked(ItemStack stack, Slot slot, ClickType clickType, PlayerEntity player, StackReference cursorStackReference)
m_150932_(C_1391_ p_150934_, C_1305_ p_150935_, C_141163_ p_150936_, C_1141_ p_150937_, C_141073_ arg4)
public void
a(bfx arg0, bym arg1)
hurtEnemy(LivingEntity arg0, Player arg1)
method_7979(class_1309 arg0, class_1657 arg1)
postHit(LivingEntity target, PlayerEntity attacker)
m_41640_(C_524_ p_41642_, C_1141_ arg1)
public void
a(cmi arg0, dbq arg1, gt arg2, bym arg3)
mineBlock(Level arg0, BlockState arg1, BlockPos arg2, Player arg3)
method_7952(class_1937 arg0, class_2680 arg1, class_2338 arg2, class_1657 arg3)
postMine(World world, BlockState state, BlockPos pos, PlayerEntity miner)
m_41686_(C_1596_ p_41688_, C_2064_ p_41689_, C_4675_ p_41690_, C_1141_ arg3)
public boolean
b(dbq arg0)
isCorrectToolForDrops(BlockState arg0)
method_7951(class_2680 arg0)
isSuitableFor(BlockState state)
m_41735_(C_2064_ arg0)
public InteractionResult
a(bym arg0, bfx arg1, bdx arg2)
interactLivingEntity(Player arg0, LivingEntity arg1, InteractionHand arg2)
method_7920(class_1657 arg0, class_1309 arg1, class_1268 arg2)
useOnEntity(PlayerEntity user, LivingEntity entity, Hand hand)
m_41647_(C_1141_ p_41649_, C_524_ p_41650_, C_470_ arg2)
public ItemStack
o()
copy()
method_7972()
copy()
m_41777_()
public ItemStack
c(int arg0)
copyWithCount(int arg0)
method_46651(int arg0)
copyWithCount(int count)
m_255036_(int arg0)
public static boolean
a(cfv arg0, cfv arg1)
tagMatches(ItemStack arg0, ItemStack arg1)
method_7975(class_1799 arg0, class_1799 arg1)
areNbtEqual(ItemStack left, ItemStack right)
m_41658_(C_1391_ p_41659_, C_1391_ p_41660_)
public static boolean
b(cfv arg0, cfv arg1)
matches(ItemStack arg0, ItemStack arg1)
method_7973(class_1799 arg0, class_1799 arg1)
areEqual(ItemStack left, ItemStack right)
m_41728_(C_1391_ p_41729_, C_1391_ p_41730_)
private boolean
b(cfv arg0)
matches(ItemStack arg0)
method_7968(class_1799 arg0)
isEqual(ItemStack stack)
m_41744_(C_1391_ arg0)
public static boolean
c(cfv arg0, cfv arg1)
isSame(ItemStack arg0, ItemStack arg1)
method_7984(class_1799 arg0, class_1799 arg1)
areItemsEqual(ItemStack left, ItemStack right)
m_41746_(C_1391_ p_41747_, C_1391_ p_41748_)
public boolean
a(cfv arg0)
sameItem(ItemStack arg0)
method_7962(class_1799 arg0)
isItemEqual(ItemStack stack)
m_41656_(C_1391_ arg0)
public static boolean
d(cfv arg0, cfv arg1)
isSameItemSameTags(ItemStack arg0, ItemStack arg1)
method_31577(class_1799 arg0, class_1799 arg1)
canCombine(ItemStack stack, ItemStack otherStack)
m_150942_(C_1391_ p_150943_, C_1391_ p_150944_)
public String
p()
getDescriptionId()
method_7922()
getTranslationKey()
m_41778_()
public void
a(cmi arg0, bfh arg1, int arg2, boolean arg3)
inventoryTick(Level arg0, Entity arg1, int arg2, boolean arg3)
method_7917(class_1937 arg0, class_1297 arg1, int arg2, boolean arg3)
inventoryTick(World world, Entity entity, int slot, boolean selected)
m_41666_(C_1596_ p_41668_, C_507_ p_41669_, int p_41670_, boolean arg3)
public void
a(cmi arg0, bym arg1, int arg2)
onCraftedBy(Level arg0, Player arg1, int arg2)
method_7982(class_1937 arg0, class_1657 arg1, int arg2)
onCraft(World world, PlayerEntity player, int amount)
m_41678_(C_1596_ p_41680_, C_1141_ p_41681_, int arg2)
public int
q()
getUseDuration()
method_7935()
getMaxUseTime()
m_41779_()
public UseAnim
r()
getUseAnimation()
method_7976()
getUseAction()
m_41780_()
public void
a(cmi arg0, bfx arg1, int arg2)
releaseUsing(Level arg0, LivingEntity arg1, int arg2)
method_7930(class_1937 arg0, class_1309 arg1, int arg2)
onStoppedUsing(World world, LivingEntity user, int remainingUseTicks)
m_41674_(C_1596_ p_41676_, C_524_ p_41677_, int arg2)
public boolean
s()
useOnRelease()
method_7967()
isUsedOnRelease()
m_41781_()
public boolean
t()
hasTag()
method_7985()
hasNbt()
m_41782_()
public CompoundTag
u()
getTag()
method_7969()
getNbt()
m_41783_()
public CompoundTag
v()
getOrCreateTag()
method_7948()
getOrCreateNbt()
m_41784_()
public CompoundTag
a(String arg0)
getOrCreateTagElement(String arg0)
method_7911(String arg0)
getOrCreateSubNbt(String key)
m_41698_(String arg0)
public CompoundTag
b(String arg0)
getTagElement(String arg0)
method_7941(String arg0)
getSubNbt(String key)
m_41737_(String arg0)
public void
c(String arg0)
removeTagKey(String arg0)
method_7983(String arg0)
removeSubNbt(String key)
m_41749_(String arg0)
public ListTag
w()
getEnchantmentTags()
method_7921()
getEnchantments()
m_41785_()
public void
c(re arg0)
setTag(CompoundTag arg0)
method_7980(class_2487 arg0)
setNbt(NbtCompound nbt)
m_41751_(C_4917_ arg0)
public Component
x()
getHoverName()
method_7964()
getName()
m_41786_()
public ItemStack
a(tj arg0)
setHoverName(Component arg0)
method_7977(class_2561 arg0)
setCustomName(Text name)
m_41714_(C_4996_ arg0)
public void
y()
resetHoverName()
method_7925()
removeCustomName()
m_41787_()
public boolean
z()
hasCustomHoverName()
method_7938()
hasCustomName()
m_41788_()
public List<Component>
a(bym arg0, chl arg1)
getTooltipLines(Player arg0, TooltipFlag arg1)
method_7950(class_1657 arg0, class_1836 arg1)
getTooltip(PlayerEntity player, TooltipContext context)
m_41651_(C_1141_ p_41653_, C_1431_ arg1)
private static boolean
a(int arg0, cfv$a arg1)
shouldShowInTooltip(int arg0, ItemStack$TooltipPart arg1)
method_30267(int arg0, class_1799$class_5422 arg1)
isSectionVisible(int flags, ItemStack$TooltipSection tooltipSection)
m_41626_(int p_41627_, C_1391_$C_1392_ p_41628_)
private int
P()
getHideFlags()
method_30266()
getHideFlags()
m_41618_()
public void
a(cfv$a arg0)
hideTooltipPart(ItemStack$TooltipPart arg0)
method_30268(class_1799$class_5422 arg0)
addHideFlag(ItemStack$TooltipSection tooltipSection)
m_41654_(C_1391_$C_1392_ arg0)
public static void
a(List<tj> arg0, rk arg1)
appendEnchantmentNames(List<Component> arg0, ListTag arg1)
method_17870(List<class_2561> arg0, class_2499 arg1)
appendEnchantments(List<Text> tooltip, NbtList enchantments)
m_41709_(List<C_4996_> p_41710_, C_4930_ p_41711_)
private static Collection<Component>
d(String arg0)
expandBlockState(String arg0)
method_7937(String arg0)
parseBlockTag(String tag)
m_41761_(String p_41762_)
public boolean
A()
hasFoil()
method_7958()
hasGlint()
m_41790_()
public Rarity
B()
getRarity()
method_7932()
getRarity()
m_41791_()
public boolean
C()
isEnchantable()
method_7923()
isEnchantable()
m_41792_()
public void
a(ckc arg0, int arg1)
enchant(Enchantment arg0, int arg1)
method_7978(class_1887 arg0, int arg1)
addEnchantment(Enchantment enchantment, int level)
m_41663_(C_1505_ p_41665_, int arg1)
public boolean
D()
isEnchanted()
method_7942()
hasEnchantments()
m_41793_()
public void
a(String arg0, rx arg1)
addTagElement(String arg0, Tag arg1)
method_7959(String arg0, class_2520 arg1)
setSubNbt(String key, NbtElement element)
m_41700_(String p_41702_, C_4950_ arg1)
public boolean
E()
isFramed()
method_7961()
isInFrame()
m_41794_()
public void
a(bfh arg0)
setEntityRepresentation(Entity arg0)
method_27320(class_1297 arg0)
setHolder(Entity holder)
m_41636_(C_507_ arg0)
public ItemFrame
F()
getFrame()
method_7945()
getFrame()
m_41795_()
public Entity
G()
getEntityRepresentation()
method_27319()
getHolder()
m_41609_()
public int
H()
getBaseRepairCost()
method_7928()
getRepairCost()
m_41610_()
public void
d(int arg0)
setRepairCost(int arg0)
method_7927(int arg0)
setRepairCost(int repairCost)
m_41742_(int arg0)
public com.google.common.collect.Multimap<Attribute, AttributeModifier>
a(bfm arg0)
getAttributeModifiers(EquipmentSlot arg0)
method_7926(class_1304 arg0)
getAttributeModifiers(EquipmentSlot slot)
m_41638_(C_516_ arg0)
public void
a(bgz arg0, bhc arg1, bfm arg2)
addAttributeModifier(Attribute arg0, AttributeModifier arg1, EquipmentSlot arg2)
method_7916(class_1320 arg0, class_1322 arg1, class_1304 arg2)
addAttributeModifier(EntityAttribute attribute, EntityAttributeModifier modifier, EquipmentSlot slot)
m_41643_(C_552_ p_41645_, C_555_ p_41646_, C_516_ arg2)
public Component
I()
getDisplayName()
method_7954()
toHoverableText()
m_41611_()
public boolean
a(hq<cpi> arg0, dbu arg1)
hasAdventureModePlaceTagForBlock(Registry<Block> arg0, BlockInWorld arg1)
method_7944(class_2378<class_2248> arg0, class_2694 arg1)
canPlaceOn(Registry<Block> blockRegistry, CachedBlockPosition pos)
m_204121_(C_4705_<C_1706_> p_204123_, C_2070_ arg1)
public boolean
b(hq<cpi> arg0, dbu arg1)
hasAdventureModeBreakTagForBlock(Registry<Block> arg0, BlockInWorld arg1)
method_7940(class_2378<class_2248> arg0, class_2694 arg1)
canDestroy(Registry<Block> blockRegistry, CachedBlockPosition pos)
m_204128_(C_4705_<C_1706_> p_204130_, C_2070_ arg1)
public int
J()
getPopTime()
method_7965()
getBobbingAnimationTime()
m_41612_()
public void
e(int arg0)
setPopTime(int arg0)
method_7912(int arg0)
setBobbingAnimationTime(int bobbingAnimationTime)
m_41754_(int arg0)
public int
K()
getCount()
method_7947()
getCount()
m_41613_()
public void
f(int arg0)
setCount(int arg0)
method_7939(int arg0)
setCount(int count)
m_41764_(int arg0)
public void
g(int arg0)
grow(int arg0)
method_7933(int arg0)
increment(int amount)
m_41769_(int arg0)
public void
h(int arg0)
shrink(int arg0)
method_7934(int arg0)
decrement(int amount)
m_41774_(int arg0)
public void
b(cmi arg0, bfx arg1, int arg2)
onUseTick(Level arg0, LivingEntity arg1, int arg2)
method_7949(class_1937 arg0, class_1309 arg1, int arg2)
usageTick(World world, LivingEntity user, int remainingUseTicks)
m_41731_(C_1596_ p_41733_, C_524_ p_41734_, int arg2)
public void
a(bvf arg0)
onDestroyed(ItemEntity arg0)
method_33262(class_1542 arg0)
onItemEntityDestroyed(ItemEntity entity)
m_150924_(C_976_ arg0)
public boolean
L()
isEdible()
method_19267()
isFood()
m_41614_()
public SoundEvent
M()
getDrinkingSound()
method_21832()
getDrinkSound()
m_41615_()
public SoundEvent
N()
getEatingSound()
method_21833()
getEatSound()
m_41616_()