Uses of Class
net.minecraft.item.ItemStack
Package
Description
The basic AI system for Minecraft living entities.
-
Uses of ItemStack in net.minecraft.advancement
Modifier and TypeMethodDescriptionAdvancementDisplay.getIcon()
private static ItemStack
AdvancementDisplay.iconFromJson
(JsonObject json) Modifier and TypeMethodDescriptionAdvancement.Builder.display
(ItemStack icon, Text title, Text description, @Nullable Identifier background, AdvancementFrame frame, boolean showToast, boolean announceToChat, boolean hidden) ModifierConstructorDescriptionAdvancementDisplay
(ItemStack icon, Text title, Text description, @Nullable Identifier background, AdvancementFrame frame, boolean showToast, boolean announceToChat, boolean hidden) -
Uses of ItemStack in net.minecraft.advancement.criterion
Modifier and TypeMethodDescriptionboolean
boolean
boolean
boolean
FishingRodHookedCriterion.Conditions.matches
(ItemStack rod, LootContext hookedEntityContext, Collection<ItemStack> fishingLoots) boolean
InventoryChangedCriterion.Conditions.matches
(PlayerInventory inventory, ItemStack stack, int full, int empty, int occupied) boolean
boolean
PlacedBlockCriterion.Conditions.matches
(BlockState state, BlockPos pos, ServerWorld world, ItemStack stack) boolean
boolean
boolean
VillagerTradeCriterion.Conditions.matches
(LootContext merchantContext, ItemStack stack) boolean
BeeNestDestroyedCriterion.Conditions.test
(BlockState state, ItemStack stack, int count) boolean
ItemCriterion.Conditions.test
(BlockState state, ServerWorld world, BlockPos pos, ItemStack stack) boolean
PlayerInteractedWithEntityCriterion.Conditions.test
(ItemStack stack, LootContext context) boolean
ThrownItemPickedUpByEntityCriterion.Conditions.test
(ServerPlayerEntity player, ItemStack stack, LootContext entityContext) boolean
void
BeeNestDestroyedCriterion.trigger
(ServerPlayerEntity player, BlockState state, ItemStack stack, int beeCount) void
ConsumeItemCriterion.trigger
(ServerPlayerEntity player, ItemStack stack) void
EnchantedItemCriterion.trigger
(ServerPlayerEntity player, ItemStack stack, int levels) void
FilledBucketCriterion.trigger
(ServerPlayerEntity player, ItemStack stack) void
FishingRodHookedCriterion.trigger
(ServerPlayerEntity player, ItemStack rod, FishingBobberEntity bobber, Collection<ItemStack> fishingLoots) void
InventoryChangedCriterion.trigger
(ServerPlayerEntity player, PlayerInventory inventory, ItemStack stack) private void
InventoryChangedCriterion.trigger
(ServerPlayerEntity player, PlayerInventory inventory, ItemStack stack, int full, int empty, int occupied) void
ItemCriterion.trigger
(ServerPlayerEntity player, BlockPos pos, ItemStack stack) void
ItemDurabilityChangedCriterion.trigger
(ServerPlayerEntity player, ItemStack stack, int durability) void
PlacedBlockCriterion.trigger
(ServerPlayerEntity player, BlockPos blockPos, ItemStack stack) void
PlayerInteractedWithEntityCriterion.trigger
(ServerPlayerEntity player, ItemStack stack, Entity entity) void
ShotCrossbowCriterion.trigger
(ServerPlayerEntity player, ItemStack stack) void
ThrownItemPickedUpByEntityCriterion.trigger
(ServerPlayerEntity player, ItemStack stack, @Nullable Entity entity) void
UsedTotemCriterion.trigger
(ServerPlayerEntity player, ItemStack stack) void
UsingItemCriterion.trigger
(ServerPlayerEntity player, ItemStack stack) void
VillagerTradeCriterion.trigger
(ServerPlayerEntity player, MerchantEntity merchant, ItemStack stack) Modifier and TypeMethodDescriptionboolean
FishingRodHookedCriterion.Conditions.matches
(ItemStack rod, LootContext hookedEntityContext, Collection<ItemStack> fishingLoots) void
FishingRodHookedCriterion.trigger
(ServerPlayerEntity player, ItemStack rod, FishingBobberEntity bobber, Collection<ItemStack> fishingLoots) -
Uses of ItemStack in net.minecraft.block
Modifier and TypeMethodDescriptionstatic ItemStack
ShulkerBoxBlock.getItemStack
(@Nullable DyeColor color) AbstractBannerBlock.getPickStack
(BlockView world, BlockPos pos, BlockState state) Returns the new item stack when using pick block functionality.AbstractPlantBlock.getPickStack
(BlockView world, BlockPos pos, BlockState state) Returns the new item stack when using pick block functionality.AttachedStemBlock.getPickStack
(BlockView world, BlockPos pos, BlockState state) Returns the new item stack when using pick block functionality.BambooSaplingBlock.getPickStack
(BlockView world, BlockPos pos, BlockState state) Returns the new item stack when using pick block functionality.BigDripleafStemBlock.getPickStack
(BlockView world, BlockPos pos, BlockState state) Returns the new item stack when using pick block functionality.Block.getPickStack
(BlockView world, BlockPos pos, BlockState state) Returns the new item stack when using pick block functionality.CandleCakeBlock.getPickStack
(BlockView world, BlockPos pos, BlockState state) Returns the new item stack when using pick block functionality.CaveVinesBodyBlock.getPickStack
(BlockView world, BlockPos pos, BlockState state) Returns the new item stack when using pick block functionality.CaveVinesHeadBlock.getPickStack
(BlockView world, BlockPos pos, BlockState state) Returns the new item stack when using pick block functionality.CropBlock.getPickStack
(BlockView world, BlockPos pos, BlockState state) Returns the new item stack when using pick block functionality.EndGatewayBlock.getPickStack
(BlockView world, BlockPos pos, BlockState state) Returns the new item stack when using pick block functionality.EndPortalBlock.getPickStack
(BlockView world, BlockPos pos, BlockState state) Returns the new item stack when using pick block functionality.FlowerPotBlock.getPickStack
(BlockView world, BlockPos pos, BlockState state) Returns the new item stack when using pick block functionality.FrostedIceBlock.getPickStack
(BlockView world, BlockPos pos, BlockState state) Returns the new item stack when using pick block functionality.LightBlock.getPickStack
(BlockView world, BlockPos pos, BlockState state) Returns the new item stack when using pick block functionality.NetherPortalBlock.getPickStack
(BlockView world, BlockPos pos, BlockState state) Returns the new item stack when using pick block functionality.NetherWartBlock.getPickStack
(BlockView world, BlockPos pos, BlockState state) Returns the new item stack when using pick block functionality.PistonExtensionBlock.getPickStack
(BlockView world, BlockPos pos, BlockState state) Returns the new item stack when using pick block functionality.PistonHeadBlock.getPickStack
(BlockView world, BlockPos pos, BlockState state) Returns the new item stack when using pick block functionality.ShulkerBoxBlock.getPickStack
(BlockView world, BlockPos pos, BlockState state) Returns the new item stack when using pick block functionality.SpawnerBlock.getPickStack
(BlockView world, BlockPos pos, BlockState state) Returns the new item stack when using pick block functionality.StemBlock.getPickStack
(BlockView world, BlockPos pos, BlockState state) Returns the new item stack when using pick block functionality.SweetBerryBushBlock.getPickStack
(BlockView world, BlockPos pos, BlockState state) Returns the new item stack when using pick block functionality.TallSeagrassBlock.getPickStack
(BlockView world, BlockPos pos, BlockState state) Returns the new item stack when using pick block functionality.BubbleColumnBlock.tryDrainFluid
(WorldAccess world, BlockPos pos, BlockState state) FluidBlock.tryDrainFluid
(WorldAccess world, BlockPos pos, BlockState state) FluidDrainable.tryDrainFluid
(WorldAccess world, BlockPos pos, BlockState state) PowderSnowBlock.tryDrainFluid
(WorldAccess world, BlockPos pos, BlockState state) default ItemStack
Waterloggable.tryDrainFluid
(WorldAccess world, BlockPos pos, BlockState state) Modifier and TypeMethodDescriptionAbstractBlock.AbstractBlockState.getDroppedStacks
(LootContext.Builder builder) AbstractBlock.getDroppedStacks
(BlockState state, LootContext.Builder builder) Deprecated.BeehiveBlock.getDroppedStacks
(BlockState state, LootContext.Builder builder) Returns the block's dropped item stacks.Block.getDroppedStacks
(BlockState state, ServerWorld world, BlockPos pos, @Nullable BlockEntity blockEntity) Block.getDroppedStacks
(BlockState state, ServerWorld world, BlockPos pos, @Nullable BlockEntity blockEntity, @Nullable Entity entity, ItemStack stack) FluidBlock.getDroppedStacks
(BlockState state, LootContext.Builder builder) Returns the block's dropped item stacks.PistonExtensionBlock.getDroppedStacks
(BlockState state, LootContext.Builder builder) Returns the block's dropped item stacks.ShulkerBoxBlock.getDroppedStacks
(BlockState state, LootContext.Builder builder) Returns the block's dropped item stacks.WallPlayerSkullBlock.getDroppedStacks
(BlockState state, LootContext.Builder builder) Returns the block's dropped item stacks.Modifier and TypeMethodDescription(package private) static BlockState
ComposterBlock.addToComposter
(BlockState state, WorldAccess world, BlockPos pos, ItemStack item) void
BeehiveBlock.afterBreak
(World world, PlayerEntity player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, ItemStack stack) Called server-side when the block is broken by the player using correct tool.void
Block.afterBreak
(World world, PlayerEntity player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, ItemStack stack) Called server-side when the block is broken by the player using correct tool.void
IceBlock.afterBreak
(World world, PlayerEntity player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, ItemStack stack) Called server-side when the block is broken by the player using correct tool.void
TallPlantBlock.afterBreak
(World world, PlayerEntity player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, ItemStack stack) Called server-side when the block is broken by the player using correct tool.void
TurtleEggBlock.afterBreak
(World world, PlayerEntity player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, ItemStack stack) Called server-side when the block is broken by the player using correct tool.void
Block.appendTooltip
(ItemStack stack, @Nullable BlockView world, List<Text> tooltip, TooltipContext options) Appends tooltips to a stack of this block's corresponding block item.void
ShulkerBoxBlock.appendTooltip
(ItemStack stack, @Nullable BlockView world, List<Text> tooltip, TooltipContext options) Appends tooltips to a stack of this block's corresponding block item.static boolean
WitherSkullBlock.canDispense
(World world, BlockPos pos, ItemStack stack) boolean
ComposterBlock.ComposterInventory.canExtract
(int slot, ItemStack stack, Direction dir) Determines whether the given stack can be removed from this inventory at the specified slot position from the given direction.boolean
ComposterBlock.DummyInventory.canExtract
(int slot, ItemStack stack, Direction dir) Determines whether the given stack can be removed from this inventory at the specified slot position from the given direction.boolean
ComposterBlock.FullComposterInventory.canExtract
(int slot, ItemStack stack, Direction dir) Determines whether the given stack can be removed from this inventory at the specified slot position from the given direction.boolean
Determines whether the given stack can be inserted into this inventory at the specified slot position from the given direction.boolean
Determines whether the given stack can be inserted into this inventory at the specified slot position from the given direction.boolean
Determines whether the given stack can be inserted into this inventory at the specified slot position from the given direction.static BlockState
ComposterBlock.compost
(BlockState state, ServerWorld world, ItemStack stack, BlockPos pos) protected void
Block.dropExperienceWhenMined
(ServerWorld world, BlockPos pos, ItemStack tool, IntProvider experience) Drops experience orbs.private static void
Block.dropStack
(World world, Supplier<ItemEntity> itemEntitySupplier, ItemStack stack) static void
static void
static void
Block.dropStacks
(BlockState state, World world, BlockPos pos, @Nullable BlockEntity blockEntity, Entity entity, ItemStack stack) protected DispenserBehavior
DispenserBlock.getBehaviorForItem
(ItemStack stack) protected DispenserBehavior
DropperBlock.getBehaviorForItem
(ItemStack stack) Block.getDroppedStacks
(BlockState state, ServerWorld world, BlockPos pos, @Nullable BlockEntity blockEntity, @Nullable Entity entity, ItemStack stack) private static boolean
RespawnAnchorBlock.isChargeItem
(ItemStack stack) void
AbstractBannerBlock.onPlaced
(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) Called when the player placed the block.void
AbstractFurnaceBlock.onPlaced
(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) Called when the player placed the block.void
AbstractRedstoneGateBlock.onPlaced
(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) Called when the player placed the block.void
BarrelBlock.onPlaced
(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) Called when the player placed the block.void
BeaconBlock.onPlaced
(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) Called when the player placed the block.void
BedBlock.onPlaced
(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) Called when the player placed the block.void
Block.onPlaced
(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) Called when the player placed the block.void
BrewingStandBlock.onPlaced
(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) Called when the player placed the block.void
ChestBlock.onPlaced
(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) Called when the player placed the block.void
CommandBlock.onPlaced
(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) Called when the player placed the block.void
ConduitBlock.onPlaced
(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) Called when the player placed the block.void
DispenserBlock.onPlaced
(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) Called when the player placed the block.void
DoorBlock.onPlaced
(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) Called when the player placed the block.void
EnchantingTableBlock.onPlaced
(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) Called when the player placed the block.void
HopperBlock.onPlaced
(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) Called when the player placed the block.void
JukeboxBlock.onPlaced
(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) Called when the player placed the block.void
PistonBlock.onPlaced
(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) Called when the player placed the block.void
PlayerSkullBlock.onPlaced
(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) Called when the player placed the block.void
ShulkerBoxBlock.onPlaced
(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) Called when the player placed the block.void
SmallDripleafBlock.onPlaced
(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) Called when the player placed the block.void
StructureBlock.onPlaced
(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) Called when the player placed the block.void
TallPlantBlock.onPlaced
(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) Called when the player placed the block.void
TripwireHookBlock.onPlaced
(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) Called when the player placed the block.void
WallPlayerSkullBlock.onPlaced
(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) Called when the player placed the block.void
WallWitherSkullBlock.onPlaced
(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) Called when the player placed the block.void
WitherSkullBlock.onPlaced
(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) Called when the player placed the block.void
AbstractBlock.AbstractBlockState.onStacksDropped
(ServerWorld world, BlockPos pos, ItemStack stack, boolean dropExperience) void
AbstractBlock.onStacksDropped
(BlockState state, ServerWorld world, BlockPos pos, ItemStack stack, boolean dropExperience) void
InfestedBlock.onStacksDropped
(BlockState state, ServerWorld world, BlockPos pos, ItemStack stack, boolean dropExperience) Called server-side when the stacks are dropped by mining or explosion.void
OreBlock.onStacksDropped
(BlockState state, ServerWorld world, BlockPos pos, ItemStack stack, boolean dropExperience) Called server-side when the stacks are dropped by mining or explosion.void
RedstoneOreBlock.onStacksDropped
(BlockState state, ServerWorld world, BlockPos pos, ItemStack stack, boolean dropExperience) Called server-side when the stacks are dropped by mining or explosion.void
SculkCatalystBlock.onStacksDropped
(BlockState state, ServerWorld world, BlockPos pos, ItemStack stack, boolean dropExperience) Called server-side when the stacks are dropped by mining or explosion.void
SculkSensorBlock.onStacksDropped
(BlockState state, ServerWorld world, BlockPos pos, ItemStack stack, boolean dropExperience) Called server-side when the stacks are dropped by mining or explosion.void
SculkShriekerBlock.onStacksDropped
(BlockState state, ServerWorld world, BlockPos pos, ItemStack stack, boolean dropExperience) Called server-side when the stacks are dropped by mining or explosion.void
SpawnerBlock.onStacksDropped
(BlockState state, ServerWorld world, BlockPos pos, ItemStack stack, boolean dropExperience) Called server-side when the stacks are dropped by mining or explosion.private static void
LecternBlock.putBook
(@Nullable PlayerEntity player, World world, BlockPos pos, BlockState state, ItemStack stack) static boolean
LecternBlock.putBookIfAbsent
(@Nullable PlayerEntity player, World world, BlockPos pos, BlockState state, ItemStack stack) void
JukeboxBlock.setRecord
(@Nullable Entity user, WorldAccess world, BlockPos pos, BlockState state, ItemStack stack) Modifier and TypeMethodDescriptionvoid
Block.appendStacks
(ItemGroup group, DefaultedList<ItemStack> stacks) Appends the stacks of this block shown in the item group to the list.ModifierConstructorDescriptionprotected
EntityShapeContext
(boolean descending, double minY, ItemStack heldItem, Predicate<FluidState> walkOnFluidPredicate, @Nullable Entity entity) FullComposterInventory
(BlockState state, WorldAccess world, BlockPos pos, ItemStack outputItem) -
Uses of ItemStack in net.minecraft.block.cauldron
Modifier and TypeMethodDescriptionstatic ActionResult
CauldronBehavior.emptyCauldron
(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, ItemStack stack, ItemStack output, Predicate<BlockState> predicate, SoundEvent soundEvent) static ActionResult
CauldronBehavior.fillCauldron
(World world, BlockPos pos, PlayerEntity player, Hand hand, ItemStack stack, BlockState state, SoundEvent soundEvent) CauldronBehavior.interact
(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, ItemStack stack) -
Uses of ItemStack in net.minecraft.block.dispenser
Modifier and TypeMethodDescriptionDispenserBehavior.dispense
(BlockPointer pointer, ItemStack stack) final ItemStack
ItemDispenserBehavior.dispense
(BlockPointer pointer, ItemStack stack) protected ItemStack
BlockPlacementDispenserBehavior.dispenseSilently
(BlockPointer pointer, ItemStack stack) BoatDispenserBehavior.dispenseSilently
(BlockPointer pointer, ItemStack stack) protected ItemStack
ItemDispenserBehavior.dispenseSilently
(BlockPointer pointer, ItemStack stack) ProjectileDispenserBehavior.dispenseSilently
(BlockPointer pointer, ItemStack stack) protected ItemStack
ShearsDispenserBehavior.dispenseSilently
(BlockPointer pointer, ItemStack stack) Modifier and TypeMethodDescriptionprotected abstract ProjectileEntity
ProjectileDispenserBehavior.createProjectile
(World world, Position position, ItemStack stack) Creates the entity that will be spawned in front of the dispenser.DispenserBehavior.dispense
(BlockPointer pointer, ItemStack stack) final ItemStack
ItemDispenserBehavior.dispense
(BlockPointer pointer, ItemStack stack) protected ItemStack
BlockPlacementDispenserBehavior.dispenseSilently
(BlockPointer pointer, ItemStack stack) BoatDispenserBehavior.dispenseSilently
(BlockPointer pointer, ItemStack stack) protected ItemStack
ItemDispenserBehavior.dispenseSilently
(BlockPointer pointer, ItemStack stack) ProjectileDispenserBehavior.dispenseSilently
(BlockPointer pointer, ItemStack stack) protected ItemStack
ShearsDispenserBehavior.dispenseSilently
(BlockPointer pointer, ItemStack stack) static void
ItemDispenserBehavior.spawnItem
(World world, ItemStack stack, int speed, Direction side, Position pos) -
Uses of ItemStack in net.minecraft.block.entity
Modifier and TypeFieldDescription(package private) ItemStack
LecternBlockEntity.book
private ItemStack
JukeboxBlockEntity.record
Modifier and TypeFieldDescriptionprotected DefaultedList<ItemStack>
AbstractFurnaceBlockEntity.inventory
private DefaultedList<ItemStack>
BarrelBlockEntity.inventory
private DefaultedList<ItemStack>
BrewingStandBlockEntity.inventory
private DefaultedList<ItemStack>
ChestBlockEntity.inventory
private DefaultedList<ItemStack>
DispenserBlockEntity.inventory
private DefaultedList<ItemStack>
HopperBlockEntity.inventory
private DefaultedList<ItemStack>
ShulkerBoxBlockEntity.inventory
private final DefaultedList<ItemStack>
CampfireBlockEntity.itemsBeingCooked
Modifier and TypeMethodDescriptionLecternBlockEntity.getBook()
BannerBlockEntity.getPickStack()
JukeboxBlockEntity.getRecord()
AbstractFurnaceBlockEntity.getStack
(int slot) Fetches the stack currently stored at the given slot.BrewingStandBlockEntity.getStack
(int slot) Fetches the stack currently stored at the given slot.LootableContainerBlockEntity.getStack
(int slot) Fetches the stack currently stored at the given slot.AbstractFurnaceBlockEntity.removeStack
(int slot) Removes the stack currently stored at the indicated slot.AbstractFurnaceBlockEntity.removeStack
(int slot, int amount) Removes a specific number of items from the given slot.BrewingStandBlockEntity.removeStack
(int slot) Removes the stack currently stored at the indicated slot.BrewingStandBlockEntity.removeStack
(int slot, int amount) Removes a specific number of items from the given slot.HopperBlockEntity.removeStack
(int slot, int amount) Removes a specific number of items from the given slot.LootableContainerBlockEntity.removeStack
(int slot) Removes the stack currently stored at the indicated slot.LootableContainerBlockEntity.removeStack
(int slot, int amount) Removes a specific number of items from the given slot.private ItemStack
LecternBlockEntity.resolveBook
(ItemStack book, @Nullable PlayerEntity player) private static ItemStack
HopperBlockEntity.transfer
(@Nullable Inventory from, Inventory to, ItemStack stack, int slot, @Nullable Direction side) static ItemStack
HopperBlockEntity.transfer
(@Nullable Inventory from, Inventory to, ItemStack stack, @Nullable Direction side) Modifier and TypeMethodDescriptionprotected DefaultedList<ItemStack>
BarrelBlockEntity.getInvStackList()
protected DefaultedList<ItemStack>
ChestBlockEntity.getInvStackList()
protected DefaultedList<ItemStack>
DispenserBlockEntity.getInvStackList()
protected DefaultedList<ItemStack>
HopperBlockEntity.getInvStackList()
protected abstract DefaultedList<ItemStack>
LootableContainerBlockEntity.getInvStackList()
protected DefaultedList<ItemStack>
ShulkerBoxBlockEntity.getInvStackList()
CampfireBlockEntity.getItemsBeingCooked()
Modifier and TypeMethodDescriptionboolean
int
DispenserBlockEntity.addToFirstFreeSlot
(ItemStack stack) boolean
AbstractFurnaceBlockEntity.canExtract
(int slot, ItemStack stack, Direction dir) Determines whether the given stack can be removed from this inventory at the specified slot position from the given direction.boolean
BrewingStandBlockEntity.canExtract
(int slot, ItemStack stack, Direction dir) Determines whether the given stack can be removed from this inventory at the specified slot position from the given direction.private static boolean
HopperBlockEntity.canExtract
(Inventory inv, ItemStack stack, int slot, Direction facing) boolean
ShulkerBoxBlockEntity.canExtract
(int slot, ItemStack stack, Direction dir) Determines whether the given stack can be removed from this inventory at the specified slot position from the given direction.boolean
Determines whether the given stack can be inserted into this inventory at the specified slot position from the given direction.boolean
Determines whether the given stack can be inserted into this inventory at the specified slot position from the given direction.private static boolean
HopperBlockEntity.canInsert
(Inventory inventory, ItemStack stack, int slot, @Nullable Direction side) boolean
Determines whether the given stack can be inserted into this inventory at the specified slot position from the given direction.private static boolean
HopperBlockEntity.canMergeItems
(ItemStack first, ItemStack second) static boolean
AbstractFurnaceBlockEntity.canUseAsFuel
(ItemStack stack) protected int
AbstractFurnaceBlockEntity.getFuelTime
(ItemStack fuel) protected int
BlastFurnaceBlockEntity.getFuelTime
(ItemStack fuel) protected int
SmokerBlockEntity.getFuelTime
(ItemStack fuel) static int
BannerBlockEntity.getPatternCount
(ItemStack stack) BannerBlockEntity.getPatternListNbt
(ItemStack stack) CampfireBlockEntity.getRecipeFor
(ItemStack stack) boolean
Returns whether the given stack is a valid for the indicated slot position.boolean
Returns whether the given stack is a valid for the indicated slot position.static void
BannerBlockEntity.loadFromItemStack
(ItemStack stack) void
void
private ItemStack
LecternBlockEntity.resolveBook
(ItemStack book, @Nullable PlayerEntity player) void
void
LecternBlockEntity.setBook
(ItemStack book, @Nullable PlayerEntity player) void
void
void
void
void
void
BlockEntity.setStackNbt
(ItemStack stack) Setsstack
'snet.minecraft.item.BlockItem#BLOCK_ENTITY_TAG_KEY
NBT value to the block entity's NBT data.private static ItemStack
HopperBlockEntity.transfer
(@Nullable Inventory from, Inventory to, ItemStack stack, int slot, @Nullable Direction side) static ItemStack
HopperBlockEntity.transfer
(@Nullable Inventory from, Inventory to, ItemStack stack, @Nullable Direction side) Modifier and TypeMethodDescriptionprivate static boolean
AbstractFurnaceBlockEntity.canAcceptRecipeOutput
(@Nullable Recipe<?> recipe, DefaultedList<ItemStack> slots, int count) private static boolean
BrewingStandBlockEntity.canCraft
(DefaultedList<ItemStack> slots) private static void
BrewingStandBlockEntity.craft
(World world, BlockPos pos, DefaultedList<ItemStack> slots) private static boolean
AbstractFurnaceBlockEntity.craftRecipe
(@Nullable Recipe<?> recipe, DefaultedList<ItemStack> slots, int count) protected void
BarrelBlockEntity.setInvStackList
(DefaultedList<ItemStack> list) protected void
ChestBlockEntity.setInvStackList
(DefaultedList<ItemStack> list) protected void
DispenserBlockEntity.setInvStackList
(DefaultedList<ItemStack> list) protected void
HopperBlockEntity.setInvStackList
(DefaultedList<ItemStack> list) protected abstract void
LootableContainerBlockEntity.setInvStackList
(DefaultedList<ItemStack> list) protected void
ShulkerBoxBlockEntity.setInvStackList
(DefaultedList<ItemStack> list) -
Uses of ItemStack in net.minecraft.client
Modifier and TypeMethodDescriptionprivate ItemStack
MinecraftClient.addBlockEntityNbt
(ItemStack stack, BlockEntity blockEntity) Modifier and TypeMethodDescriptionprivate ItemStack
MinecraftClient.addBlockEntityNbt
(ItemStack stack, BlockEntity blockEntity) -
Uses of ItemStack in net.minecraft.client.color.item
-
Uses of ItemStack in net.minecraft.client.gui.hud
Modifier and TypeMethodDescriptionprivate void
InGameHud.renderHotbarItem
(int x, int y, float tickDelta, PlayerEntity player, ItemStack stack, int seed) -
Uses of ItemStack in net.minecraft.client.gui.screen
Modifier and TypeFieldDescription(package private) final ItemStack
GameModeSelectionScreen.GameModeSelection.icon
Modifier and TypeMethodDescriptionprivate ItemStack
CustomizeFlatLevelScreen.SuperflatLayersListWidget.SuperflatLayerEntry.createItemStackFor
(BlockState state) Modifier and TypeMethodDescriptionScreen.getTooltipFromItem
(ItemStack stack) private void
CustomizeFlatLevelScreen.SuperflatLayersListWidget.SuperflatLayerEntry.renderIcon
(MatrixStack matrices, int x, int y, ItemStack iconItem) protected void
Screen.renderTooltip
(MatrixStack matrices, ItemStack stack, int x, int y) ModifierConstructorDescriptionprivate
GameModeSelection
(Text text, String command, ItemStack icon) -
Uses of ItemStack in net.minecraft.client.gui.screen.advancement
Modifier and TypeMethodDescriptionvoid
AdvancementTabType.drawIcon
(int x, int y, int index, ItemRenderer itemRenderer, ItemStack icon) -
Uses of ItemStack in net.minecraft.client.gui.screen.ingame
Modifier and TypeFieldDescriptionprivate ItemStack
LoomScreen.banner
private ItemStack
LoomScreen.dye
private final ItemStack
BookEditScreen.itemStack
private ItemStack
LoomScreen.pattern
private ItemStack
HandledScreen.quickMovingStack
private ItemStack
EnchantmentScreen.stack
private ItemStack
HandledScreen.touchDragStack
private ItemStack
HandledScreen.touchDropReturningStack
Modifier and TypeFieldDescriptionfinal DefaultedList<ItemStack>
CreativeInventoryScreen.CreativeScreenHandler.itemList
Modifier and TypeMethodDescriptionCreativeInventoryScreen.CreativeScreenHandler.getCursorStack()
CreativeInventoryScreen.CreativeSlot.getStack()
CreativeInventoryScreen.CreativeSlot.takeStack
(int amount) CreativeInventoryScreen.CreativeScreenHandler.transferSlot
(PlayerEntity player, int index) Transfers (or "quick-moves") the stack at slotindex
to other slots of the screen handler that belong to a different inventory.Modifier and TypeMethodDescriptionboolean
boolean
CreativeInventoryScreen.CreativeScreenHandler.canInsertIntoSlot
(ItemStack stack, Slot slot) Returns whetherstack
can be inserted toslot
.static BookScreen.Contents
private void
int
CreativeInventoryScreen.CreativeSlot.getMaxItemCount
(ItemStack stack) void
AnvilScreen.onSlotUpdate
(ScreenHandler handler, int slotId, ItemStack stack) void
CreativeInventoryListener.onSlotUpdate
(ScreenHandler handler, int slotId, ItemStack stack) void
ForgingScreen.onSlotUpdate
(ScreenHandler handler, int slotId, ItemStack stack) void
CreativeInventoryScreen.CreativeSlot.onTakeItem
(PlayerEntity player, ItemStack stack) private void
MerchantScreen.renderFirstBuyItem
(MatrixStack matrices, ItemStack adjustedFirstBuyItem, ItemStack originalFirstBuyItem, int x, int y) protected void
CreativeInventoryScreen.renderTooltip
(MatrixStack matrices, ItemStack stack, int x, int y) void
CreativeInventoryScreen.CreativeScreenHandler.setCursorStack
(ItemStack stack) void
Sets the slot's stack tostack
and marks the slot as dirty.ModifierConstructorDescriptionBookEditScreen
(PlayerEntity player, ItemStack itemStack, Hand hand) WritableBookContents
(ItemStack stack) WrittenBookContents
(ItemStack stack) -
Uses of ItemStack in net.minecraft.client.gui.screen.recipebook
Modifier and TypeFieldDescriptionfinal ItemStack[]
RecipeAlternativesWidget.AlternativeButtonWidget.InputSlot.stacks
-
Uses of ItemStack in net.minecraft.client.gui.tooltip
Modifier and TypeFieldDescriptionprivate final DefaultedList<ItemStack>
BundleTooltipComponent.inventory
-
Uses of ItemStack in net.minecraft.client.item
Modifier and TypeFieldDescriptionprivate final DefaultedList<ItemStack>
BundleTooltipData.inventory
Modifier and TypeMethodDescriptionfloat
ModelPredicateProvider.call
(ItemStack stack, @Nullable ClientWorld world, @Nullable LivingEntity entity, int seed) Deprecated.default float
UnclampedModelPredicateProvider.call
(ItemStack stack, @Nullable ClientWorld world, @Nullable LivingEntity entity, int seed) Deprecated.private float
CompassAnglePredicateProvider.getAngle
(ItemStack stack, ClientWorld world, int seed, Entity entity) CompassAnglePredicateProvider.CompassTarget.getPos
(ClientWorld world, ItemStack stack, Entity entity) float
CompassAnglePredicateProvider.unclampedCall
(ItemStack stack, @Nullable ClientWorld world, @Nullable LivingEntity entity, int seed) float
UnclampedModelPredicateProvider.unclampedCall
(ItemStack stack, @Nullable ClientWorld world, @Nullable LivingEntity entity, int seed) ModifierConstructorDescriptionBundleTooltipData
(DefaultedList<ItemStack> inventory, int bundleOccupancy) -
Uses of ItemStack in net.minecraft.client.network
Modifier and TypeMethodDescriptionprivate static ItemStack
ClientPlayNetworkHandler.getActiveTotemOfUndying
(PlayerEntity player) Modifier and TypeMethodDescriptionvoid
ClientPlayerInteractionManager.clickCreativeStack
(ItemStack stack, int slotId) void
ClientPlayerInteractionManager.dropCreativeStack
(ItemStack stack) void
ClientPlayerEntity.onPickupSlotClick
(ItemStack cursorStack, ItemStack slotStack, ClickType clickType) Called when a player performs apickup slot action
in a screen handler.void
Called when the player uses (defaults to right click) a writable or written book item. -
Uses of ItemStack in net.minecraft.client.option
Modifier and TypeFieldDescriptionprivate final DefaultedList<ItemStack>
HotbarStorageEntry.delegate
-
Uses of ItemStack in net.minecraft.client.particle
ModifierConstructorDescription(package private)
CrackParticle
(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, ItemStack stack) protected
CrackParticle
(ClientWorld world, double x, double y, double z, ItemStack stack) -
Uses of ItemStack in net.minecraft.client.recipebook
-
Uses of ItemStack in net.minecraft.client.render
Modifier and TypeMethodDescriptionstatic RenderLayer
RenderLayers.getItemLayer
(ItemStack stack, boolean direct) void
GameRenderer.showFloatingItem
(ItemStack floatingItem) -
Uses of ItemStack in net.minecraft.client.render.entity
Modifier and TypeMethodDescriptionprivate ModelIdentifier
ItemFrameEntityRenderer.getModelId
(T entity, ItemStack stack) private int
ItemEntityRenderer.getRenderedAmount
(ItemStack stack) -
Uses of ItemStack in net.minecraft.client.render.entity.feature
Modifier and TypeMethodDescriptionprotected void
HeldItemFeatureRenderer.renderItem
(LivingEntity entity, ItemStack stack, ModelTransformation.Mode transformationMode, Arm arm, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light) protected void
PlayerHeldItemFeatureRenderer.renderItem
(LivingEntity entity, ItemStack stack, ModelTransformation.Mode transformationMode, Arm arm, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light) private void
PlayerHeldItemFeatureRenderer.renderSpyglass
(LivingEntity entity, ItemStack stack, Arm arm, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light) -
Uses of ItemStack in net.minecraft.client.render.item
Modifier and TypeFieldDescriptionprivate ItemStack
HeldItemRenderer.mainHand
private ItemStack
HeldItemRenderer.offHand
Modifier and TypeMethodDescriptionprivate void
HeldItemRenderer.applyEatOrDrinkTransformation
(MatrixStack matrices, float tickDelta, Arm arm, ItemStack stack) ItemRenderer.getModel
(ItemStack stack, @Nullable World world, @Nullable LivingEntity entity, int seed) private void
ItemRenderer.innerRenderInGui
(@Nullable LivingEntity entity, ItemStack stack, int x, int y, int seed) private void
ItemRenderer.innerRenderInGui
(@Nullable LivingEntity entity, ItemStack itemStack, int x, int y, int seed, int depth) private static boolean
HeldItemRenderer.isChargedCrossbow
(ItemStack stack) void
BuiltinModelItemRenderer.render
(ItemStack stack, ModelTransformation.Mode mode, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) private void
ItemRenderer.renderBakedItemModel
(BakedModel model, ItemStack stack, int light, int overlay, MatrixStack matrices, VertexConsumer vertices) private void
ItemRenderer.renderBakedItemQuads
(MatrixStack matrices, VertexConsumer vertices, List<BakedQuad> quads, ItemStack stack, int light, int overlay) private void
HeldItemRenderer.renderFirstPersonItem
(AbstractClientPlayerEntity player, float tickDelta, float pitch, Hand hand, float swingProgress, ItemStack item, float equipProgress, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light) private void
HeldItemRenderer.renderFirstPersonMap
(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int swingProgress, ItemStack stack) void
ItemRenderer.renderGuiItemIcon
(ItemStack stack, int x, int y) protected void
ItemRenderer.renderGuiItemModel
(ItemStack stack, int x, int y, BakedModel model) void
ItemRenderer.renderGuiItemOverlay
(TextRenderer renderer, ItemStack stack, int x, int y) Renders the overlay for items in GUIs, including the damage bar and the item count.void
ItemRenderer.renderGuiItemOverlay
(TextRenderer renderer, ItemStack stack, int x, int y, @Nullable String countLabel) Renders the overlay for items in GUIs, including the damage bar and the item count.void
ItemRenderer.renderInGui
(ItemStack stack, int x, int y) Renders an item in a GUI without an attached entity.void
ItemRenderer.renderInGuiWithOverrides
(LivingEntity entity, ItemStack stack, int x, int y, int seed) Renders an item in a GUI with an attached entity.void
ItemRenderer.renderInGuiWithOverrides
(ItemStack stack, int x, int y) Renders an item in a GUI with the player as the attached entity for calculating model overrides.void
ItemRenderer.renderInGuiWithOverrides
(ItemStack stack, int x, int y, int seed) void
ItemRenderer.renderInGuiWithOverrides
(ItemStack stack, int x, int y, int seed, int depth) void
HeldItemRenderer.renderItem
(LivingEntity entity, ItemStack stack, ModelTransformation.Mode renderMode, boolean leftHanded, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light) void
ItemRenderer.renderItem
(@Nullable LivingEntity entity, ItemStack item, ModelTransformation.Mode renderMode, boolean leftHanded, MatrixStack matrices, VertexConsumerProvider vertexConsumers, @Nullable World world, int light, int overlay, int seed) void
ItemRenderer.renderItem
(ItemStack stack, ModelTransformation.Mode renderMode, boolean leftHanded, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay, BakedModel model) void
ItemRenderer.renderItem
(ItemStack stack, ModelTransformation.Mode transformationType, int light, int overlay, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int seed) private void
HeldItemRenderer.renderMapInOneHand
(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, float equipProgress, Arm arm, float swingProgress, ItemStack stack) -
Uses of ItemStack in net.minecraft.client.render.model.json
Modifier and TypeMethodDescriptionModelOverrideList.apply
(BakedModel model, ItemStack stack, @Nullable ClientWorld world, @Nullable LivingEntity entity, int seed) -
Uses of ItemStack in net.minecraft.client.search
Modifier and TypeFieldDescriptionstatic final SearchManager.Key<ItemStack>
SearchManager.ITEM_TAG
static final SearchManager.Key<ItemStack>
SearchManager.ITEM_TOOLTIP
-
Uses of ItemStack in net.minecraft.client.tutorial
Modifier and TypeMethodDescriptionvoid
BundleTutorial.onPickupSlotClick
(ItemStack cursorStack, ItemStack slotStack, ClickType clickType) A callback for starting the bundle tutorial.void
TutorialManager.onPickupSlotClick
(ItemStack cursorStack, ItemStack slotStack, ClickType clickType) Called when a player performs apickup slot action
in a screen handler.void
CraftPlanksTutorialStepHandler.onSlotUpdate
(ItemStack stack) void
FindTreeTutorialStepHandler.onSlotUpdate
(ItemStack stack) void
PunchTreeTutorialStepHandler.onSlotUpdate
(ItemStack stack) void
TutorialManager.onSlotUpdate
(ItemStack stack) default void
TutorialStepHandler.onSlotUpdate
(ItemStack stack) -
Uses of ItemStack in net.minecraft.command.argument
Modifier and TypeMethodDescriptionItemStackArgument.createStack
(int amount, boolean checkOverstack) Modifier and TypeMethodDescriptionItemPredicateArgumentType.getItemStackPredicate
(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, String name) -
Uses of ItemStack in net.minecraft.enchantment
Modifier and TypeMethodDescriptionstatic ItemStack
Enchants thetarget
item stack and returns it.Modifier and TypeMethodDescriptionstatic Map.Entry<EquipmentSlot,
ItemStack> EnchantmentHelper.chooseEquipmentWith
(Enchantment enchantment, LivingEntity entity) Returns a pair of an equipment slot and the item stack in the supplied entity's slot.static Map.Entry<EquipmentSlot,
ItemStack> EnchantmentHelper.chooseEquipmentWith
(Enchantment enchantment, LivingEntity entity, Predicate<ItemStack> condition) Returns a pair of an equipment slot and the item stack in the supplied entity's slot.Enchantment.getEquipment
(LivingEntity entity) Modifier and TypeMethodDescriptionstatic int
EnchantmentHelper.calculateRequiredExperienceLevel
(Random random, int slotIndex, int bookshelfCount, ItemStack stack) Returns the required experience level for an enchanting option in the enchanting table's screen, or the enchantment screen.static ItemStack
Enchants thetarget
item stack and returns it.private static void
EnchantmentHelper.forEachEnchantment
(EnchantmentHelper.Consumer consumer, ItemStack stack) static List<EnchantmentLevelEntry>
EnchantmentHelper.generateEnchantments
(Random random, ItemStack stack, int level, boolean treasureAllowed) Generate the enchantments for enchanting thestack
.static Map<Enchantment,
Integer> Gets the enchantments on an item stack.static float
EnchantmentHelper.getAttackDamage
(ItemStack stack, EntityGroup group) static int
EnchantmentHelper.getLevel
(Enchantment enchantment, ItemStack stack) Gets the level of an enchantment on an item stack.static int
EnchantmentHelper.getLoyalty
(ItemStack stack) static int
EnchantmentHelper.getLuckOfTheSea
(ItemStack stack) static int
static List<EnchantmentLevelEntry>
EnchantmentHelper.getPossibleEntries
(int power, ItemStack stack, boolean treasureAllowed) Gets all the possible entries for enchanting thestack
at the givenpower
.static int
EnchantmentHelper.getRiptide
(ItemStack stack) static boolean
EnchantmentHelper.hasBindingCurse
(ItemStack stack) static boolean
EnchantmentHelper.hasChanneling
(ItemStack stack) static boolean
EnchantmentHelper.hasVanishingCurse
(ItemStack stack) boolean
DamageEnchantment.isAcceptableItem
(ItemStack stack) boolean
EfficiencyEnchantment.isAcceptableItem
(ItemStack stack) boolean
Enchantment.isAcceptableItem
(ItemStack stack) boolean
ThornsEnchantment.isAcceptableItem
(ItemStack stack) boolean
UnbreakingEnchantment.isAcceptableItem
(ItemStack stack) static void
EnchantmentHelper.set
(Map<Enchantment, Integer> enchantments, ItemStack stack) Sets the enchantments on an item stack.static boolean
UnbreakingEnchantment.shouldPreventDamage
(ItemStack item, int level, Random random) Modifier and TypeMethodDescriptionstatic Map.Entry<EquipmentSlot,
ItemStack> EnchantmentHelper.chooseEquipmentWith
(Enchantment enchantment, LivingEntity entity, Predicate<ItemStack> condition) Returns a pair of an equipment slot and the item stack in the supplied entity's slot.private static void
EnchantmentHelper.forEachEnchantment
(EnchantmentHelper.Consumer consumer, Iterable<ItemStack> stacks) static int
EnchantmentHelper.getProtectionAmount
(Iterable<ItemStack> equipment, DamageSource source) -
Uses of ItemStack in net.minecraft.entity
Modifier and TypeFieldDescriptionEntity.EMPTY_STACK_LIST
private static final TrackedData<ItemStack>
EyeOfEnderEntity.ITEM
private static final TrackedData<ItemStack>
ItemEntity.STACK
private final DefaultedList<ItemStack>
LivingEntity.syncedArmorStacks
private final DefaultedList<ItemStack>
LivingEntity.syncedHandStacks
Modifier and TypeMethodDescriptionLivingEntity.getActiveItem()
LivingEntity.getArrowType
(ItemStack stack) Bucketable.getBucketItem()
abstract ItemStack
LivingEntity.getEquippedStack
(EquipmentSlot slot) LivingEntity.getMainHandStack()
LivingEntity.getOffHandStack()
Entity.getPickBlockStack()
Returns the stack for creative "pick block" functionality, ornull
if there is none.EyeOfEnderEntity.getStack()
FlyingItemEntity.getStack()
ItemEntity.getStack()
Returns the item stack contained in this item entity.LivingEntity.getStackInHand
(Hand hand) private ItemStack
LivingEntity.getSyncedArmorStack
(EquipmentSlot slot) private ItemStack
LivingEntity.getSyncedHandStack
(EquipmentSlot slot) private ItemStack
EyeOfEnderEntity.getTrackedItem()
static ItemStack
Modifier and TypeMethodDescriptionEntity.getArmorItems()
Returns an iterable of item stacks equipped as armor.LivingEntity.getArmorItems()
Returns an iterable of item stacks equipped as armor.private @Nullable Map<EquipmentSlot,
ItemStack> LivingEntity.getEquipmentChanges()
Returns the difference between the last sent equipment set and the current one.Entity.getHandItems()
Returns an iterable of item stacks held in the hands.Entity.getItemsEquipped()
Returns an iterable of item stacks held in the hands or equipped as armor.Modifier and TypeMethodDescriptionprivate void
LivingEntity.applyFoodEffects
(ItemStack stack, World world, LivingEntity targetEntity) boolean
static boolean
static void
Bucketable.copyDataToStack
(MobEntity entity, ItemStack stack) Deprecated.void
Bucketable.copyDataToStack
(ItemStack stack) Dropsstack
at the entity's position.Dropsstack
at the entity's position with the given Y offset.void
Entity.equipStack
(EquipmentSlot slot, ItemStack stack) Equipsstack
atslot
.This is also used to set an entity's mainhand or offhand stack.abstract void
LivingEntity.equipStack
(EquipmentSlot slot, ItemStack stack) Equipsstack
atslot
.This is also used to set an entity's mainhand or offhand stack.LivingEntity.getArrowType
(ItemStack stack) protected SoundEvent
LivingEntity.getDrinkSound
(ItemStack stack) LivingEntity.getEatSound
(ItemStack stack) static EquipmentSlot
LivingEntity.getPreferredEquipmentSlot
(ItemStack stack) private static void
ItemEntity.merge
(ItemEntity targetEntity, ItemStack targetStack, ItemEntity sourceEntity, ItemStack sourceStack) private static void
ItemEntity.merge
(ItemEntity targetEntity, ItemStack stack1, ItemStack stack2) static ItemStack
void
LivingEntity.onEquipStack
(EquipmentSlot slot, ItemStack oldStack, ItemStack newStack) private void
LivingEntity.playEquipmentBreakEffects
(ItemStack stack) protected void
LivingEntity.playEquipSound
(ItemStack stack) protected void
LivingEntity.processEquippedStack
(ItemStack stack) void
void
Sets the item stack contained in this item entity tostack
.void
LivingEntity.setStackInHand
(Hand hand, ItemStack stack) private void
LivingEntity.setSyncedArmorStack
(EquipmentSlot slot, ItemStack armor) private void
LivingEntity.setSyncedHandStack
(EquipmentSlot slot, ItemStack stack) void
CrossbowUser.shoot
(LivingEntity target, ItemStack crossbow, ProjectileEntity projectile, float multiShotSpray) protected void
LivingEntity.spawnConsumptionEffects
(ItemStack stack, int particleCount) EntityType.spawnFromItemStack
(ServerWorld world, @Nullable ItemStack stack, @Nullable PlayerEntity player, BlockPos pos, SpawnReason spawnReason, boolean alignPosition, boolean invertY) private void
LivingEntity.spawnItemParticles
(ItemStack stack, int count) protected void
LivingEntity.tickItemStackUsage
(ItemStack stack) Modifier and TypeMethodDescriptionprivate void
LivingEntity.checkHandStackSwap
(Map<EquipmentSlot, ItemStack> equipmentChanges) Notifies nearby players if the stacks in the hands have been swapped.boolean
Checks if this entity is holding a certain item.private void
LivingEntity.sendEquipmentChanges
(Map<EquipmentSlot, ItemStack> equipmentChanges) Sends equipment changes to nearby players.ModifierConstructorDescriptionItemEntity
(World world, double x, double y, double z, ItemStack stack) ItemEntity
(World world, double x, double y, double z, ItemStack stack, double velocityX, double velocityY, double velocityZ) -
Uses of ItemStack in net.minecraft.entity.ai.brain.sensor
-
Uses of ItemStack in net.minecraft.entity.ai.brain.task
Modifier and TypeMethodDescriptionprivate ItemStack
CelebrateRaidWinTask.createFirework
(DyeColor color, int flight) Modifier and TypeMethodDescriptionstatic void
LookTargetUtil.give
(LivingEntity entity, ItemStack stack, Vec3d targetLocation) static void
LookTargetUtil.give
(LivingEntity entity, ItemStack stack, Vec3d targetLocation, Vec3d velocityFactor, float yOffset) private static void
HoldTradeOffersTask.holdOffer
(VillagerEntity villager, ItemStack stack) static void
GiveInventoryToLookTargetTask.playThrowSound
(LivingEntity entity, ItemStack stack, Vec3d target) private void
GiveInventoryToLookTargetTask.triggerCriterion
(LookTarget target, ItemStack stack, ServerPlayerEntity player) -
Uses of ItemStack in net.minecraft.entity.ai.goal
Modifier and TypeMethodDescriptionprivate ItemStack
SkeletonHorseTrapTriggerGoal.removeEnchantments
(ItemStack stack) Modifier and TypeMethodDescriptionprivate ItemStack
SkeletonHorseTrapTriggerGoal.removeEnchantments
(ItemStack stack) ModifierConstructorDescriptionHoldInHandsGoal
(T actor, ItemStack item, @Nullable SoundEvent sound, Predicate<? super T> condition) -
Uses of ItemStack in net.minecraft.entity.data
Modifier and TypeFieldDescriptionstatic final TrackedDataHandler<ItemStack>
TrackedDataHandlerRegistry.ITEM_STACK
-
Uses of ItemStack in net.minecraft.entity.decoration
Modifier and TypeFieldDescriptionprivate final DefaultedList<ItemStack>
ArmorStandEntity.armorItems
private final DefaultedList<ItemStack>
ArmorStandEntity.heldItems
private static final TrackedData<ItemStack>
ItemFrameEntity.ITEM_STACK
Modifier and TypeMethodDescriptionprotected ItemStack
GlowItemFrameEntity.getAsItemStack()
protected ItemStack
ItemFrameEntity.getAsItemStack()
ArmorStandEntity.getEquippedStack
(EquipmentSlot slot) ItemFrameEntity.getHeldItemStack()
ArmorStandEntity.getPickBlockStack()
Returns the stack for creative "pick block" functionality, ornull
if there is none.EndCrystalEntity.getPickBlockStack()
Returns the stack for creative "pick block" functionality, ornull
if there is none.ItemFrameEntity.getPickBlockStack()
Returns the stack for creative "pick block" functionality, ornull
if there is none.LeashKnotEntity.getPickBlockStack()
Returns the stack for creative "pick block" functionality, ornull
if there is none.Modifier and TypeMethodDescriptionArmorStandEntity.getArmorItems()
Returns an iterable of item stacks equipped as armor.ArmorStandEntity.getHandItems()
Returns an iterable of item stacks held in the hands.Modifier and TypeMethodDescriptionboolean
Dropsstack
at the entity's position with the given Y offset.private boolean
ArmorStandEntity.equip
(PlayerEntity player, EquipmentSlot slot, ItemStack stack, Hand hand) void
ArmorStandEntity.equipStack
(EquipmentSlot slot, ItemStack stack) Equipsstack
atslot
.This is also used to set an entity's mainhand or offhand stack.private void
ItemFrameEntity.removeFromFrame
(ItemStack itemStack) private void
ItemFrameEntity.setAsStackHolder
(ItemStack stack) void
ItemFrameEntity.setHeldItemStack
(ItemStack stack) void
ItemFrameEntity.setHeldItemStack
(ItemStack value, boolean update) -
Uses of ItemStack in net.minecraft.entity.decoration.painting
Modifier and TypeMethodDescriptionPaintingEntity.getPickBlockStack()
Returns the stack for creative "pick block" functionality, ornull
if there is none. -
Uses of ItemStack in net.minecraft.entity.mob
Modifier and TypeFieldDescriptionprivate final DefaultedList<ItemStack>
MobEntity.armorItems
private final DefaultedList<ItemStack>
MobEntity.handItems
Modifier and TypeMethodDescriptionprotected ItemStack
HostileEntity.getArrowType
(ItemStack stack) MobEntity.getEquippedStack
(EquipmentSlot slot) private static ItemStack
PiglinBrain.getItemFromStack
(ItemEntity stack) MobEntity.getPickBlockStack()
Returns the stack for creative "pick block" functionality, ornull
if there is none.protected ItemStack
DrownedEntity.getSkull()
Returns the item stack this entity will drop when killed by a charged creeper.protected ItemStack
HuskEntity.getSkull()
Returns the item stack this entity will drop when killed by a charged creeper.protected ItemStack
ZombieEntity.getSkull()
Returns the item stack this entity will drop when killed by a charged creeper.protected ItemStack
ZombieVillagerEntity.getSkull()
Returns the item stack this entity will drop when killed by a charged creeper.protected ItemStack
ZombifiedPiglinEntity.getSkull()
Returns the item stack this entity will drop when killed by a charged creeper.private ItemStack
PiglinEntity.makeInitialWeapon()
Modifier and TypeMethodDescriptionMobEntity.getArmorItems()
Returns an iterable of item stacks equipped as armor.PiglinBrain.getBarteredItem
(PiglinEntity piglin) MobEntity.getHandItems()
Returns an iterable of item stacks held in the hands.Modifier and TypeMethodDescriptionprivate static boolean
PiglinBrain.acceptsForBarter
(ItemStack stack) protected ItemStack
private static void
PiglinBrain.barterItem
(PiglinEntity piglin, ItemStack stack) boolean
protected boolean
PiglinEntity.canEquipStack
(ItemStack stack) Returns whether this piglin can equip into or replace current equipment slot.boolean
protected static boolean
PiglinBrain.canGather
(PiglinEntity piglin, ItemStack stack) boolean
boolean
boolean
boolean
protected boolean
PiglinEntity.canInsertIntoInventory
(ItemStack stack) boolean
MobEntity.canPickupItem
(ItemStack stack) boolean
ZombieEntity.canPickupItem
(ItemStack stack) protected PersistentProjectileEntity
AbstractSkeletonEntity.createArrowProjectile
(ItemStack arrow, float damageModifier) protected PersistentProjectileEntity
StrayEntity.createArrowProjectile
(ItemStack arrow, float damageModifier) protected PersistentProjectileEntity
WitherSkeletonEntity.createArrowProjectile
(ItemStack arrow, float damageModifier) private void
MobEntity.disablePlayerShield
(PlayerEntity player, ItemStack mobStack, ItemStack playerStack) private void
PiglinEntity.equipAtChance
(EquipmentSlot slot, ItemStack stack, Random random) protected void
MobEntity.equipLootStack
(EquipmentSlot slot, ItemStack stack) void
AbstractSkeletonEntity.equipStack
(EquipmentSlot slot, ItemStack stack) Equipsstack
atslot
.This is also used to set an entity's mainhand or offhand stack.void
MobEntity.equipStack
(EquipmentSlot slot, ItemStack stack) Equipsstack
atslot
.This is also used to set an entity's mainhand or offhand stack.protected void
PiglinEntity.equipToMainHand
(ItemStack stack) protected void
PiglinEntity.equipToOffHand
(ItemStack stack) HostileEntity.getArrowType
(ItemStack stack) boolean
HoglinEntity.isBreedingItem
(ItemStack stack) private static boolean
protected static boolean
PiglinBrain.isGoldenItem
(ItemStack stack) private boolean
PillagerEntity.isRaidCaptain
(ItemStack stack) protected static boolean
PiglinBrain.isWillingToTrade
(PiglinEntity piglin, ItemStack nearbyItems) boolean
MobEntity.prefersNewDamageableItem
(ItemStack newStack, ItemStack oldStack) protected boolean
DrownedEntity.prefersNewEquipment
(ItemStack newStack, ItemStack oldStack) protected boolean
MobEntity.prefersNewEquipment
(ItemStack newStack, ItemStack oldStack) protected boolean
PiglinEntity.prefersNewEquipment
(ItemStack newStack, ItemStack oldStack) void
PiglinEntity.shoot
(LivingEntity target, ItemStack crossbow, ProjectileEntity projectile, float multiShotSpray) void
PillagerEntity.shoot
(LivingEntity target, ItemStack crossbow, ProjectileEntity projectile, float multiShotSpray) private static void
PiglinBrain.swapItemWithOffHand
(PiglinEntity piglin, ItemStack stack) boolean
Modifier and TypeMethodDescriptionprivate static void
PiglinBrain.doBarter
(PiglinEntity piglin, List<ItemStack> items) private static void
PiglinBrain.drop
(PiglinEntity piglin, List<ItemStack> items, Vec3d pos) private static void
PiglinBrain.dropBarteredItem
(PiglinEntity piglin, List<ItemStack> items) private static void
PiglinBrain.dropBarteredItem
(PiglinEntity piglin, PlayerEntity player, List<ItemStack> items) -
Uses of ItemStack in net.minecraft.entity.passive
Modifier and TypeMethodDescriptionHorseEntity.getArmorType()
AxolotlEntity.getBucketItem()
CodEntity.getBucketItem()
PufferfishEntity.getBucketItem()
SalmonEntity.getBucketItem()
TadpoleEntity.getBucketItem()
TropicalFishEntity.getBucketItem()
GoatEntity.getGoatHornStack()
Modifier and TypeMethodDescriptionprivate boolean
private boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
FoxEntity.canPickupItem
(ItemStack stack) void
AxolotlEntity.copyDataToStack
(ItemStack stack) void
FishEntity.copyDataToStack
(ItemStack stack) void
TadpoleEntity.copyDataToStack
(ItemStack stack) void
TropicalFishEntity.copyDataToStack
(ItemStack stack) private void
TadpoleEntity.decrementItem
(PlayerEntity player, ItemStack stack) private void
AllayEntity.decrementStackUnlessInCreative
(PlayerEntity player, ItemStack stack) private void
protected void
AnimalEntity.eat
(PlayerEntity player, Hand hand, ItemStack stack) protected void
AxolotlEntity.eat
(PlayerEntity player, Hand hand, ItemStack stack) protected void
CatEntity.eat
(PlayerEntity player, Hand hand, ItemStack stack) protected void
FoxEntity.eat
(PlayerEntity player, Hand hand, ItemStack stack) private void
TadpoleEntity.eatSlimeBall
(PlayerEntity player, ItemStack stack) private void
HorseEntity.equipArmor
(ItemStack stack) LlamaEntity.getColorFromCarpet
(ItemStack color) protected SoundEvent
WanderingTraderEntity.getDrinkSound
(ItemStack stack) FoxEntity.getEatSound
(ItemStack stack) GoatEntity.getEatSound
(ItemStack stack) private Optional<Pair<StatusEffect,
Integer>> MooshroomEntity.getStewEffectFrom
(ItemStack flower) AbstractHorseEntity.interactHorse
(PlayerEntity player, ItemStack stack) boolean
AbstractHorseEntity.isBreedingItem
(ItemStack stack) boolean
AnimalEntity.isBreedingItem
(ItemStack stack) boolean
AxolotlEntity.isBreedingItem
(ItemStack stack) boolean
BeeEntity.isBreedingItem
(ItemStack stack) boolean
CatEntity.isBreedingItem
(ItemStack stack) boolean
ChickenEntity.isBreedingItem
(ItemStack stack) boolean
FoxEntity.isBreedingItem
(ItemStack stack) boolean
FrogEntity.isBreedingItem
(ItemStack stack) boolean
LlamaEntity.isBreedingItem
(ItemStack stack) boolean
OcelotEntity.isBreedingItem
(ItemStack stack) boolean
PandaEntity.isBreedingItem
(ItemStack stack) boolean
ParrotEntity.isBreedingItem
(ItemStack stack) boolean
PigEntity.isBreedingItem
(ItemStack stack) boolean
PolarBearEntity.isBreedingItem
(ItemStack stack) boolean
RabbitEntity.isBreedingItem
(ItemStack stack) boolean
StriderEntity.isBreedingItem
(ItemStack stack) boolean
TurtleEntity.isBreedingItem
(ItemStack stack) boolean
WolfEntity.isBreedingItem
(ItemStack stack) boolean
AbstractHorseEntity.isHorseArmor
(ItemStack item) Whether the given item stack is valid for this horse's armor slot.boolean
HorseEntity.isHorseArmor
(ItemStack item) Whether the given item stack is valid for this horse's armor slot.boolean
LlamaEntity.isHorseArmor
(ItemStack item) Whether the given item stack is valid for this horse's armor slot.private boolean
TadpoleEntity.isSlimeBall
(ItemStack stack) private static boolean
RabbitEntity.isTempting
(ItemStack stack) private boolean
AllayEntity.matchesDuplicationIngredient
(ItemStack stack) void
MerchantEntity.onSellingItem
(ItemStack stack) protected boolean
AbstractHorseEntity.receiveFood
(PlayerEntity player, ItemStack item) protected boolean
LlamaEntity.receiveFood
(PlayerEntity player, ItemStack item) private void
HorseEntity.setArmorTypeFromStack
(ItemStack stack) private void
private void
DolphinEntity.PlayWithItemsGoal.spitOutItem
(ItemStack stack) Modifier and TypeMethodDescriptionprivate StackReference
AbstractHorseEntity.createInventoryStackReference
(int slot, Predicate<ItemStack> predicate) -
Uses of ItemStack in net.minecraft.entity.player
Modifier and TypeFieldDescriptionfinal DefaultedList<ItemStack>
PlayerInventory.armor
private final List<DefaultedList<ItemStack>>
PlayerInventory.combinedInventory
final DefaultedList<ItemStack>
PlayerInventory.main
final DefaultedList<ItemStack>
PlayerInventory.offHand
Modifier and TypeMethodDescriptionPlayerInventory.dropSelectedItem
(boolean entireStack) PlayerInventory.getArmorStack
(int slot) PlayerEntity.getArrowType
(ItemStack stack) PlayerEntity.getEquippedStack
(EquipmentSlot slot) PlayerInventory.getMainHandStack()
PlayerInventory.getStack
(int slot) Fetches the stack currently stored at the given slot.PlayerInventory.removeStack
(int slot) Removes the stack currently stored at the indicated slot.PlayerInventory.removeStack
(int slot, int amount) Removes a specific number of items from the given slot.Modifier and TypeMethodDescriptionPlayerEntity.getArmorItems()
Returns an iterable of item stacks equipped as armor.PlayerEntity.getHandItems()
Returns an iterable of item stacks held in the hands.Modifier and TypeMethodDescriptionvoid
PlayerInventory.addPickBlock
(ItemStack stack) private int
private int
void
PlayerEntity.applyEnchantmentCosts
(ItemStack enchantedItem, int experienceLevels) boolean
boolean
PlayerEntity.canPlaceOn
(BlockPos pos, Direction facing, ItemStack stack) private boolean
PlayerInventory.canStackAddMore
(ItemStack existingStack, ItemStack stack) boolean
void
void
PlayerEntity.equipStack
(EquipmentSlot slot, ItemStack stack) Equipsstack
atslot
.This is also used to set an entity's mainhand or offhand stack.PlayerEntity.getArrowType
(ItemStack stack) int
PlayerInventory.getOccupiedSlotWithRoomForStack
(ItemStack stack) int
PlayerInventory.getSlotWithStack
(ItemStack stack) boolean
PlayerEntity.giveItemStack
(ItemStack stack) int
Given the item stack to search for, returns the equivalent slot index with a matching stack that is all of: not damaged, not enchanted, and not renamed.boolean
PlayerInventory.insertStack
(int slot, ItemStack stack) boolean
PlayerInventory.insertStack
(ItemStack stack) void
void
PlayerInventory.offerOrDrop
(ItemStack stack) void
PlayerEntity.onPickupSlotClick
(ItemStack cursorStack, ItemStack slotStack, ClickType clickType) Called when a player performs apickup slot action
in a screen handler.void
void
void
Called when the player uses (defaults to right click) a writable or written book item. -
Uses of ItemStack in net.minecraft.entity.projectile
Modifier and TypeFieldDescriptionprivate static final TrackedData<ItemStack>
AbstractFireballEntity.ITEM
private static final TrackedData<ItemStack>
FireworkRocketEntity.ITEM
Modifier and TypeMethodDescriptionprotected ItemStack
ArrowEntity.asItemStack()
protected abstract ItemStack
PersistentProjectileEntity.asItemStack()
protected ItemStack
SpectralArrowEntity.asItemStack()
protected ItemStack
TridentEntity.asItemStack()
protected ItemStack
AbstractFireballEntity.getItem()
AbstractFireballEntity.getStack()
FireworkRocketEntity.getStack()
Modifier and TypeMethodDescriptionstatic PersistentProjectileEntity
ProjectileUtil.createArrowProjectile
(LivingEntity entity, ItemStack stack, float damageModifier) static int
ArrowEntity.getCustomPotionColor
(ItemStack stack) void
ArrowEntity.initFromStack
(ItemStack stack) void
int
ModifierConstructorDescriptionFireworkRocketEntity
(World world, double x, double y, double z, ItemStack stack) FireworkRocketEntity
(World world, @Nullable Entity entity, double x, double y, double z, ItemStack stack) FireworkRocketEntity
(World world, ItemStack stack, double x, double y, double z, boolean shotAtAngle) FireworkRocketEntity
(World world, ItemStack stack, Entity entity, double x, double y, double z, boolean shotAtAngle) FireworkRocketEntity
(World world, ItemStack stack, LivingEntity shooter) TridentEntity
(World world, LivingEntity owner, ItemStack stack) -
Uses of ItemStack in net.minecraft.entity.projectile.thrown
Modifier and TypeFieldDescriptionprivate static final TrackedData<ItemStack>
ThrownItemEntity.ITEM
Modifier and TypeMethodDescriptionprotected ItemStack
ThrownItemEntity.getItem()
ThrownItemEntity.getStack()
Modifier and TypeMethodDescriptionprivate void
PotionEntity.applyLingeringPotion
(ItemStack stack, Potion potion) void
-
Uses of ItemStack in net.minecraft.entity.vehicle
Modifier and TypeFieldDescriptionprivate DefaultedList<ItemStack>
ChestBoatEntity.inventory
private DefaultedList<ItemStack>
StorageMinecartEntity.inventory
Modifier and TypeMethodDescriptiondefault ItemStack
VehicleInventory.getInventoryStack
(int slot) AbstractMinecartEntity.getPickBlockStack()
Returns the stack for creative "pick block" functionality, ornull
if there is none.BoatEntity.getPickBlockStack()
Returns the stack for creative "pick block" functionality, ornull
if there is none.ChestBoatEntity.getStack
(int slot) Fetches the stack currently stored at the given slot.StorageMinecartEntity.getStack
(int slot) Fetches the stack currently stored at the given slot.default ItemStack
VehicleInventory.removeInventoryStack
(int slot) default ItemStack
VehicleInventory.removeInventoryStack
(int slot, int amount) ChestBoatEntity.removeStack
(int slot) Removes the stack currently stored at the indicated slot.ChestBoatEntity.removeStack
(int slot, int amount) Removes a specific number of items from the given slot.StorageMinecartEntity.removeStack
(int slot) Removes the stack currently stored at the indicated slot.StorageMinecartEntity.removeStack
(int slot, int amount) Removes a specific number of items from the given slot.Modifier and TypeMethodDescriptionChestBoatEntity.getInventory()
StorageMinecartEntity.getInventory()
VehicleInventory.getInventory()
-
Uses of ItemStack in net.minecraft.inventory
Modifier and TypeFieldDescriptionprivate final DefaultedList<ItemStack>
CraftingInventory.stacks
private final DefaultedList<ItemStack>
CraftingResultInventory.stacks
private final DefaultedList<ItemStack>
SimpleInventory.stacks
Modifier and TypeMethodDescriptionStackReference.get()
Gets the current item stack.CraftingInventory.getStack
(int slot) Fetches the stack currently stored at the given slot.CraftingResultInventory.getStack
(int slot) Fetches the stack currently stored at the given slot.DoubleInventory.getStack
(int slot) Fetches the stack currently stored at the given slot.Inventory.getStack
(int slot) Fetches the stack currently stored at the given slot.SimpleInventory.getStack
(int slot) Fetches the stack currently stored at the given slot.SimpleInventory.removeItem
(Item item, int count) Searches this inventory for the specified item and removes the given amount from this inventory.CraftingInventory.removeStack
(int slot) Removes the stack currently stored at the indicated slot.CraftingInventory.removeStack
(int slot, int amount) Removes a specific number of items from the given slot.CraftingResultInventory.removeStack
(int slot) Removes the stack currently stored at the indicated slot.CraftingResultInventory.removeStack
(int slot, int amount) Removes a specific number of items from the given slot.DoubleInventory.removeStack
(int slot) Removes the stack currently stored at the indicated slot.DoubleInventory.removeStack
(int slot, int amount) Removes a specific number of items from the given slot.static ItemStack
Inventories.removeStack
(List<ItemStack> stacks, int slot) Inventory.removeStack
(int slot) Removes the stack currently stored at the indicated slot.Inventory.removeStack
(int slot, int amount) Removes a specific number of items from the given slot.SimpleInventory.removeStack
(int slot) Removes the stack currently stored at the indicated slot.SimpleInventory.removeStack
(int slot, int amount) Removes a specific number of items from the given slot.static ItemStack
Inventories.splitStack
(List<ItemStack> stacks, int slot, int amount) Modifier and TypeMethodDescriptionSimpleInventory.clearToList()
Clears this inventory and return all the non-empty stacks in a list.Modifier and TypeMethodDescriptionprivate void
SimpleInventory.addToExistingSlot
(ItemStack stack) private void
SimpleInventory.addToNewSlot
(ItemStack stack) boolean
SidedInventory.canExtract
(int slot, ItemStack stack, Direction dir) Determines whether the given stack can be removed from this inventory at the specified slot position from the given direction.boolean
Determines whether the given stack can be inserted into this inventory at the specified slot position from the given direction.boolean
boolean
Returns true if this lock can be opened with the key item stack.boolean
Returns whether the given stack is a valid for the indicated slot position.default boolean
Returns whether the given stack is a valid for the indicated slot position.static int
Inventories.remove
(ItemStack stack, Predicate<ItemStack> shouldRemove, int maxCount, boolean dryRun) Removes a number, not exceedingmaxCount
, of items from an item stack based on a predicate and returns that number.boolean
Sets thestack
.void
void
void
void
void
private void
Modifier and TypeMethodDescriptiondefault boolean
Inventory.containsAny
(Predicate<ItemStack> predicate) static StackReference
StackReference.of
(LivingEntity entity, EquipmentSlot slot, Predicate<ItemStack> filter) Creates a stack reference backed by an equipment slot of a living entity and guarded by a condition for setting stacks into the inventory.static StackReference
Creates a stack reference backed by an index within an inventory and guarded by a condition for setting stacks into the inventory.static void
Inventories.readNbt
(NbtCompound nbt, DefaultedList<ItemStack> stacks) static int
Inventories.remove
(Inventory inventory, Predicate<ItemStack> shouldRemove, int maxCount, boolean dryRun) Removes a number, not exceedingmaxCount
, of items from an inventory based on a predicate and returns that number.static int
Inventories.remove
(ItemStack stack, Predicate<ItemStack> shouldRemove, int maxCount, boolean dryRun) Removes a number, not exceedingmaxCount
, of items from an item stack based on a predicate and returns that number.static ItemStack
Inventories.removeStack
(List<ItemStack> stacks, int slot) static ItemStack
Inventories.splitStack
(List<ItemStack> stacks, int slot, int amount) static NbtCompound
Inventories.writeNbt
(NbtCompound nbt, DefaultedList<ItemStack> stacks) static NbtCompound
Inventories.writeNbt
(NbtCompound nbt, DefaultedList<ItemStack> stacks, boolean setIfEmpty) -
Uses of ItemStack in net.minecraft.item
Modifier and TypeFieldDescriptionstatic final ItemStack
ItemStack.EMPTY
The empty item stack that holds no item.private ItemStack
ItemGroup.icon
private final ItemStack
ItemUsageContext.stack
Modifier and TypeFieldDescriptionRangedWeaponItem.BOW_PROJECTILES
static final com.mojang.serialization.Codec<ItemStack>
ItemStack.CODEC
RangedWeaponItem.CROSSBOW_HELD_PROJECTILES
Modifier and TypeMethodDescriptionstatic ItemStack
DyeableItem.blendAndSetColor
(ItemStack stack, List<DyeItem> colors) ItemStack.copy()
Returns a copy of this item stack, including the item count, NBT, and bobbing animation time.abstract ItemStack
ItemGroup.createIcon()
static ItemStack
FilledMapItem.createMap
(World world, int x, int z, byte scale, boolean showIcons, boolean unlimitedTracking) static ItemStack
ItemUsage.exchangeStack
(ItemStack inputStack, PlayerEntity player, ItemStack outputStack) Returns the stack to put in the player's hand after exchanging stacks.static ItemStack
ItemUsage.exchangeStack
(ItemStack inputStack, PlayerEntity player, ItemStack outputStack, boolean creativeOverride) Returns the stack to put in the player's hand after exchanging stacks.protected ItemStack
GlassBottleItem.fill
(ItemStack stack, PlayerEntity player, ItemStack outputStack) ChorusFruitItem.finishUsing
(ItemStack stack, World world, LivingEntity user) Called when an entity finishes using the item, such as eating food or drinking a potion.HoneyBottleItem.finishUsing
(ItemStack stack, World world, LivingEntity user) Called when an entity finishes using the item, such as eating food or drinking a potion.Item.finishUsing
(ItemStack stack, World world, LivingEntity user) Called when an entity finishes using the item, such as eating food or drinking a potion.ItemStack.finishUsing
(World world, LivingEntity user) MilkBucketItem.finishUsing
(ItemStack stack, World world, LivingEntity user) Called when an entity finishes using the item, such as eating food or drinking a potion.PotionItem.finishUsing
(ItemStack stack, World world, LivingEntity user) Called when an entity finishes using the item, such as eating food or drinking a potion.SpyglassItem.finishUsing
(ItemStack stack, World world, LivingEntity user) Called when an entity finishes using the item, such as eating food or drinking a potion.StewItem.finishUsing
(ItemStack stack, World world, LivingEntity user) Called when an entity finishes using the item, such as eating food or drinking a potion.SuspiciousStewItem.finishUsing
(ItemStack stack, World world, LivingEntity user) Called when an entity finishes using the item, such as eating food or drinking a potion.static ItemStack
EnchantedBookItem.forEnchantment
(EnchantmentLevelEntry info) static ItemStack
ItemStack.fromNbt
(NbtCompound nbt) Returns the item stack deserialized from the NBT, orEMPTY
if it fails to deserialize.FireworkRocketItem.getDefaultStack()
Returns the default stack for this item.Item.getDefaultStack()
Returns the default stack for this item.PotionItem.getDefaultStack()
Returns the default stack for this item.TippedArrowItem.getDefaultStack()
Returns the default stack for this item.static ItemStack
BucketItem.getEmptiedStack
(ItemStack stack, PlayerEntity player) static ItemStack
RangedWeaponItem.getHeldProjectile
(LivingEntity entity, Predicate<ItemStack> predicate) ItemGroup.getIcon()
ItemUsageContext.getStack()
static ItemStack
GoatHornItem.getStackForInstrument
(Item item, RegistryEntry<Instrument> instrument) ItemStack.setCustomName
(@Nullable Text name) Sets the custom name of this item stack toname
.ItemStack.split
(int amount) Returns the copy of the stack "split" from the current stack with item count being at mostamount
.Modifier and TypeMethodDescriptionstatic TypedActionResult<ItemStack>
ItemUsage.consumeHeldItem
(World world, PlayerEntity player, Hand hand) Consumes the item thatplayer
holds.BundleItem.getBundledStacks
(ItemStack stack) CrossbowItem.getHeldProjectiles()
RangedWeaponItem.getHeldProjectiles()
BowItem.getProjectiles()
CrossbowItem.getProjectiles()
CrossbowItem.getProjectiles
(ItemStack crossbow) RangedWeaponItem.getProjectiles()
BundleItem.removeFirstStack
(ItemStack stack) ArmorItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.BoatItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.BowItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.BucketItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.BundleItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.CrossbowItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.EggItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.ElytraItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.EmptyMapItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.EnderEyeItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.EnderPearlItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.ExperienceBottleItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.FireworkRocketItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.FishingRodItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.GlassBottleItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.GoatHornItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.HoneyBottleItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.Item.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.ItemStack.use
(World world, PlayerEntity user, Hand hand) KnowledgeBookItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.LingeringPotionItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.MilkBucketItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.OnAStickItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.PlaceableOnWaterItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.PotionItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.ShieldItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.SnowballItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.SpawnEggItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.SplashPotionItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.SpyglassItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.ThrowablePotionItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.TridentItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.WritableBookItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.WrittenBookItem.use
(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.Modifier and TypeMethodDescriptionstatic void
SuspiciousStewItem.addEffectToStew
(ItemStack stew, StatusEffect effect, int duration) static void
EnchantedBookItem.addEnchantment
(ItemStack stack, EnchantmentLevelEntry entry) private static int
BundleItem.addToBundle
(ItemStack bundle, ItemStack stack) static void
BannerItem.appendBannerTooltip
(ItemStack stack, List<Text> tooltip) void
AirBlockItem.appendTooltip
(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) Called by the client to append tooltips to an item.void
BannerItem.appendTooltip
(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) Called by the client to append tooltips to an item.void
BannerPatternItem.appendTooltip
(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) Called by the client to append tooltips to an item.void
BlockItem.appendTooltip
(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) Called by the client to append tooltips to an item.void
BundleItem.appendTooltip
(ItemStack stack, World world, List<Text> tooltip, TooltipContext context) Called by the client to append tooltips to an item.void
CrossbowItem.appendTooltip
(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) Called by the client to append tooltips to an item.void
DiscFragmentItem.appendTooltip
(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) Called by the client to append tooltips to an item.void
EnchantedBookItem.appendTooltip
(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) Called by the client to append tooltips to an item.void
EntityBucketItem.appendTooltip
(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) Called by the client to append tooltips to an item.void
FilledMapItem.appendTooltip
(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) Called by the client to append tooltips to an item.void
FireworkRocketItem.appendTooltip
(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) Called by the client to append tooltips to an item.void
FireworkStarItem.appendTooltip
(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) Called by the client to append tooltips to an item.void
GoatHornItem.appendTooltip
(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) Called by the client to append tooltips to an item.void
Item.appendTooltip
(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) Called by the client to append tooltips to an item.void
LingeringPotionItem.appendTooltip
(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) Called by the client to append tooltips to an item.void
MusicDiscItem.appendTooltip
(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) Called by the client to append tooltips to an item.void
PotionItem.appendTooltip
(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) Called by the client to append tooltips to an item.void
ShieldItem.appendTooltip
(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) Called by the client to append tooltips to an item.void
TippedArrowItem.appendTooltip
(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) Called by the client to append tooltips to an item.void
WrittenBookItem.appendTooltip
(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) Called by the client to append tooltips to an item.static boolean
Returns whether the given item stacks are equal, including the item count and NBT.static boolean
ItemStack.areItemsEqual
(ItemStack left, ItemStack right) Returns whether the given item stacks' items are equal.static boolean
ItemStack.areItemsEqualIgnoreDamage
(ItemStack left, ItemStack right) static boolean
ItemStack.areNbtEqual
(ItemStack left, ItemStack right) Returns whether the given item stacks have equivalent NBT data.static ItemStack
DyeableItem.blendAndSetColor
(ItemStack stack, List<DyeItem> colors) static boolean
ItemStack.canCombine
(ItemStack stack, ItemStack otherStack) Returns whether the given item stacks' items and NBT are equal.private static Optional<NbtCompound>
BundleItem.canMergeStack
(ItemStack stack, NbtList items) protected boolean
DecorationItem.canPlaceOn
(PlayerEntity player, Direction side, ItemStack stack, BlockPos pos) protected boolean
ItemFrameItem.canPlaceOn
(PlayerEntity player, Direction side, ItemStack stack, BlockPos pos) boolean
Returns whetherstack
can be repaired usingingredient
.boolean
Returns whetherstack
can be repaired usingingredient
.boolean
Returns whetherstack
can be repaired usingingredient
.boolean
Returns whetherstack
can be repaired usingingredient
.boolean
Returns whetherstack
can be repaired usingingredient
.boolean
BlockPredicatesChecker.check
(ItemStack stack, Registry<Block> blockRegistry, CachedBlockPosition pos) Returns true if any of the predicates in thestack
's NBT matched against the block atpos
, false otherwise.private static void
CrossbowItem.clearProjectiles
(ItemStack crossbow) static void
ArrowItem.createArrow
(World world, ItemStack stack, LivingEntity shooter) private static PersistentProjectileEntity
CrossbowItem.createArrow
(World world, LivingEntity entity, ItemStack crossbow, ItemStack arrow) SpectralArrowItem.createArrow
(World world, ItemStack stack, LivingEntity shooter) private static void
FilledMapItem.createMapState
(ItemStack stack, World world, int x, int z, int scale, boolean showIcons, boolean unlimitedTracking, RegistryKey<World> dimension) FilledMapItem.createSyncPacket
(ItemStack stack, World world, PlayerEntity player) Creates a packet that syncs additional item data to the client.NetworkSyncedItem.createSyncPacket
(ItemStack stack, World world, PlayerEntity player) Creates a packet that syncs additional item data to the client.static boolean
ArmorItem.dispenseArmor
(BlockPointer pointer, ItemStack armor) private static boolean
BundleItem.dropAllBundledItems
(ItemStack stack, PlayerEntity player) static ItemStack
ItemUsage.exchangeStack
(ItemStack inputStack, PlayerEntity player, ItemStack outputStack) Returns the stack to put in the player's hand after exchanging stacks.static ItemStack
ItemUsage.exchangeStack
(ItemStack inputStack, PlayerEntity player, ItemStack outputStack, boolean creativeOverride) Returns the stack to put in the player's hand after exchanging stacks.protected ItemStack
GlassBottleItem.fill
(ItemStack stack, PlayerEntity player, ItemStack outputStack) static void
FilledMapItem.fillExplorationMap
(ServerWorld world, ItemStack map) ChorusFruitItem.finishUsing
(ItemStack stack, World world, LivingEntity user) Called when an entity finishes using the item, such as eating food or drinking a potion.HoneyBottleItem.finishUsing
(ItemStack stack, World world, LivingEntity user) Called when an entity finishes using the item, such as eating food or drinking a potion.Item.finishUsing
(ItemStack stack, World world, LivingEntity user) Called when an entity finishes using the item, such as eating food or drinking a potion.MilkBucketItem.finishUsing
(ItemStack stack, World world, LivingEntity user) Called when an entity finishes using the item, such as eating food or drinking a potion.PotionItem.finishUsing
(ItemStack stack, World world, LivingEntity user) Called when an entity finishes using the item, such as eating food or drinking a potion.SpyglassItem.finishUsing
(ItemStack stack, World world, LivingEntity user) Called when an entity finishes using the item, such as eating food or drinking a potion.StewItem.finishUsing
(ItemStack stack, World world, LivingEntity user) Called when an entity finishes using the item, such as eating food or drinking a potion.SuspiciousStewItem.finishUsing
(ItemStack stack, World world, LivingEntity user) Called when an entity finishes using the item, such as eating food or drinking a potion.static float
BundleItem.getAmountFilled
(ItemStack stack) static @Nullable NbtCompound
BlockItem.getBlockEntityNbt
(ItemStack stack) BundleItem.getBundledStacks
(ItemStack stack) private static int
BundleItem.getBundleOccupancy
(ItemStack stack) default int
static DyeColor
static ItemStack
BucketItem.getEmptiedStack
(ItemStack stack, PlayerEntity player) static NbtList
EnchantedBookItem.getEnchantmentNbt
(ItemStack stack) static int
WrittenBookItem.getGeneration
(ItemStack stack) private Optional<RegistryEntry<Instrument>>
GoatHornItem.getInstrument
(ItemStack stack) int
BundleItem.getItemBarColor
(ItemStack stack) Returns the RGB color of the item bar, usually used for durability display.int
Item.getItemBarColor
(ItemStack stack) Returns the RGB color of the item bar, usually used for durability display.int
BundleItem.getItemBarStep
(ItemStack stack) Returns the step, or the length of the colored area of the item bar, forstack
.int
Item.getItemBarStep
(ItemStack stack) Returns the step, or the length of the colored area of the item bar, forstack
.private static int
BundleItem.getItemOccupancy
(ItemStack stack) static int
FilledMapItem.getMapColor
(ItemStack stack) int
BowItem.getMaxUseTime
(ItemStack stack) Returns the maximum use (right-click) time of this item, in ticks.int
CrossbowItem.getMaxUseTime
(ItemStack stack) Returns the maximum use (right-click) time of this item, in ticks.int
GoatHornItem.getMaxUseTime
(ItemStack stack) Returns the maximum use (right-click) time of this item, in ticks.int
HoneyBottleItem.getMaxUseTime
(ItemStack stack) Returns the maximum use (right-click) time of this item, in ticks.int
Item.getMaxUseTime
(ItemStack stack) Returns the maximum use (right-click) time of this item, in ticks.int
MilkBucketItem.getMaxUseTime
(ItemStack stack) Returns the maximum use (right-click) time of this item, in ticks.int
PotionItem.getMaxUseTime
(ItemStack stack) Returns the maximum use (right-click) time of this item, in ticks.int
ShieldItem.getMaxUseTime
(ItemStack stack) Returns the maximum use (right-click) time of this item, in ticks.int
SpyglassItem.getMaxUseTime
(ItemStack stack) Returns the maximum use (right-click) time of this item, in ticks.int
TridentItem.getMaxUseTime
(ItemStack stack) Returns the maximum use (right-click) time of this item, in ticks.float
Item.getMiningSpeedMultiplier
(ItemStack stack, BlockState state) Returns the multiplier applied to the mining speed ofstack
when miningstate
.float
MiningToolItem.getMiningSpeedMultiplier
(ItemStack stack, BlockState state) Returns the multiplier applied to the mining speed ofstack
when miningstate
.float
ShearsItem.getMiningSpeedMultiplier
(ItemStack stack, BlockState state) Returns the multiplier applied to the mining speed ofstack
when miningstate
.float
SwordItem.getMiningSpeedMultiplier
(ItemStack stack, BlockState state) Returns the multiplier applied to the mining speed ofstack
when miningstate
.FilledMapItem.getOrCreateMapState
(ItemStack map, World world) static int
WrittenBookItem.getPageCount
(ItemStack stack) CrossbowItem.getProjectiles
(ItemStack crossbow) private static float
CrossbowItem.getPullProgress
(int useTicks, ItemStack stack) static int
CrossbowItem.getPullTime
(ItemStack stack) Returns this item's rarity, which changes the color of its name.private static float
BundleItem.getTooltipData
(ItemStack stack) Item.getTooltipData
(ItemStack stack) CompassItem.getTranslationKey
(ItemStack stack) Gets the translation key of this item using the provided item stack for context.Item.getTranslationKey
(ItemStack stack) Gets the translation key of this item using the provided item stack for context.PotionItem.getTranslationKey
(ItemStack stack) Gets the translation key of this item using the provided item stack for context.ShieldItem.getTranslationKey
(ItemStack stack) Gets the translation key of this item using the provided item stack for context.TippedArrowItem.getTranslationKey
(ItemStack stack) Gets the translation key of this item using the provided item stack for context.BowItem.getUseAction
(ItemStack stack) Returns the use action the item should perform.CrossbowItem.getUseAction
(ItemStack stack) Returns the use action the item should perform.GoatHornItem.getUseAction
(ItemStack stack) Returns the use action the item should perform.HoneyBottleItem.getUseAction
(ItemStack stack) Returns the use action the item should perform.Item.getUseAction
(ItemStack stack) Returns the use action the item should perform.MilkBucketItem.getUseAction
(ItemStack stack) Returns the use action the item should perform.PotionItem.getUseAction
(ItemStack stack) Returns the use action the item should perform.ShieldItem.getUseAction
(ItemStack stack) Returns the use action the item should perform.SpyglassItem.getUseAction
(ItemStack stack) Returns the use action the item should perform.TridentItem.getUseAction
(ItemStack stack) Returns the use action the item should perform.default boolean
boolean
Checks if the glint effect should be applied when the item is rendered.boolean
Checks if the glint effect should be applied when the item is rendered.boolean
Checks if the glint effect should be applied when the item is rendered.boolean
Checks if the glint effect should be applied when the item is rendered.boolean
Checks if the glint effect should be applied when the item is rendered.boolean
Checks if the glint effect should be applied when the item is rendered.boolean
Checks if the glint effect should be applied when the item is rendered.boolean
Checks if the glint effect should be applied when the item is rendered.boolean
Checks if the glint effect should be applied when the item is rendered.boolean
Checks if the glint effect should be applied when the item is rendered.static boolean
CompassItem.hasLodestone
(ItemStack stack) static boolean
CrossbowItem.hasProjectile
(ItemStack crossbow, Item projectile) void
CompassItem.inventoryTick
(ItemStack stack, World world, Entity entity, int slot, boolean selected) Called on both the client and the server every tick if the item is in the player's inventory.void
FilledMapItem.inventoryTick
(ItemStack stack, World world, Entity entity, int slot, boolean selected) Called on both the client and the server every tick if the item is in the player's inventory.void
Item.inventoryTick
(ItemStack stack, World world, Entity entity, int slot, boolean selected) Called on both the client and the server every tick if the item is in the player's inventory.static boolean
boolean
BookItem.isEnchantable
(ItemStack stack) Returns whether the givenItemStack
is enchantable.boolean
EnchantedBookItem.isEnchantable
(ItemStack stack) Returns whether the givenItemStack
is enchantable.boolean
Item.isEnchantable
(ItemStack stack) Returns whether the givenItemStack
is enchantable.private boolean
Returns whether this stack andstack
are equal, including the item count and NBT.boolean
BundleItem.isItemBarVisible
(ItemStack stack) Returns whether to show the item bar forstack
.boolean
Item.isItemBarVisible
(ItemStack stack) Returns whether to show the item bar forstack
.boolean
ItemStack.isItemEqual
(ItemStack stack) Returns whether this stack andstack
hold the same item.boolean
ItemStack.isItemEqualIgnoreDamage
(ItemStack stack) static boolean
boolean
CrossbowItem.isUsedOnRelease
(ItemStack stack) boolean
Item.isUsedOnRelease
(ItemStack stack) private static boolean
CrossbowItem.loadProjectile
(LivingEntity shooter, ItemStack crossbow, ItemStack projectile, boolean simulated, boolean creative) private static boolean
CrossbowItem.loadProjectiles
(LivingEntity shooter, ItemStack projectile) boolean
BundleItem.onClicked
(ItemStack stack, ItemStack otherStack, Slot slot, ClickType clickType, PlayerEntity player, StackReference cursorStackReference) Called when the item atslot
gets clicked by the cursor holdingotherStack
.boolean
Item.onClicked
(ItemStack stack, ItemStack otherStack, Slot slot, ClickType clickType, PlayerEntity player, StackReference cursorStackReference) Called when the item atslot
gets clicked by the cursor holdingotherStack
.boolean
ItemStack.onClicked
(ItemStack stack, Slot slot, ClickType clickType, PlayerEntity player, StackReference cursorStackReference) void
FilledMapItem.onCraft
(ItemStack stack, World world, PlayerEntity player) Called when a player acquires the item by crafting, smelting, smithing, etc.void
Item.onCraft
(ItemStack stack, World world, PlayerEntity player) Called when a player acquires the item by crafting, smelting, smithing, etc.void
void
EntityBucketItem.onEmptied
(@Nullable PlayerEntity player, World world, ItemStack stack, BlockPos pos) default void
FluidModificationItem.onEmptied
(@Nullable PlayerEntity player, World world, ItemStack stack, BlockPos pos) boolean
BundleItem.onStackClicked
(ItemStack stack, Slot slot, ClickType clickType, PlayerEntity player) Called when the item at the cursor is clicked atslot
.boolean
Item.onStackClicked
(ItemStack stack, Slot slot, ClickType clickType, PlayerEntity player) Called when the item at the cursor is clicked atslot
.void
BowItem.onStoppedUsing
(ItemStack stack, World world, LivingEntity user, int remainingUseTicks) Called on both the client and the server when an entity stops using an item before reaching the maximum use time.void
CrossbowItem.onStoppedUsing
(ItemStack stack, World world, LivingEntity user, int remainingUseTicks) Called on both the client and the server when an entity stops using an item before reaching the maximum use time.void
Item.onStoppedUsing
(ItemStack stack, World world, LivingEntity user, int remainingUseTicks) Called on both the client and the server when an entity stops using an item before reaching the maximum use time.void
SpyglassItem.onStoppedUsing
(ItemStack stack, World world, LivingEntity user, int remainingUseTicks) Called on both the client and the server when an entity stops using an item before reaching the maximum use time.void
TridentItem.onStoppedUsing
(ItemStack stack, World world, LivingEntity user, int remainingUseTicks) Called on both the client and the server when an entity stops using an item before reaching the maximum use time.private BlockState
BlockItem.placeFromNbt
(BlockPos pos, World world, ItemStack stack, BlockState state) boolean
Item.postHit
(ItemStack stack, LivingEntity target, LivingEntity attacker) Called on the server when the item is used to hit an entity.boolean
MiningToolItem.postHit
(ItemStack stack, LivingEntity target, LivingEntity attacker) Called on the server when the item is used to hit an entity.boolean
SwordItem.postHit
(ItemStack stack, LivingEntity target, LivingEntity attacker) Called on the server when the item is used to hit an entity.boolean
TridentItem.postHit
(ItemStack stack, LivingEntity target, LivingEntity attacker) Called on the server when the item is used to hit an entity.boolean
Item.postMine
(ItemStack stack, World world, BlockState state, BlockPos pos, LivingEntity miner) Called on the server when the item is used to break a block.boolean
MiningToolItem.postMine
(ItemStack stack, World world, BlockState state, BlockPos pos, LivingEntity miner) Called on the server when the item is used to break a block.boolean
ShearsItem.postMine
(ItemStack stack, World world, BlockState state, BlockPos pos, LivingEntity miner) Called on the server when the item is used to break a block.boolean
SwordItem.postMine
(ItemStack stack, World world, BlockState state, BlockPos pos, LivingEntity miner) Called on the server when the item is used to break a block.boolean
TridentItem.postMine
(ItemStack stack, World world, BlockState state, BlockPos pos, LivingEntity miner) Called on the server when the item is used to break a block.protected boolean
BlockItem.postPlacement
(BlockPos pos, World world, @Nullable PlayerEntity player, ItemStack stack, BlockState state) protected boolean
SignItem.postPlacement
(BlockPos pos, World world, @Nullable PlayerEntity player, ItemStack stack, BlockState state) private static void
CrossbowItem.postShoot
(World world, LivingEntity entity, ItemStack stack) private static void
CrossbowItem.putProjectile
(ItemStack crossbow, ItemStack projectile) default void
DyeableItem.removeColor
(ItemStack stack) BundleItem.removeFirstStack
(ItemStack stack) static boolean
WrittenBookItem.resolve
(ItemStack book, @Nullable ServerCommandSource commandSource, @Nullable PlayerEntity player) private static void
static void
BlockItem.setBlockEntityNbt
(ItemStack stack, BlockEntityType<?> blockEntityType, NbtCompound tag) static void
CrossbowItem.setCharged
(ItemStack stack, boolean charged) default void
private static void
GoatHornItem.setInstrument
(ItemStack stack, RegistryEntry<Instrument> instrument) private static void
static void
GoatHornItem.setRandomInstrumentFromTag
(ItemStack stack, TagKey<Instrument> instrumentTag, Random random) private static void
CrossbowItem.shoot
(World world, LivingEntity shooter, Hand hand, ItemStack crossbow, ItemStack projectile, float soundPitch, boolean creative, float speed, float divergence, float simulated) static void
CrossbowItem.shootAll
(World world, LivingEntity entity, Hand hand, ItemStack stack, float speed, float divergence) SpawnEggItem.spawnBaby
(PlayerEntity user, MobEntity entity, EntityType<? extends MobEntity> entityType, ServerWorld world, Vec3d pos, ItemStack stack) private void
EntityBucketItem.spawnEntity
(ServerWorld world, ItemStack stack, BlockPos pos) void
CrossbowItem.usageTick
(World world, LivingEntity user, ItemStack stack, int remainingUseTicks) Called on both the server and the client every tick while an entity uses the item.void
Item.usageTick
(World world, LivingEntity user, ItemStack stack, int remainingUseTicks) Called on both the server and the client every tick while an entity uses the item.private boolean
DebugStickItem.use
(PlayerEntity player, BlockState state, WorldAccess world, BlockPos pos, boolean update, ItemStack stack) DyeItem.useOnEntity
(ItemStack stack, PlayerEntity user, LivingEntity entity, Hand hand) Called on both the client and the server when a player uses the item on an entity.Item.useOnEntity
(ItemStack stack, PlayerEntity user, LivingEntity entity, Hand hand) Called on both the client and the server when a player uses the item on an entity.NameTagItem.useOnEntity
(ItemStack stack, PlayerEntity user, LivingEntity entity, Hand hand) Called on both the client and the server when a player uses the item on an entity.SaddleItem.useOnEntity
(ItemStack stack, PlayerEntity user, LivingEntity entity, Hand hand) Called on both the client and the server when a player uses the item on an entity.static boolean
BoneMealItem.useOnFertilizable
(ItemStack stack, World world, BlockPos pos) static boolean
BoneMealItem.useOnGround
(ItemStack stack, World world, BlockPos blockPos, @Nullable Direction facing) static boolean
BlockItem.writeNbtToBlockEntity
(World world, @Nullable PlayerEntity player, BlockPos pos, ItemStack stack) Modifier and TypeMethodDescriptionvoid
BlockItem.appendStacks
(ItemGroup group, DefaultedList<ItemStack> stacks) Appends the stacks of this item shown in the item group to the list.void
EnchantedBookItem.appendStacks
(ItemGroup group, DefaultedList<ItemStack> stacks) Appends the stacks of this item shown in the item group to the list.void
GoatHornItem.appendStacks
(ItemGroup group, DefaultedList<ItemStack> stacks) Appends the stacks of this item shown in the item group to the list.void
Item.appendStacks
(ItemGroup group, DefaultedList<ItemStack> stacks) Appends the stacks of this item shown in the item group to the list.void
ItemGroup.appendStacks
(DefaultedList<ItemStack> stacks) void
PotionItem.appendStacks
(ItemGroup group, DefaultedList<ItemStack> stacks) Appends the stacks of this item shown in the item group to the list.void
TippedArrowItem.appendStacks
(ItemGroup group, DefaultedList<ItemStack> stacks) Appends the stacks of this item shown in the item group to the list.static ItemStack
RangedWeaponItem.getHeldProjectile
(LivingEntity entity, Predicate<ItemStack> predicate) static void
ItemUsage.spawnItemContents
(ItemEntity itemEntity, Stream<ItemStack> contents) Spawns item entity's contents at the item entity's position.ModifierConstructorDescriptionAutomaticItemPlacementContext
(World world, BlockPos pos, Direction facing, ItemStack stack, Direction side) ItemPlacementContext
(PlayerEntity player, Hand hand, ItemStack stack, BlockHitResult hitResult) protected
ItemPlacementContext
(World world, @Nullable PlayerEntity player, Hand hand, ItemStack stack, BlockHitResult hit) protected
ItemUsageContext
(World world, @Nullable PlayerEntity player, Hand hand, ItemStack stack, BlockHitResult hit) -
Uses of ItemStack in net.minecraft.item.map
Modifier and TypeMethodDescriptionstatic void
MapState.addDecorationsNbt
(ItemStack stack, BlockPos pos, String id, MapIcon.Type type) void
MapState.update
(PlayerEntity player, ItemStack stack) -
Uses of ItemStack in net.minecraft.loot
Modifier and TypeFieldDescriptionprivate final BiFunction<ItemStack,
LootContext, ItemStack> LootTable.combinedFunction
private final BiFunction<ItemStack,
LootContext, ItemStack> LootTable.combinedFunction
private final BiFunction<ItemStack,
LootContext, ItemStack> LootPool.javaFunctions
private final BiFunction<ItemStack,
LootContext, ItemStack> LootPool.javaFunctions
Modifier and TypeMethodDescriptionLootTable.generateLoot
(LootContext context) LootTable.processStacks
(Consumer<ItemStack> lootConsumer) Modifier and TypeMethodDescriptionvoid
LootPool.addGeneratedLoot
(Consumer<ItemStack> lootConsumer, LootContext context) void
LootChoice.generateLoot
(Consumer<ItemStack> lootConsumer, LootContext context) void
LootTable.generateLoot
(LootContext context, Consumer<ItemStack> lootConsumer) void
LootTable.generateUnprocessedLoot
(LootContext context, Consumer<ItemStack> lootConsumer) LootTable.processStacks
(Consumer<ItemStack> lootConsumer) private void
LootTable.shuffle
(ObjectArrayList<ItemStack> drops, int freeSlots, Random random) private void
LootPool.supplyOnce
(Consumer<ItemStack> lootConsumer, LootContext context) -
Uses of ItemStack in net.minecraft.loot.context
Modifier and TypeFieldDescriptionstatic final LootContextParameter<ItemStack>
LootContextParameters.TOOL
Modifier and TypeMethodDescriptionvoid
LootContext.Dropper.add
(LootContext context, Consumer<ItemStack> consumer) void
LootContext.drop
(Identifier id, Consumer<ItemStack> lootConsumer) -
Uses of ItemStack in net.minecraft.loot.entry
Modifier and TypeFieldDescription(package private) final BiFunction<ItemStack,
LootContext, ItemStack> LeafEntry.compiledFunctions
(package private) final BiFunction<ItemStack,
LootContext, ItemStack> LeafEntry.compiledFunctions
Modifier and TypeMethodDescriptionvoid
DynamicEntry.generateLoot
(Consumer<ItemStack> lootConsumer, LootContext context) void
EmptyEntry.generateLoot
(Consumer<ItemStack> lootConsumer, LootContext context) void
ItemEntry.generateLoot
(Consumer<ItemStack> lootConsumer, LootContext context) protected abstract void
LeafEntry.generateLoot
(Consumer<ItemStack> lootConsumer, LootContext context) void
LootTableEntry.generateLoot
(Consumer<ItemStack> lootConsumer, LootContext context) void
TagEntry.generateLoot
(Consumer<ItemStack> lootConsumer, LootContext context) -
Uses of ItemStack in net.minecraft.loot.function
Modifier and TypeFieldDescriptionprivate final BiFunction<ItemStack,
LootContext, ItemStack> LootFunctionManager.AndFunction.applier
private final BiFunction<ItemStack,
LootContext, ItemStack> LootFunctionManager.AndFunction.applier
static final BiFunction<ItemStack,
LootContext, ItemStack> LootFunctionTypes.NOOP
static final BiFunction<ItemStack,
LootContext, ItemStack> LootFunctionTypes.NOOP
Modifier and TypeMethodDescriptionprivate static ItemStack
EnchantRandomlyLootFunction.addEnchantmentToStack
(ItemStack stack, Enchantment enchantment, Random random) final ItemStack
ConditionalLootFunction.apply
(ItemStack itemStack, LootContext lootContext) LootFunctionManager.AndFunction.apply
(ItemStack itemStack, LootContext lootContext) ApplyBonusLootFunction.process
(ItemStack stack, LootContext context) protected abstract ItemStack
ConditionalLootFunction.process
(ItemStack stack, LootContext context) CopyNameLootFunction.process
(ItemStack stack, LootContext context) CopyNbtLootFunction.process
(ItemStack stack, LootContext context) protected ItemStack
CopyStateFunction.process
(ItemStack stack, LootContext context) EnchantRandomlyLootFunction.process
(ItemStack stack, LootContext context) EnchantWithLevelsLootFunction.process
(ItemStack stack, LootContext context) ExplorationMapLootFunction.process
(ItemStack stack, LootContext context) ExplosionDecayLootFunction.process
(ItemStack stack, LootContext context) FillPlayerHeadLootFunction.process
(ItemStack stack, LootContext context) FurnaceSmeltLootFunction.process
(ItemStack stack, LootContext context) LimitCountLootFunction.process
(ItemStack stack, LootContext context) LootingEnchantLootFunction.process
(ItemStack stack, LootContext context) SetAttributesLootFunction.process
(ItemStack stack, LootContext context) protected ItemStack
SetBannerPatternFunction.process
(ItemStack stack, LootContext context) SetContentsLootFunction.process
(ItemStack stack, LootContext context) SetCountLootFunction.process
(ItemStack stack, LootContext context) SetDamageLootFunction.process
(ItemStack stack, LootContext context) SetEnchantmentsLootFunction.process
(ItemStack stack, LootContext context) SetGoatHornSoundLootFunction.process
(ItemStack stack, LootContext context) SetLootTableLootFunction.process
(ItemStack stack, LootContext context) SetLoreLootFunction.process
(ItemStack stack, LootContext context) SetNameLootFunction.process
(ItemStack stack, LootContext context) SetNbtLootFunction.process
(ItemStack stack, LootContext context) SetPotionLootFunction.process
(ItemStack stack, LootContext context) SetStewEffectLootFunction.process
(ItemStack stack, LootContext context) Modifier and TypeMethodDescriptionLootFunction.apply
(BiFunction<ItemStack, LootContext, ItemStack> itemApplier, Consumer<ItemStack> lootConsumer, LootContext context) static BiFunction<ItemStack,
LootContext, ItemStack> LootFunctionTypes.join
(BiFunction<ItemStack, LootContext, ItemStack>[] lootFunctions) static BiFunction<ItemStack,
LootContext, ItemStack> LootFunctionTypes.join
(BiFunction<ItemStack, LootContext, ItemStack>[] lootFunctions) Modifier and TypeMethodDescriptionprivate static ItemStack
EnchantRandomlyLootFunction.addEnchantmentToStack
(ItemStack stack, Enchantment enchantment, Random random) final ItemStack
ConditionalLootFunction.apply
(ItemStack itemStack, LootContext lootContext) LootFunctionManager.AndFunction.apply
(ItemStack itemStack, LootContext lootContext) SetLoreLootFunction.getLoreForMerge
(ItemStack stack, boolean otherLoreExists) ApplyBonusLootFunction.process
(ItemStack stack, LootContext context) protected abstract ItemStack
ConditionalLootFunction.process
(ItemStack stack, LootContext context) CopyNameLootFunction.process
(ItemStack stack, LootContext context) CopyNbtLootFunction.process
(ItemStack stack, LootContext context) protected ItemStack
CopyStateFunction.process
(ItemStack stack, LootContext context) EnchantRandomlyLootFunction.process
(ItemStack stack, LootContext context) EnchantWithLevelsLootFunction.process
(ItemStack stack, LootContext context) ExplorationMapLootFunction.process
(ItemStack stack, LootContext context) ExplosionDecayLootFunction.process
(ItemStack stack, LootContext context) FillPlayerHeadLootFunction.process
(ItemStack stack, LootContext context) FurnaceSmeltLootFunction.process
(ItemStack stack, LootContext context) LimitCountLootFunction.process
(ItemStack stack, LootContext context) LootingEnchantLootFunction.process
(ItemStack stack, LootContext context) SetAttributesLootFunction.process
(ItemStack stack, LootContext context) protected ItemStack
SetBannerPatternFunction.process
(ItemStack stack, LootContext context) SetContentsLootFunction.process
(ItemStack stack, LootContext context) SetCountLootFunction.process
(ItemStack stack, LootContext context) SetDamageLootFunction.process
(ItemStack stack, LootContext context) SetEnchantmentsLootFunction.process
(ItemStack stack, LootContext context) SetGoatHornSoundLootFunction.process
(ItemStack stack, LootContext context) SetLootTableLootFunction.process
(ItemStack stack, LootContext context) SetLoreLootFunction.process
(ItemStack stack, LootContext context) SetNameLootFunction.process
(ItemStack stack, LootContext context) SetNbtLootFunction.process
(ItemStack stack, LootContext context) SetPotionLootFunction.process
(ItemStack stack, LootContext context) SetStewEffectLootFunction.process
(ItemStack stack, LootContext context) Modifier and TypeMethodDescriptionLootFunction.apply
(BiFunction<ItemStack, LootContext, ItemStack> itemApplier, Consumer<ItemStack> lootConsumer, LootContext context) LootFunction.apply
(BiFunction<ItemStack, LootContext, ItemStack> itemApplier, Consumer<ItemStack> lootConsumer, LootContext context) LootFunction.apply
(BiFunction<ItemStack, LootContext, ItemStack> itemApplier, Consumer<ItemStack> lootConsumer, LootContext context) -
Uses of ItemStack in net.minecraft.network
Modifier and TypeMethodDescriptionPacketByteBuf.readItemStack()
Reads an item stack from this buf.Modifier and TypeMethodDescriptionPacketByteBuf.writeItemStack
(ItemStack stack) Writes an item stack to this buf. -
Uses of ItemStack in net.minecraft.network.packet.c2s.play
Modifier and TypeFieldDescriptionprivate final ItemStack
ClickSlotC2SPacket.stack
private final ItemStack
CreativeInventoryActionC2SPacket.stack
Modifier and TypeFieldDescriptionprivate final Int2ObjectMap<ItemStack>
ClickSlotC2SPacket.modifiedStacks
Modifier and TypeMethodDescriptionCreativeInventoryActionC2SPacket.getItemStack()
ClickSlotC2SPacket.getStack()
ModifierConstructorDescriptionClickSlotC2SPacket
(int syncId, int revision, int slot, int button, SlotActionType actionType, ItemStack stack, Int2ObjectMap<ItemStack> modifiedStacks) CreativeInventoryActionC2SPacket
(int slot, ItemStack stack) ModifierConstructorDescriptionClickSlotC2SPacket
(int syncId, int revision, int slot, int button, SlotActionType actionType, ItemStack stack, Int2ObjectMap<ItemStack> modifiedStacks) -
Uses of ItemStack in net.minecraft.network.packet.s2c.play
Modifier and TypeFieldDescriptionprivate final ItemStack
InventoryS2CPacket.cursorStack
private final ItemStack
ScreenHandlerSlotUpdateS2CPacket.stack
Modifier and TypeFieldDescriptionInventoryS2CPacket.contents
private final List<com.mojang.datafixers.util.Pair<EquipmentSlot,
ItemStack>> EntityEquipmentUpdateS2CPacket.equipmentList
Modifier and TypeMethodDescriptionInventoryS2CPacket.getCursorStack()
ScreenHandlerSlotUpdateS2CPacket.getItemStack()
Modifier and TypeMethodDescriptionInventoryS2CPacket.getContents()
List<com.mojang.datafixers.util.Pair<EquipmentSlot,
ItemStack>> EntityEquipmentUpdateS2CPacket.getEquipmentList()
ModifierConstructorDescriptionInventoryS2CPacket
(int syncId, int revision, DefaultedList<ItemStack> contents, ItemStack cursorStack) ScreenHandlerSlotUpdateS2CPacket
(int syncId, int revision, int slot, ItemStack stack) ModifierConstructorDescriptionEntityEquipmentUpdateS2CPacket
(int id, List<com.mojang.datafixers.util.Pair<EquipmentSlot, ItemStack>> equipmentList) InventoryS2CPacket
(int syncId, int revision, DefaultedList<ItemStack> contents, ItemStack cursorStack) -
Uses of ItemStack in net.minecraft.particle
ModifierConstructorDescriptionItemStackParticleEffect
(ParticleType<ItemStackParticleEffect> type, ItemStack stack) -
Uses of ItemStack in net.minecraft.potion
Modifier and TypeMethodDescriptionstatic ItemStack
PotionUtil.setCustomPotionEffects
(ItemStack stack, Collection<StatusEffectInstance> effects) static ItemStack
Modifier and TypeMethodDescriptionstatic void
PotionUtil.buildTooltip
(ItemStack stack, List<Text> list, float durationMultiplier) static int
static List<StatusEffectInstance>
PotionUtil.getCustomPotionEffects
(ItemStack stack) static Potion
static List<StatusEffectInstance>
PotionUtil.getPotionEffects
(ItemStack stack) static ItemStack
PotionUtil.setCustomPotionEffects
(ItemStack stack, Collection<StatusEffectInstance> effects) static ItemStack
-
Uses of ItemStack in net.minecraft.predicate
-
Uses of ItemStack in net.minecraft.predicate.entity
-
Uses of ItemStack in net.minecraft.predicate.item
-
Uses of ItemStack in net.minecraft.recipe
Modifier and TypeFieldDescriptionIngredient.matchingStacks
protected final ItemStack
AbstractCookingRecipe.output
protected final ItemStack
CuttingRecipe.output
(package private) final ItemStack
ShapedRecipe.output
(package private) final ItemStack
ShapelessRecipe.output
(package private) final ItemStack
SmithingRecipe.result
private final ItemStack
Ingredient.StackEntry.stack
Modifier and TypeMethodDescriptionCrafts this recipe.ArmorDyeRecipe.craft
(CraftingInventory craftingInventory) BannerDuplicateRecipe.craft
(CraftingInventory craftingInventory) BookCloningRecipe.craft
(CraftingInventory craftingInventory) static ItemStack
Crafts this recipe.FireworkRocketRecipe.craft
(CraftingInventory craftingInventory) FireworkStarFadeRecipe.craft
(CraftingInventory craftingInventory) FireworkStarRecipe.craft
(CraftingInventory craftingInventory) MapCloningRecipe.craft
(CraftingInventory craftingInventory) MapExtendingRecipe.craft
(CraftingInventory craftingInventory) Crafts this recipe.RepairItemRecipe.craft
(CraftingInventory craftingInventory) ShapedRecipe.craft
(CraftingInventory craftingInventory) ShapelessRecipe.craft
(CraftingInventory craftingInventory) ShieldDecorationRecipe.craft
(CraftingInventory craftingInventory) ShulkerBoxColoringRecipe.craft
(CraftingInventory craftingInventory) Crafts this recipe.SuspiciousStewRecipe.craft
(CraftingInventory craftingInventory) TippedArrowRecipe.craft
(CraftingInventory craftingInventory) BlastingRecipe.createIcon()
Returns an item rendered on the top left of the output preview on the recipe toast when a new recipe is unlocked.CampfireCookingRecipe.createIcon()
Returns an item rendered on the top left of the output preview on the recipe toast when a new recipe is unlocked.default ItemStack
Recipe.createIcon()
Returns an item rendered on the top left of the output preview on the recipe toast when a new recipe is unlocked.SmeltingRecipe.createIcon()
Returns an item rendered on the top left of the output preview on the recipe toast when a new recipe is unlocked.SmithingRecipe.createIcon()
Returns an item rendered on the top left of the output preview on the recipe toast when a new recipe is unlocked.SmokingRecipe.createIcon()
Returns an item rendered on the top left of the output preview on the recipe toast when a new recipe is unlocked.StonecuttingRecipe.createIcon()
Returns an item rendered on the top left of the output preview on the recipe toast when a new recipe is unlocked.Ingredient.getMatchingStacks()
AbstractCookingRecipe.getOutput()
Returns a preview of the recipe's output.CuttingRecipe.getOutput()
Returns a preview of the recipe's output.FireworkRocketRecipe.getOutput()
Returns a preview of the recipe's output.FireworkStarRecipe.getOutput()
Returns a preview of the recipe's output.Recipe.getOutput()
Returns a preview of the recipe's output.ShapedRecipe.getOutput()
Returns a preview of the recipe's output.ShapelessRecipe.getOutput()
Returns a preview of the recipe's output.SmithingRecipe.getOutput()
Returns a preview of the recipe's output.SpecialCraftingRecipe.getOutput()
Returns a preview of the recipe's output.static ItemStack
RecipeMatcher.getStackFromId
(int itemId) static ItemStack
ShapedRecipe.outputFromJson
(JsonObject json) Modifier and TypeMethodDescriptionBannerDuplicateRecipe.getRemainder
(CraftingInventory craftingInventory) BookCloningRecipe.getRemainder
(CraftingInventory craftingInventory) default DefaultedList<ItemStack>
Recipe.getRemainder
(C inventory) Returns the remaining stacks to be left in theinventory
after the recipe is used.<C extends Inventory,
T extends Recipe<C>>
DefaultedList<ItemStack>RecipeManager.getRemainingStacks
(RecipeType<T> type, C inventory, World world) Returns the remainder of a recipe of the giventype
that match the giveninventory
andworld
, or a shallow copy of theinventory
.Ingredient.Entry.getStacks()
Ingredient.StackEntry.getStacks()
Ingredient.TagEntry.getStacks()
Modifier and TypeMethodDescriptionvoid
Adds a full item stack to the pool of available resources.void
Adds an item stack to the pool of available resources.void
RecipeMatcher.addUnenchantedInput
(ItemStack stack) Adds a full item stack to the pool of available resources.static ItemStack
CookingRecipeSerializer.RecipeFactory.create
(Identifier id, String group, Ingredient input, ItemStack output, float experience, int cookTime) CuttingRecipe.Serializer.RecipeFactory.create
(Identifier id, String group, Ingredient input, ItemStack output) protected void
InputSlotFiller.fillInputSlot
(Slot slot, ItemStack stack) static int
protected static boolean
BrewingRecipeRegistry.hasItemRecipe
(ItemStack input, ItemStack ingredient) protected static boolean
BrewingRecipeRegistry.hasPotionRecipe
(ItemStack input, ItemStack ingredient) static boolean
protected static boolean
BrewingRecipeRegistry.isItemRecipeIngredient
(ItemStack stack) protected static boolean
BrewingRecipeRegistry.isPotionRecipeIngredient
(ItemStack stack) static boolean
BrewingRecipeRegistry.isValidIngredient
(ItemStack stack) static Ingredient
boolean
boolean
SmithingRecipe.testAddition
(ItemStack stack) ModifierConstructorDescriptionAbstractCookingRecipe
(RecipeType<?> type, Identifier id, String group, Ingredient input, ItemStack output, float experience, int cookTime) BlastingRecipe
(Identifier id, String group, Ingredient input, ItemStack output, float experience, int cookTime) CampfireCookingRecipe
(Identifier id, String group, Ingredient input, ItemStack output, float experience, int cookTime) CuttingRecipe
(RecipeType<?> type, RecipeSerializer<?> serializer, Identifier id, String group, Ingredient input, ItemStack output) ShapedRecipe
(Identifier id, String group, int width, int height, DefaultedList<Ingredient> input, ItemStack output) ShapelessRecipe
(Identifier id, String group, ItemStack output, DefaultedList<Ingredient> input) SmeltingRecipe
(Identifier id, String group, Ingredient input, ItemStack output, float experience, int cookTime) SmithingRecipe
(Identifier id, Ingredient base, Ingredient addition, ItemStack result) SmokingRecipe
(Identifier id, String group, Ingredient input, ItemStack output, float experience, int cookTime) (package private)
StackEntry
(ItemStack stack) StonecuttingRecipe
(Identifier id, String group, Ingredient input, ItemStack output) -
Uses of ItemStack in net.minecraft.screen
Modifier and TypeFieldDescriptionprivate ItemStack
ScreenHandler.cursorStack
private ItemStack
StonecutterScreenHandler.inputStack
private ItemStack
ScreenHandler.previousCursorStack
Modifier and TypeFieldDescriptionprivate final DefaultedList<ItemStack>
ScreenHandler.previousTrackedStacks
private final DefaultedList<ItemStack>
ScreenHandler.trackedStacks
A list of item stacks that is used for tracking changes inScreenHandler.sendContentUpdates()
.Modifier and TypeMethodDescriptionLecternScreenHandler.getBookItem()
ScreenHandler.getCursorStack()
private ItemStack
private ItemStack
GrindstoneScreenHandler.transferEnchantments
(ItemStack target, ItemStack source) AbstractFurnaceScreenHandler.transferSlot
(PlayerEntity player, int index) Transfers (or "quick-moves") the stack at slotindex
to other slots of the screen handler that belong to a different inventory.BeaconScreenHandler.transferSlot
(PlayerEntity player, int index) Transfers (or "quick-moves") the stack at slotindex
to other slots of the screen handler that belong to a different inventory.BrewingStandScreenHandler.transferSlot
(PlayerEntity player, int index) Transfers (or "quick-moves") the stack at slotindex
to other slots of the screen handler that belong to a different inventory.CartographyTableScreenHandler.transferSlot
(PlayerEntity player, int index) Transfers (or "quick-moves") the stack at slotindex
to other slots of the screen handler that belong to a different inventory.CraftingScreenHandler.transferSlot
(PlayerEntity player, int index) Transfers (or "quick-moves") the stack at slotindex
to other slots of the screen handler that belong to a different inventory.EnchantmentScreenHandler.transferSlot
(PlayerEntity player, int index) Transfers (or "quick-moves") the stack at slotindex
to other slots of the screen handler that belong to a different inventory.ForgingScreenHandler.transferSlot
(PlayerEntity player, int index) Transfers (or "quick-moves") the stack at slotindex
to other slots of the screen handler that belong to a different inventory.Generic3x3ContainerScreenHandler.transferSlot
(PlayerEntity player, int index) Transfers (or "quick-moves") the stack at slotindex
to other slots of the screen handler that belong to a different inventory.GenericContainerScreenHandler.transferSlot
(PlayerEntity player, int index) Transfers (or "quick-moves") the stack at slotindex
to other slots of the screen handler that belong to a different inventory.GrindstoneScreenHandler.transferSlot
(PlayerEntity player, int index) Transfers (or "quick-moves") the stack at slotindex
to other slots of the screen handler that belong to a different inventory.HopperScreenHandler.transferSlot
(PlayerEntity player, int index) Transfers (or "quick-moves") the stack at slotindex
to other slots of the screen handler that belong to a different inventory.HorseScreenHandler.transferSlot
(PlayerEntity player, int index) Transfers (or "quick-moves") the stack at slotindex
to other slots of the screen handler that belong to a different inventory.LecternScreenHandler.transferSlot
(PlayerEntity player, int index) Transfers (or "quick-moves") the stack at slotindex
to other slots of the screen handler that belong to a different inventory.LoomScreenHandler.transferSlot
(PlayerEntity player, int index) Transfers (or "quick-moves") the stack at slotindex
to other slots of the screen handler that belong to a different inventory.MerchantScreenHandler.transferSlot
(PlayerEntity player, int index) Transfers (or "quick-moves") the stack at slotindex
to other slots of the screen handler that belong to a different inventory.PlayerScreenHandler.transferSlot
(PlayerEntity player, int index) Transfers (or "quick-moves") the stack at slotindex
to other slots of the screen handler that belong to a different inventory.abstract ItemStack
ScreenHandler.transferSlot
(PlayerEntity player, int index) Transfers (or "quick-moves") the stack at slotindex
to other slots of the screen handler that belong to a different inventory.ShulkerBoxScreenHandler.transferSlot
(PlayerEntity player, int index) Transfers (or "quick-moves") the stack at slotindex
to other slots of the screen handler that belong to a different inventory.StonecutterScreenHandler.transferSlot
(PlayerEntity player, int index) Transfers (or "quick-moves") the stack at slotindex
to other slots of the screen handler that belong to a different inventory.Modifier and TypeMethodDescriptionScreenHandler.getStacks()
Returns a list of all stacks of the screen handler's slot.Modifier and TypeMethodDescriptionprivate void
static void
ScreenHandler.calculateStackSize
(Set<Slot> slots, int mode, ItemStack stack, int stackSize) boolean
boolean
boolean
boolean
boolean
CartographyTableScreenHandler.canInsertIntoSlot
(ItemStack stack, Slot slot) Returns whetherstack
can be inserted toslot
.boolean
CraftingScreenHandler.canInsertIntoSlot
(ItemStack stack, Slot slot) Returns whetherstack
can be inserted toslot
.boolean
MerchantScreenHandler.canInsertIntoSlot
(ItemStack stack, Slot slot) Returns whetherstack
can be inserted toslot
.boolean
PlayerScreenHandler.canInsertIntoSlot
(ItemStack stack, Slot slot) Returns whetherstack
can be inserted toslot
.boolean
ScreenHandler.canInsertIntoSlot
(ItemStack stack, Slot slot) Returns whetherstack
can be inserted toslot
.boolean
SmithingScreenHandler.canInsertIntoSlot
(ItemStack stack, Slot slot) Returns whetherstack
can be inserted toslot
.boolean
StonecutterScreenHandler.canInsertIntoSlot
(ItemStack stack, Slot slot) Returns whetherstack
can be inserted toslot
.static boolean
ScreenHandler.canInsertItemIntoSlot
(@Nullable Slot slot, ItemStack stack, boolean allowOverflow) private void
ScreenHandler.checkSlotUpdates
(int slot, ItemStack stack, Supplier<ItemStack> copySupplier) private List<EnchantmentLevelEntry>
EnchantmentScreenHandler.generateEnchantments
(ItemStack stack, int slot, int level) private List<RegistryEntry<BannerPattern>>
LoomScreenHandler.getPatternsFor
(ItemStack stack) private ItemStack
protected boolean
ScreenHandler.insertItem
(ItemStack stack, int startIndex, int endIndex, boolean fromLast) Tries to consumestack
by inserting to slots fromstartIndex
toendIndex - 1
(both inclusive) until the entire stack is used.protected boolean
protected boolean
AbstractFurnaceScreenHandler.isSmeltable
(ItemStack itemStack) protected boolean
ForgingScreenHandler.isUsableAsAddition
(ItemStack stack) protected boolean
SmithingScreenHandler.isUsableAsAddition
(ItemStack stack) static boolean
static boolean
void
ScreenHandlerListener.onSlotUpdate
(ScreenHandler handler, int slotId, ItemStack stack) void
BrewingStandScreenHandler.PotionSlot.onTakeItem
(PlayerEntity player, ItemStack stack) protected void
AnvilScreenHandler.onTakeOutput
(PlayerEntity player, ItemStack stack) protected abstract void
ForgingScreenHandler.onTakeOutput
(PlayerEntity player, ItemStack stack) protected void
SmithingScreenHandler.onTakeOutput
(PlayerEntity player, ItemStack stack) void
ScreenHandler.setCursorStack
(ItemStack stack) void
ScreenHandler.setPreviousCursorStack
(ItemStack stack) void
ScreenHandler.setPreviousTrackedSlot
(int slot, ItemStack stack) void
ScreenHandler.setPreviousTrackedSlotMutable
(int slot, ItemStack stack) void
ScreenHandler.setStackInSlot
(int slot, int revision, ItemStack stack) private ItemStack
GrindstoneScreenHandler.transferEnchantments
(ItemStack target, ItemStack source) void
ScreenHandlerSyncHandler.updateCursorStack
(ScreenHandler handler, ItemStack stack) private void
StonecutterScreenHandler.updateInput
(Inventory input, ItemStack stack) private void
CartographyTableScreenHandler.updateResult
(ItemStack map, ItemStack item, ItemStack oldResult) void
ScreenHandlerSyncHandler.updateSlot
(ScreenHandler handler, int slot, ItemStack stack) void
ScreenHandler.updateSlotStacks
(int revision, List<ItemStack> stacks, ItemStack cursorStack) void
ScreenHandlerSyncHandler.updateState
(ScreenHandler handler, DefaultedList<ItemStack> stacks, ItemStack cursorStack, int[] properties) private void
ScreenHandler.updateTrackedSlot
(int slot, ItemStack stack, Supplier<ItemStack> copySupplier) Modifier and TypeMethodDescriptionprivate void
ScreenHandler.checkSlotUpdates
(int slot, ItemStack stack, Supplier<ItemStack> copySupplier) void
ScreenHandler.updateSlotStacks
(int revision, List<ItemStack> stacks, ItemStack cursorStack) void
ScreenHandlerSyncHandler.updateState
(ScreenHandler handler, DefaultedList<ItemStack> stacks, ItemStack cursorStack, int[] properties) private void
ScreenHandler.updateTrackedSlot
(int slot, ItemStack stack, Supplier<ItemStack> copySupplier) -
Uses of ItemStack in net.minecraft.screen.slot
Modifier and TypeMethodDescriptionSlot.getStack()
Slot.insertStack
(ItemStack stack) Slot.insertStack
(ItemStack stack, int count) CraftingResultSlot.takeStack
(int amount) FurnaceOutputSlot.takeStack
(int amount) Slot.takeStack
(int amount) TradeOutputSlot.takeStack
(int amount) Slot.takeStackRange
(int min, int max, PlayerEntity player) Modifier and TypeMethodDescriptionboolean
boolean
boolean
boolean
boolean
boolean
int
FurnaceFuelSlot.getMaxItemCount
(ItemStack stack) int
Slot.getMaxItemCount
(ItemStack stack) Slot.insertStack
(ItemStack stack) Slot.insertStack
(ItemStack stack, int count) static boolean
protected void
protected void
protected void
protected void
protected void
protected void
protected void
protected void
void
Slot.onQuickTransfer
(ItemStack newItem, ItemStack original) void
CraftingResultSlot.onTakeItem
(PlayerEntity player, ItemStack stack) void
FurnaceOutputSlot.onTakeItem
(PlayerEntity player, ItemStack stack) void
Slot.onTakeItem
(PlayerEntity player, ItemStack stack) void
TradeOutputSlot.onTakeItem
(PlayerEntity player, ItemStack stack) void
Sets the slot's stack tostack
and marks the slot as dirty.void
Slot.setStackNoCallbacks
(ItemStack stack) Sets the slot's stack tostack
and marks the slot as dirty. -
Uses of ItemStack in net.minecraft.server.command
Modifier and TypeMethodDescriptionprivate static ItemStack
LootCommand.getHeldItem
(ServerCommandSource source, EquipmentSlot slot) private static ItemStack
ItemCommand.getStackInSlot
(Entity entity, int slotId) private static ItemStack
ItemCommand.getStackInSlotFromInventoryAt
(ServerCommandSource source, BlockPos pos, int slotId) private static ItemStack
ItemCommand.getStackWithModifier
(ServerCommandSource source, LootFunction modifier, ItemStack stack) Modifier and TypeMethodDescriptionprivate static int
ItemCommand.executeBlockReplace
(ServerCommandSource source, BlockPos pos, int slot, ItemStack stack) private static int
ItemCommand.executeEntityReplace
(ServerCommandSource source, Collection<? extends Entity> targets, int slot, ItemStack stack) private static int
LootCommand.executeFish
(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, Identifier lootTable, BlockPos pos, ItemStack stack, LootCommand.Target constructor) private static int
LootCommand.executeMine
(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, BlockPos pos, ItemStack stack, LootCommand.Target constructor) private static ItemStack
ItemCommand.getStackWithModifier
(ServerCommandSource source, LootFunction modifier, ItemStack stack) private static boolean
private static boolean
LootCommand.itemsMatch
(ItemStack first, ItemStack second) Modifier and TypeMethodDescriptionvoid
int
LootCommand.Target.accept
(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, List<ItemStack> items, LootCommand.FeedbackMessage messageSender) private static int
ClearCommand.execute
(ServerCommandSource source, Collection<ServerPlayerEntity> targets, Predicate<ItemStack> item, int maxCount) private static int
LootCommand.executeBlock
(ServerCommandSource source, BlockPos targetPos, int slot, int stackCount, List<ItemStack> stacks, LootCommand.FeedbackMessage messageSender) private static int
LootCommand.executeGive
(Collection<ServerPlayerEntity> players, List<ItemStack> stacks, LootCommand.FeedbackMessage messageSender) private static int
LootCommand.executeInsert
(ServerCommandSource source, BlockPos targetPos, List<ItemStack> stacks, LootCommand.FeedbackMessage messageSender) private static int
LootCommand.executeReplace
(Collection<? extends Entity> targets, int slot, int stackCount, List<ItemStack> stacks, LootCommand.FeedbackMessage messageSender) private static int
LootCommand.executeSpawn
(ServerCommandSource source, Vec3d pos, List<ItemStack> stacks, LootCommand.FeedbackMessage messageSender) private static void
LootCommand.replace
(Entity entity, List<ItemStack> stacks, int slot, int stackCount, List<ItemStack> addedStacks) private static void
LootCommand.sendDroppedFeedback
(ServerCommandSource source, List<ItemStack> stacks) private static void
LootCommand.sendDroppedFeedback
(ServerCommandSource source, List<ItemStack> stacks, Identifier lootTable) -
Uses of ItemStack in net.minecraft.server.network
Modifier and TypeMethodDescriptionvoid
ServerPlayerEntity.applyEnchantmentCosts
(ItemStack enchantedItem, int experienceLevels) private static boolean
ServerPlayNetworkHandler.canPlace
(ServerPlayerEntity player, ItemStack stack) Checks if a player can place a block or fluid from a bucket.DemoServerPlayerInteractionManager.interactBlock
(ServerPlayerEntity player, World world, ItemStack stack, Hand hand, BlockHitResult hitResult) ServerPlayerInteractionManager.interactBlock
(ServerPlayerEntity player, World world, ItemStack stack, Hand hand, BlockHitResult hitResult) DemoServerPlayerInteractionManager.interactItem
(ServerPlayerEntity player, World world, ItemStack stack, Hand hand) ServerPlayerInteractionManager.interactItem
(ServerPlayerEntity player, World world, ItemStack stack, Hand hand) private void
ServerPlayNetworkHandler.setTextToBook
(List<FilteredMessage> messages, UnaryOperator<String> postProcessor, ItemStack book) protected void
ServerPlayerEntity.tickItemStackUsage
(ItemStack stack) void
Called when the player uses (defaults to right click) a writable or written book item. -
Uses of ItemStack in net.minecraft.test
Modifier and TypeMethodDescriptionprivate static ItemStack
StructureTestListener.createBookWithText
(String text, boolean required, String output) -
Uses of ItemStack in net.minecraft.text
-
Uses of ItemStack in net.minecraft.util
Modifier and TypeMethodDescriptionstatic void
Modifier and TypeMethodDescriptionstatic void
ItemScatterer.spawn
(World world, BlockPos pos, DefaultedList<ItemStack> stacks) -
Uses of ItemStack in net.minecraft.village
Modifier and TypeFieldDescriptionprivate final ItemStack
TradeOffer.firstBuyItem
private final ItemStack
TradeOffers.ProcessItemFactory.secondBuy
private final ItemStack
TradeOffer.secondBuyItem
private final ItemStack
TradeOffers.ProcessItemFactory.sell
private final ItemStack
TradeOffers.SellItemFactory.sell
private final ItemStack
TradeOffers.SellPotionHoldingItemFactory.sell
private final ItemStack
TradeOffer.sellItem
private final ItemStack
TradeOffers.SellEnchantedToolFactory.tool
Modifier and TypeFieldDescriptionprivate final DefaultedList<ItemStack>
MerchantInventory.inventory
Modifier and TypeMethodDescriptionTradeOffer.copySellItem()
Returns a copy of the sell item of this trade offer.TradeOffer.getAdjustedFirstBuyItem()
Returns a copy of the first buy item of this trade offer, with its price adjusted depending on the demand bonus, the special price and the price multiplier.TradeOffer.getOriginalFirstBuyItem()
Returns the first buy item of this trade offer.TradeOffer.getSecondBuyItem()
Returns the second buy item of this trade offer.TradeOffer.getSellItem()
Returns the sell item of this trade offer.MerchantInventory.getStack
(int slot) Fetches the stack currently stored at the given slot.MerchantInventory.removeStack
(int slot) Removes the stack currently stored at the indicated slot.MerchantInventory.removeStack
(int slot, int amount) Removes a specific number of items from the given slot.Modifier and TypeMethodDescriptionprivate boolean
TradeOffer.acceptsBuy
(ItemStack given, ItemStack sample) boolean
TradeOffer.depleteBuyItems
(ItemStack firstBuyStack, ItemStack secondBuyStack) TradeOfferList.getValidOffer
(ItemStack firstBuyItem, ItemStack secondBuyItem, int index) boolean
TradeOffer.matchesBuyItems
(ItemStack first, ItemStack second) void
Merchant.onSellingItem
(ItemStack stack) void
SimpleMerchant.onSellingItem
(ItemStack stack) void
ModifierConstructorDescriptionSellItemFactory
(ItemStack stack, int price, int count, int maxUses, int experience) SellItemFactory
(ItemStack stack, int price, int count, int maxUses, int experience, float multiplier) TradeOffer
(ItemStack buyItem, ItemStack sellItem, int maxUses, int merchantExperience, float priceMultiplier) TradeOffer
(ItemStack firstBuyItem, ItemStack secondBuyItem, ItemStack sellItem, int maxUses, int merchantExperience, float priceMultiplier) TradeOffer
(ItemStack firstBuyItem, ItemStack secondBuyItem, ItemStack sellItem, int uses, int maxUses, int merchantExperience, float priceMultiplier) TradeOffer
(ItemStack firstBuyItem, ItemStack secondBuyItem, ItemStack sellItem, int uses, int maxUses, int merchantExperience, float priceMultiplier, int demandBonus) -
Uses of ItemStack in net.minecraft.village.raid
-
Uses of ItemStack in net.minecraft.world.explosion
Modifier and TypeMethodDescriptionprivate static void
Explosion.tryMergeStack
(ObjectArrayList<com.mojang.datafixers.util.Pair<ItemStack, BlockPos>> stacks, ItemStack stack, BlockPos pos) Modifier and TypeMethodDescriptionprivate static void
Explosion.tryMergeStack
(ObjectArrayList<com.mojang.datafixers.util.Pair<ItemStack, BlockPos>> stacks, ItemStack stack, BlockPos pos)
AbstractBlock.AbstractBlockState.getDroppedStacks(net.minecraft.loot.context.LootContext.Builder)
instead.