net.minecraft.world.item

public final class ItemStack

bue
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.apache.logging.log4j.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 int
p
DONT_HIDE_TOOLTIP
field_30903
field_30903
f_150919_
private static final Style
q
LORE_STYLE
field_24092
LORE_STYLE
f_41586_
private int
r
count
field_8031
count
f_41587_
private int
s
popTime
field_8030
bobbingAnimationTime
f_41588_
private final Item
t
item
field_8038
item
f_41589_
private CompoundTag
u
tag
field_8040
nbt
f_41590_
private boolean
v
emptyCacheFlag
field_8036
empty
f_41591_
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)
private (ItemLike item, int count, Optional<CompoundTag> nbt)
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
N()
updateEmptyCacheFlag()
method_7957()
updateEmptyState()
m_41617_()
public static ItemStack
a(oc 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 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 boolean
a(ahr<bua> arg0)
is(Tag<Item> arg0)
method_31573(class_3494<class_1792> arg0)
isIn(Tag<Item> tag)
m_150922_(C_147_<C_1381_> arg0)
public boolean
a(bua arg0)
is(Item arg0)
method_31574(class_1792 arg0)
isOf(Item item)
m_150930_(C_1381_ arg0)
public InteractionResult
a(bwg arg0)
useOn(UseOnContext arg0)
method_7981(class_1838 arg0)
useOnBlock(ItemUsageContext context)
m_41661_(C_1450_ arg0)
public float
a(coc arg0)
getDestroySpeed(BlockState arg0)
method_7924(class_2680 arg0)
getMiningSpeedMultiplier(BlockState state)
m_41691_(C_2064_ arg0)
public InteractionResultHolder<ItemStack>
a(cad arg0, bnr arg1, avp 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(cad arg0, axh 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(oc arg0)
save(CompoundTag arg0)
method_7953(class_2487 arg0)
writeNbt(NbtCompound nbt)
m_41739_(C_4917_ arg0)
public int
d()
getMaxStackSize()
method_7914()
getMaxCount()
m_41741_()
public boolean
e()
isStackable()
method_7946()
isStackable()
m_41753_()
public boolean
f()
isDamageableItem()
method_7963()
isDamageable()
m_41763_()
public boolean
g()
isDamaged()
method_7986()
isDamaged()
m_41768_()
public int
h()
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
i()
getMaxDamage()
method_7936()
getMaxDamage()
m_41776_()
public boolean
a(int arg0, Random arg1, adj arg2)
hurt(int arg0, Random arg1, ServerPlayer arg2)
method_7970(int arg0, Random arg1, class_3222 arg2)
damage(int amount, Random random, ServerPlayerEntity player)
m_41629_(int p_41631_, Random p_41632_, 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
j()
isBarVisible()
method_31578()
isItemBarVisible()
m_150947_()
public int
k()
getBarWidth()
method_31579()
getItemBarStep()
m_150948_()
public int
l()
getBarColor()
method_31580()
getItemBarColor()
m_150949_()
public boolean
a(bro arg0, bqf arg1, bnr 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(bue arg0, bro arg1, bqf arg2, bnr arg3, axy 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(axh arg0, bnr 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(cad arg0, coc arg1, gh arg2, bnr 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(coc arg0)
isCorrectToolForDrops(BlockState arg0)
method_7951(class_2680 arg0)
isSuitableFor(BlockState state)
m_41735_(C_2064_ arg0)
public InteractionResult
a(bnr arg0, axh arg1, avp 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
m()
copy()
method_7972()
copy()
m_41777_()
public static boolean
a(bue arg0, bue 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(bue arg0, bue 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
c(bue arg0)
matches(ItemStack arg0)
method_7968(class_1799 arg0)
isEqual(ItemStack stack)
m_41744_(C_1391_ arg0)
public static boolean
c(bue arg0, bue arg1)
isSame(ItemStack arg0, ItemStack arg1)
method_7984(class_1799 arg0, class_1799 arg1)
areItemsEqualIgnoreDamage(ItemStack left, ItemStack right)
m_41746_(C_1391_ p_41747_, C_1391_ p_41748_)
public static boolean
d(bue arg0, bue arg1)
isSameIgnoreDurability(ItemStack arg0, ItemStack arg1)
method_7987(class_1799 arg0, class_1799 arg1)
areItemsEqual(ItemStack left, ItemStack right)
m_41758_(C_1391_ p_41759_, C_1391_ p_41760_)
public boolean
a(bue arg0)
sameItem(ItemStack arg0)
method_7962(class_1799 arg0)
isItemEqualIgnoreDamage(ItemStack stack)
m_41656_(C_1391_ arg0)
public boolean
b(bue arg0)
sameItemStackIgnoreDurability(ItemStack arg0)
method_7929(class_1799 arg0)
isItemEqual(ItemStack stack)
m_41726_(C_1391_ arg0)
public static boolean
e(bue arg0, bue 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
n()
getDescriptionId()
method_7922()
getTranslationKey()
m_41778_()
public void
a(cad arg0, awt 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(cad arg0, bnr 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
o()
getUseDuration()
method_7935()
getMaxUseTime()
m_41779_()
public UseAnim
p()
getUseAnimation()
method_7976()
getUseAction()
m_41780_()
public void
a(cad arg0, axh 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
q()
useOnRelease()
method_7967()
isUsedOnRelease()
m_41781_()
public boolean
r()
hasTag()
method_7985()
hasNbt()
m_41782_()
public CompoundTag
s()
getTag()
method_7969()
getNbt()
m_41783_()
public CompoundTag
t()
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
u()
getEnchantmentTags()
method_7921()
getEnchantments()
m_41785_()
public void
c(oc arg0)
setTag(CompoundTag arg0)
method_7980(class_2487 arg0)
setNbt(NbtCompound nbt)
m_41751_(C_4917_ arg0)
public Component
v()
getHoverName()
method_7964()
getName()
m_41786_()
public ItemStack
a(pz arg0)
setHoverName(Component arg0)
method_7977(class_2561 arg0)
setCustomName(Text name)
m_41714_(C_4996_ arg0)
public void
w()
resetHoverName()
method_7925()
removeCustomName()
m_41787_()
public boolean
x()
hasCustomHoverName()
method_7938()
hasCustomName()
m_41788_()
public List<Component>
a(bnr arg0, bvr 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, bue$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
O()
getHideFlags()
method_30266()
getHideFlags()
m_41618_()
public void
a(bue$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<pz> arg0, oi 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
y()
hasFoil()
method_7958()
hasGlint()
m_41790_()
public Rarity
z()
getRarity()
method_7932()
getRarity()
m_41791_()
public boolean
A()
isEnchantable()
method_7923()
isEnchantable()
m_41792_()
public void
a(bxy 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
B()
isEnchanted()
method_7942()
hasEnchantments()
m_41793_()
public void
a(String arg0, ov 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
C()
isFramed()
method_7961()
isInFrame()
m_41794_()
public void
a(awt arg0)
setEntityRepresentation(Entity arg0)
method_27320(class_1297 arg0)
setHolder(Entity holder)
m_41636_(C_507_ arg0)
public ItemFrame
D()
getFrame()
method_7945()
getFrame()
m_41795_()
public Entity
E()
getEntityRepresentation()
method_27319()
getHolder()
m_41609_()
public int
F()
getBaseRepairCost()
method_7928()
getRepairCost()
m_41610_()
public void
c(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(awy arg0)
getAttributeModifiers(EquipmentSlot arg0)
method_7926(class_1304 arg0)
getAttributeModifiers(EquipmentSlot slot)
m_41638_(C_516_ arg0)
public void
a(ayd arg0, ayg arg1, awy 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
G()
getDisplayName()
method_7954()
toHoverableText()
m_41611_()
public boolean
a(aht arg0, cog arg1)
hasAdventureModePlaceTagForBlock(TagContainer arg0, BlockInWorld arg1)
method_7944(class_5415 arg0, class_2694 arg1)
canPlaceOn(TagManager tagManager, CachedBlockPosition pos)
m_41723_(C_159_ p_41725_, C_2070_ arg1)
public boolean
b(aht arg0, cog arg1)
hasAdventureModeBreakTagForBlock(TagContainer arg0, BlockInWorld arg1)
method_7940(class_5415 arg0, class_2694 arg1)
canDestroy(TagManager tagManager, CachedBlockPosition pos)
m_41633_(C_159_ p_41635_, C_2070_ arg1)
public int
H()
getPopTime()
method_7965()
getBobbingAnimationTime()
m_41612_()
public void
d(int arg0)
setPopTime(int arg0)
method_7912(int arg0)
setBobbingAnimationTime(int bobbingAnimationTime)
m_41754_(int arg0)
public int
I()
getCount()
method_7947()
getCount()
m_41613_()
public void
e(int arg0)
setCount(int arg0)
method_7939(int arg0)
setCount(int count)
m_41764_(int arg0)
public void
f(int arg0)
grow(int arg0)
method_7933(int arg0)
increment(int amount)
m_41769_(int arg0)
public void
g(int arg0)
shrink(int arg0)
method_7934(int arg0)
decrement(int amount)
m_41774_(int arg0)
public void
b(cad arg0, axh 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(bkq arg0)
onDestroyed(ItemEntity arg0)
method_33262(class_1542 arg0)
onItemEntityDestroyed(ItemEntity entity)
m_150924_(C_976_ arg0)
public boolean
J()
isEdible()
method_19267()
isFood()
m_41614_()
public SoundEvent
K()
getDrinkingSound()
method_21832()
getDrinkSound()
m_41615_()
public SoundEvent
L()
getEatingSound()
method_21833()
getEatSound()
m_41616_()
public SoundEvent
M()
getEquipSound()
method_31572()
getEquipSound()
m_150920_()