net.minecraft.world.item

public final class ItemStack

cjf
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 Entity
w
entityRepresentation
field_24093
holder
f_41592_
private AdventureModeCheck
x
adventureBreakCheck
field_34453
destroyChecker
f_186360_
private AdventureModeCheck
y
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 (Void arg0)
private (CompoundTag nbt)

Method summary

Modifier and TypeMethod
public Optional<TooltipComponent>
a()
getTooltipImage()
method_32347()
getTooltipData()
m_150921_()
public static ItemStack
a(qw 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(cec 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 ItemStack
c()
copyAndClear()
method_51164()
copyAndEmpty()
m_278832_()
public Item
d()
getItem()
method_7909()
getItem()
m_41720_()
public Holder<Item>
e()
getItemHolder()
method_41409()
getRegistryEntry()
m_220173_()
public boolean
a(aqh<cja> 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(cja arg0)
is(Item arg0)
method_31574(class_1792 arg0)
isOf(Item item)
m_150930_(C_1381_ arg0)
public boolean
a(Predicate<he<cja>> 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(he<cja> arg0)
is(Holder<Item> arg0)
method_41406(class_6880<class_1792> arg0)
itemMatches(RegistryEntry<Item> itemEntry)
m_220165_(C_203228_<C_1381_> arg0)
public boolean
a(hi<cja> arg0)
is(HolderSet<Item> arg0)
method_53187(class_6885<class_1792> arg0)
itemMatches(RegistryEntryList<Item> registryEntryList)
m_295139_(C_203233_<C_1381_> arg0)
public Stream<TagKey<Item>>
f()
getTags()
method_40133()
streamTags()
m_204131_()
public InteractionResult
a(clp arg0)
useOn(UseOnContext arg0)
method_7981(class_1838 arg0)
useOnBlock(ItemUsageContext context)
m_41661_(C_1450_ arg0)
public float
a(dfj arg0)
getDestroySpeed(BlockState arg0)
method_7924(class_2680 arg0)
getMiningSpeedMultiplier(BlockState state)
m_41691_(C_2064_ arg0)
public InteractionResultHolder<ItemStack>
a(cpv arg0, cbu arg1, bgx 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(cpv arg0, bjg 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(qw arg0)
save(CompoundTag arg0)
method_7953(class_2487 arg0)
writeNbt(NbtCompound nbt)
m_41739_(C_4917_ arg0)
public int
g()
getMaxStackSize()
method_7914()
getMaxCount()
m_41741_()
public boolean
h()
isStackable()
method_7946()
isStackable()
m_41753_()
public boolean
i()
isDamageableItem()
method_7963()
isDamageable()
m_41763_()
public boolean
j()
isDamaged()
method_7986()
isDamaged()
m_41768_()
public int
k()
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
l()
getMaxDamage()
method_7936()
getMaxDamage()
m_41776_()
public boolean
a(int arg0, asc arg1, akr 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
m()
isBarVisible()
method_31578()
isItemBarVisible()
m_150947_()
public int
n()
getBarWidth()
method_31579()
getItemBarStep()
m_150948_()
public int
o()
getBarColor()
method_31580()
getItemBarColor()
m_150949_()
public boolean
a(cgd arg0, cet arg1, cbu 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(cjf arg0, cgd arg1, cet arg2, cbu arg3, bjy 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(bjg arg0, cbu 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(cpv arg0, dfj arg1, gw arg2, cbu 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(dfj arg0)
isCorrectToolForDrops(BlockState arg0)
method_7951(class_2680 arg0)
isSuitableFor(BlockState state)
m_41735_(C_2064_ arg0)
public InteractionResult
a(cbu arg0, bjg arg1, bgx 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
p()
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(cjf arg0, cjf 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_)
public static boolean
b(cjf arg0, cjf arg1)
isSameItem(ItemStack arg0, ItemStack arg1)
method_7984(class_1799 arg0, class_1799 arg1)
areItemsEqual(ItemStack left, ItemStack right)
m_41656_(C_1391_ p_287761_, C_1391_ p_287676_)
public static boolean
c(cjf arg0, cjf 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
q()
getDescriptionId()
method_7922()
getTranslationKey()
m_41778_()
public void
a(cpv arg0, biq 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(cpv arg0, cbu 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
r()
getUseDuration()
method_7935()
getMaxUseTime()
m_41779_()
public UseAnim
s()
getUseAnimation()
method_7976()
getUseAction()
m_41780_()
public void
a(cpv arg0, bjg 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
t()
useOnRelease()
method_7967()
isUsedOnRelease()
m_41781_()
public boolean
u()
hasTag()
method_7985()
hasNbt()
m_41782_()
public CompoundTag
v()
getTag()
method_7969()
getNbt()
m_41783_()
public CompoundTag
w()
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
x()
getEnchantmentTags()
method_7921()
getEnchantments()
m_41785_()
public void
c(qw arg0)
setTag(CompoundTag arg0)
method_7980(class_2487 arg0)
setNbt(NbtCompound nbt)
m_41751_(C_4917_ arg0)
public Component
y()
getHoverName()
method_7964()
getName()
m_41786_()
public ItemStack
a(tl arg0)
setHoverName(Component arg0)
method_7977(class_2561 arg0)
setCustomName(Text name)
m_41714_(C_4996_ arg0)
public void
z()
resetHoverName()
method_7925()
removeCustomName()
m_41787_()
public boolean
A()
hasCustomHoverName()
method_7938()
hasCustomName()
m_41788_()
public List<Component>
a(cbu arg0, ckw 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, cjf$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(cjf$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<tl> arg0, rc 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
B()
hasFoil()
method_7958()
hasGlint()
m_41790_()
public Rarity
C()
getRarity()
method_7932()
getRarity()
m_41791_()
public boolean
D()
isEnchantable()
method_7923()
isEnchantable()
m_41792_()
public void
a(cno 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
E()
isEnchanted()
method_7942()
hasEnchantments()
m_41793_()
public void
a(String arg0, rq 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
F()
isFramed()
method_7961()
isInFrame()
m_41794_()
public void
a(biq arg0)
setEntityRepresentation(Entity arg0)
method_27320(class_1297 arg0)
setHolder(Entity holder)
m_41636_(C_507_ arg0)
public ItemFrame
G()
getFrame()
method_7945()
getFrame()
m_41795_()
public Entity
H()
getEntityRepresentation()
method_27319()
getHolder()
m_41609_()
public int
I()
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(biv arg0)
getAttributeModifiers(EquipmentSlot arg0)
method_7926(class_1304 arg0)
getAttributeModifiers(EquipmentSlot slot)
m_41638_(C_516_ arg0)
public void
a(bkh arg0, bkk arg1, biv 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
J()
getDisplayName()
method_7954()
toHoverableText()
m_41611_()
public boolean
a(hq<csv> arg0, dfn 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<csv> arg0, dfn 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
K()
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
L()
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(cpv arg0, bjg 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(byn arg0)
onDestroyed(ItemEntity arg0)
method_33262(class_1542 arg0)
onItemEntityDestroyed(ItemEntity entity)
m_150924_(C_976_ arg0)
public boolean
M()
isEdible()
method_19267()
isFood()
m_41614_()
public SoundEvent
N()
getDrinkingSound()
method_21832()
getDrinkSound()
m_41615_()
public SoundEvent
O()
getEatingSound()
method_21833()
getEatSound()
m_41616_()