Uses of Class
org.bukkit.inventory.ItemStack
Package
Description
The root package of the Bukkit API, contains generalized API classes.
Classes relevant to advancements.
Classes used to manipulate the voxels in a
world
,
including special states.Generalized BlockData classes.
Classes dedicated to handling a plugin's runtime configuration.
Classes relating to the specialized enhancements to
item stacks
, as part of the meta data
.Interfaces for non-voxel objects that can exist in a
world
, including all players, monsters, projectiles, etc.Events
triggered from an enchantment table
.Events
relating to entities that hang
.Classes involved in manipulating player inventories and item interactions.
The interfaces used when manipulating extra data can can be stored inside
item stacks
.Classes relevant to loot table manipulation and generation.
Classes that represents various voxel types and states.
-
Uses of ItemStack in org.bukkit
Modifier and TypeMethodDescriptionstatic ItemStack
Get the crafted item using the list ofItemStack
provided.static ItemStack
Get the crafted item using the list ofItemStack
provided.Get the crafted item using the list ofItemStack
provided.Get the crafted item using the list ofItemStack
provided.static ItemStack
Bukkit.createExplorerMap
(World world, Location location, StructureType structureType) Create a new explorer map targeting the closest nearby structure of a givenStructureType
.static ItemStack
Bukkit.createExplorerMap
(World world, Location location, StructureType structureType, int radius, boolean findUnexplored) Create a new explorer map targeting the closest nearby structure of a givenStructureType
.Server.createExplorerMap
(World world, Location location, StructureType structureType) Create a new explorer map targeting the closest nearby structure of a givenStructureType
.Server.createExplorerMap
(World world, Location location, StructureType structureType, int radius, boolean findUnexplored) Create a new explorer map targeting the closest nearby structure of a givenStructureType
.UnsafeValues.modifyItemStack
(ItemStack stack, String arguments) Deprecated.Modifier and TypeMethodDescriptionstatic ItemStack
Get the crafted item using the list ofItemStack
provided.static ItemStack
Get the crafted item using the list ofItemStack
provided.Get the crafted item using the list ofItemStack
provided.Get the crafted item using the list ofItemStack
provided.static ItemCraftResult
Bukkit.craftItemResult
(ItemStack[] craftingMatrix, World world) Get the crafted item using the list ofItemStack
provided.static ItemCraftResult
Bukkit.craftItemResult
(ItemStack[] craftingMatrix, World world, Player player) Get the crafted item using the list ofItemStack
provided.Server.craftItemResult
(ItemStack[] craftingMatrix, World world) Get the crafted item using the list ofItemStack
provided.Server.craftItemResult
(ItemStack[] craftingMatrix, World world, Player player) Get the crafted item using the list ofItemStack
provided.Drops an item at the specifiedLocation
Drops an item at the specifiedLocation
Note that functions will run before the entity is spawnedWorld.dropItemNaturally
(Location location, ItemStack item) Drops an item at the specifiedLocation
with a random offsetWorld.dropItemNaturally
(Location location, ItemStack item, Consumer<? super Item> function) Drops an item at the specifiedLocation
with a random offset Note that functions will run before the entity is spawnedstatic Recipe
Bukkit.getCraftingRecipe
(ItemStack[] craftingMatrix, World world) Get theRecipe
for the list of ItemStacks provided.Server.getCraftingRecipe
(ItemStack[] craftingMatrix, World world) Get theRecipe
for the list of ItemStacks provided.Bukkit.getRecipesFor
(ItemStack result) Get a list of all recipes for a given item.Server.getRecipesFor
(ItemStack result) Get a list of all recipes for a given item.UnsafeValues.getTranslationKey
(ItemStack itemStack) Deprecated.UnsafeValues.modifyItemStack
(ItemStack stack, String arguments) Deprecated. -
Uses of ItemStack in org.bukkit.advancement
-
Uses of ItemStack in org.bukkit.block
Modifier and TypeMethodDescriptionBrushableBlock.getItem()
Get the item which will be revealed when the sand is fully brushed away and uncovered.Campfire.getItem
(int index) Jukebox.getRecord()
Gets the record item inserted into the jukebox.Modifier and TypeMethodDescriptionBlock.getDrops()
Returns a list of items which would drop by destroying this blockReturns a list of items which would drop by destroying this block with a specific toolReturns a list of items which would drop by the entity destroying this block with a specific toolModifier and TypeMethodDescriptionboolean
Block.breakNaturally
(ItemStack tool) Breaks the block and spawns items as if a player had digged it with a specific toolReturns a list of items which would drop by destroying this block with a specific toolReturns a list of items which would drop by the entity destroying this block with a specific toolboolean
Block.isPreferredTool
(ItemStack tool) Returns if the given item is a preferred choice to break this Block.void
Sets the item which will be revealed when the sand is fully brushed away and uncovered.void
void
Sets the record being played. -
Uses of ItemStack in org.bukkit.block.data
Modifier and TypeMethodDescriptionboolean
BlockData.isPreferredTool
(ItemStack tool) Returns if the given item is a preferred choice to break this Block. -
Uses of ItemStack in org.bukkit.configuration
Modifier and TypeMethodDescriptionConfigurationSection.getItemStack
(String path) Gets the requested ItemStack by path.ConfigurationSection.getItemStack
(String path, ItemStack def) Gets the requestedItemStack
by path, returning a default value if not found.MemorySection.getItemStack
(String path) MemorySection.getItemStack
(String path, ItemStack def) Modifier and TypeMethodDescriptionConfigurationSection.getItemStack
(String path, ItemStack def) Gets the requestedItemStack
by path, returning a default value if not found.MemorySection.getItemStack
(String path, ItemStack def) -
Uses of ItemStack in org.bukkit.enchantments
Modifier and TypeMethodDescriptionabstract boolean
Enchantment.canEnchantItem
(ItemStack item) Checks if this Enchantment may be applied to the givenItemStack
.boolean
Check whether this target includes the specified item. -
Uses of ItemStack in org.bukkit.entity
Modifier and TypeMethodDescriptionArmorStand.getBoots()
Deprecated.ArmorStand.getChestplate()
Deprecated.SizedFireball.getDisplayItem()
Gets the displayItemStack
.ArmorStand.getHelmet()
Deprecated.preferEntityEquipment.getHelmet()
AbstractArrow.getItem()
Gets the ItemStack which will be picked up from this arrow.EnderSignal.getItem()
Get theItemStack
to be displayed while in the air and to be dropped on death.ItemFrame.getItem()
Get the item in this frameOminousItemSpawner.getItem()
Gets the item which will be spawned by this spawner.ThrowableProjectile.getItem()
Gets the ItemStack the thrown projectile will display.ThrownPotion.getItem()
Returns a copy of the ItemStack for this thrown potion.ArmorStand.getItemInHand()
Deprecated.HumanEntity.getItemInHand()
Deprecated.Humans may now dual wield in their off hand, use explicit methods inPlayerInventory
.LivingEntity.getItemInUse()
Gets the item that the player is using (eating food, drawing back a bow, blocking, etc.)HumanEntity.getItemOnCursor()
Returns the ItemStack currently on your cursor, can be empty.Item.getItemStack()
Gets the item stack associated with this item drop.ItemDisplay.getItemStack()
Gets the displayed item stack.ArmorStand.getLeggings()
Deprecated.Modifier and TypeMethodDescriptionHumanEntity.fireworkBoost
(ItemStack fireworkItemStack) Perform a firework boost.LivingEntity.getDrinkingSound
(ItemStack itemStack) LivingEntity.getEatingSound
(ItemStack itemStack) boolean
Animals.isBreedItem
(ItemStack stack) Check if the provided ItemStack is the correct item used for breeding this entity.void
Open aMaterial.WRITTEN_BOOK
for a Playervoid
Player.sendEquipmentChange
(LivingEntity entity, EquipmentSlot slot, ItemStack item) Send an equipment change for the target entity.void
Deprecated.void
ArmorStand.setChestplate
(ItemStack item) Deprecated.void
SizedFireball.setDisplayItem
(ItemStack item) Sets the displayItemStack
for the fireball.void
Deprecated.void
Sets the ItemStack which will be picked up from this arrow.void
Set theItemStack
to be displayed while in the air and to be dropped on death.void
Set the item in this framevoid
Set the item in this framevoid
Sets the item which will be spawned by this spawner.void
Sets the display ItemStack for the thrown projectile.void
Set the ItemStack for this thrown potion.void
ArmorStand.setItemInHand
(ItemStack item) Deprecated.void
HumanEntity.setItemInHand
(ItemStack item) Deprecated.Humans may now dual wield in their off hand, use explicit methods inPlayerInventory
.void
HumanEntity.setItemOnCursor
(ItemStack item) Sets the item to the given ItemStack, this will replace whatever the user was moving.void
Item.setItemStack
(ItemStack stack) Sets the item stack associated with this item drop.void
ItemDisplay.setItemStack
(ItemStack item) Sets the displayed item stack.void
ArmorStand.setLeggings
(ItemStack item) Deprecated.Modifier and TypeMethodDescriptionvoid
Player.sendEquipmentChange
(LivingEntity entity, Map<EquipmentSlot, ItemStack> items) Send multiple equipment changes for the target entity. -
Uses of ItemStack in org.bukkit.event.block
Modifier and TypeMethodDescriptionBlockDispenseEvent.getItem()
Gets the item that is being dispensed.BlockDamageAbortEvent.getItemInHand()
Gets the ItemStack for the item currently in the player's hand.BlockDamageEvent.getItemInHand()
Gets the ItemStack for the item currently in the player's hand.BlockPlaceEvent.getItemInHand()
Gets the item in the player's hand when they placed the block.BlockCookEvent.getResult()
Gets the resultant ItemStack for this eventBlockCookEvent.getSource()
Gets the smelted ItemStack for this eventInventoryBlockStartEvent.getSource()
Gets the source ItemStack for this event.BlockShearEntityEvent.getTool()
Gets the item used to shear this sheep.Modifier and TypeMethodDescriptionvoid
Sets the item being dispensed.void
Sets the resultant ItemStack for this eventModifierConstructorDescriptionBlockCookEvent
(Block block, ItemStack source, ItemStack result) BlockDamageAbortEvent
(Player player, Block block, ItemStack itemInHand) BlockDamageEvent
(Player player, Block block, ItemStack itemInHand, boolean instaBreak) BlockDispenseArmorEvent
(Block block, ItemStack dispensed, LivingEntity target) BlockDispenseEvent
(Block block, ItemStack dispensed, Vector velocity) BlockMultiPlaceEvent
(List<BlockState> states, Block clicked, ItemStack itemInHand, Player thePlayer, boolean canBuild) BlockPlaceEvent
(Block placedBlock, BlockState replacedBlockState, Block placedAgainst, ItemStack itemInHand, Player thePlayer, boolean canBuild) Deprecated.BlockPlaceEvent
(Block placedBlock, BlockState replacedBlockState, Block placedAgainst, ItemStack itemInHand, Player thePlayer, boolean canBuild, EquipmentSlot hand) BlockShearEntityEvent
(Block dispenser, Entity sheared, ItemStack tool) BrewingStartEvent
(Block furnace, ItemStack source, int brewingTime) CampfireStartEvent
(Block furnace, ItemStack source, CampfireRecipe recipe) InventoryBlockStartEvent
(Block block, ItemStack source) -
Uses of ItemStack in org.bukkit.event.enchantment
Modifier and TypeMethodDescriptionEnchantItemEvent.getItem()
Gets the item to be enchanted (can be modified)PrepareItemEnchantEvent.getItem()
Gets the item to be enchanted.ModifierConstructorDescriptionEnchantItemEvent
(Player enchanter, InventoryView view, Block table, ItemStack item, int level, Map<Enchantment, Integer> enchants, Enchantment enchantmentHint, int levelHint, int i) PrepareItemEnchantEvent
(Player enchanter, InventoryView view, Block table, ItemStack item, EnchantmentOffer[] offers, int bonus) -
Uses of ItemStack in org.bukkit.event.entity
Modifier and TypeMethodDescriptionEntityShootBowEvent.getBow()
Gets the bow ItemStack used to fire the arrow.EntityBreedEvent.getBredWith()
The ItemStack that was used to initiate breeding, if present.EntityShootBowEvent.getConsumable()
Get the ItemStack to be consumed in this event (if any).PiglinBarterEvent.getInput()
Gets the input of the barter.FoodLevelChangeEvent.getItem()
Gets the item that triggered this event, if any.Modifier and TypeMethodDescriptionEntityDeathEvent.getDrops()
Gets all the items which will drop when the entity diesPiglinBarterEvent.getOutcome()
Returns a mutable list representing the outcome of the barter.ModifierConstructorDescriptionEntityBreedEvent
(LivingEntity child, LivingEntity mother, LivingEntity father, LivingEntity breeder, ItemStack bredWith, int experience) EntityShootBowEvent
(LivingEntity shooter, ItemStack bow, ItemStack consumable, Entity projectile, EquipmentSlot hand, float force, boolean consumeItem) FoodLevelChangeEvent
(HumanEntity what, int level, ItemStack item) PiglinBarterEvent
(Piglin what, ItemStack input, List<ItemStack> outcome) ModifierConstructorDescriptionEntityDeathEvent
(LivingEntity entity, DamageSource damageSource, List<ItemStack> drops) EntityDeathEvent
(LivingEntity what, DamageSource damageSource, List<ItemStack> drops, int droppedExp) PiglinBarterEvent
(Piglin what, ItemStack input, List<ItemStack> outcome) PlayerDeathEvent
(Player player, DamageSource damageSource, List<ItemStack> drops, int droppedExp, int newExp, int newTotalExp, int newLevel, String deathMessage) PlayerDeathEvent
(Player player, DamageSource damageSource, List<ItemStack> drops, int droppedExp, int newExp, String deathMessage) PlayerDeathEvent
(Player player, DamageSource damageSource, List<ItemStack> drops, int droppedExp, String deathMessage) -
Uses of ItemStack in org.bukkit.event.hanging
Modifier and TypeMethodDescriptionHangingPlaceEvent.getItemStack()
Gets the item from which the hanging entity originatedModifierConstructorDescriptionHangingPlaceEvent
(Hanging hanging, Player player, Block block, BlockFace blockFace, EquipmentSlot hand, ItemStack itemStack) -
Uses of ItemStack in org.bukkit.event.inventory
Modifier and TypeMethodDescriptionInventoryClickEvent.getCurrentItem()
Gets the ItemStack currently in the clicked slot.InventoryClickEvent.getCursor()
Gets the current ItemStack on the cursor.InventoryCreativeEvent.getCursor()
InventoryDragEvent.getCursor()
Gets the result cursor after the drag is done.BrewingStandFuelEvent.getFuel()
Gets the ItemStack of the fuel before the amount was subtracted.FurnaceBurnEvent.getFuel()
Gets the fuel ItemStack for this eventInventoryMoveItemEvent.getItem()
Gets the ItemStack being moved; if modified, the original item will not be removed from the source inventory.InventoryDragEvent.getOldCursor()
Gets an ItemStack representing the cursor prior to any modifications as a result of this drag.PrepareInventoryResultEvent.getResult()
Get result item, may be null.Modifier and TypeMethodDescriptionInventoryDragEvent.getNewItems()
Gets all items to be added to the inventory in this drag.BrewEvent.getResults()
Gets the resulting items in the Brewing Stand.Modifier and TypeMethodDescriptionvoid
InventoryClickEvent.setCurrentItem
(ItemStack stack) Sets the ItemStack currently in the clicked slot.void
Deprecated.This changes the ItemStack in their hand before any calculations are applied to the Inventory, which has a tendency to create inconsistencies between the Player and the server, and to make unexpected changes in the behavior of the clicked Inventory.void
void
Sets the result cursor after the drag is done.void
Sets the ItemStack being moved; if this is different from the original ItemStack, the original item will not be removed from the source inventory.void
Set result item, may be null.ModifierConstructorDescriptionBrewingStandFuelEvent
(Block brewingStand, ItemStack fuel, int fuelPower) FurnaceBurnEvent
(Block furnace, ItemStack fuel, int burnTime) FurnaceSmeltEvent
(Block furnace, ItemStack source, ItemStack result) FurnaceStartSmeltEvent
(Block furnace, ItemStack source, CookingRecipe<?> recipe) InventoryCreativeEvent
(InventoryView what, InventoryType.SlotType type, int slot, ItemStack newItem) InventoryDragEvent
(InventoryView what, ItemStack newCursor, ItemStack oldCursor, boolean right, Map<Integer, ItemStack> slots) InventoryMoveItemEvent
(Inventory sourceInventory, ItemStack itemStack, Inventory destinationInventory, boolean didSourceInitiate) PrepareAnvilEvent
(InventoryView inventory, ItemStack result) PrepareGrindstoneEvent
(InventoryView inventory, ItemStack result) PrepareInventoryResultEvent
(InventoryView inventory, ItemStack result) PrepareSmithingEvent
(InventoryView inventory, ItemStack result) ModifierConstructorDescriptionBrewEvent
(Block brewer, BrewerInventory contents, List<ItemStack> results, int fuelLevel) InventoryDragEvent
(InventoryView what, ItemStack newCursor, ItemStack oldCursor, boolean right, Map<Integer, ItemStack> slots) -
Uses of ItemStack in org.bukkit.event.player
Modifier and TypeMethodDescriptionPlayerArmorStandManipulateEvent.getArmorStandItem()
Returns the item held by the armor stand.PlayerTakeLecternBookEvent.getBook()
Gets the current ItemStack on the lectern.PlayerItemBreakEvent.getBrokenItem()
Gets the item that brokePlayerBucketEntityEvent.getEntityBucket()
Gets the bucket that theEntity
will be put into.PlayerBucketFishEvent.getFishBucket()
Deprecated.PlayerInteractEvent.getItem()
Returns the item in hand represented by this eventPlayerItemConsumeEvent.getItem()
Gets the item that is being consumed.PlayerItemDamageEvent.getItem()
Gets the item being damaged.PlayerItemMendEvent.getItem()
Get theItemStack
to be repaired.PlayerRiptideEvent.getItem()
Gets the item containing the used enchantment.PlayerShearEntityEvent.getItem()
Gets the item used to shear the entity.PlayerBucketEvent.getItemStack()
Get the resulting item in hand after the bucket eventPlayerSwapHandItemsEvent.getMainHandItem()
Gets the item switched to the main hand.PlayerSwapHandItemsEvent.getOffHandItem()
Gets the item switched to the off hand.PlayerBucketEntityEvent.getOriginalBucket()
Gets the bucket used to capture theEntity
.PlayerArmorStandManipulateEvent.getPlayerItem()
Returns the item held by the player.PlayerBucketFishEvent.getWaterBucket()
Deprecated.Modifier and TypeMethodDescriptionPlayerHarvestBlockEvent.getItemsHarvested()
Gets a list of items that are being harvested from this block.Modifier and TypeMethodDescriptionvoid
Set the item being consumedvoid
PlayerBucketEvent.setItemStack
(ItemStack itemStack) Set the item in hand after the eventvoid
PlayerSwapHandItemsEvent.setMainHandItem
(ItemStack mainHandItem) Sets the item in the main hand.void
PlayerSwapHandItemsEvent.setOffHandItem
(ItemStack offHandItem) Sets the item in the off hand.ModifierConstructorDescriptionPlayerArmorStandManipulateEvent
(Player who, ArmorStand clickedEntity, ItemStack playerItem, ItemStack armorStandItem, EquipmentSlot slot) Deprecated.PlayerArmorStandManipulateEvent
(Player who, ArmorStand clickedEntity, ItemStack playerItem, ItemStack armorStandItem, EquipmentSlot slot, EquipmentSlot hand) PlayerBucketEmptyEvent
(Player who, Block blockClicked, BlockFace blockFace, Material bucket, ItemStack itemInHand) Deprecated.PlayerBucketEmptyEvent
(Player who, Block block, Block blockClicked, BlockFace blockFace, Material bucket, ItemStack itemInHand) Deprecated.PlayerBucketEmptyEvent
(Player who, Block block, Block blockClicked, BlockFace blockFace, Material bucket, ItemStack itemInHand, EquipmentSlot hand) PlayerBucketEntityEvent
(Player player, Entity entity, ItemStack originalBucket, ItemStack entityBucket, EquipmentSlot hand) PlayerBucketEvent
(Player who, Block blockClicked, BlockFace blockFace, Material bucket, ItemStack itemInHand) Deprecated.PlayerBucketEvent
(Player who, Block block, Block blockClicked, BlockFace blockFace, Material bucket, ItemStack itemInHand) Deprecated.PlayerBucketEvent
(Player who, Block block, Block blockClicked, BlockFace blockFace, Material bucket, ItemStack itemInHand, EquipmentSlot hand) PlayerBucketFillEvent
(Player who, Block blockClicked, BlockFace blockFace, Material bucket, ItemStack itemInHand) Deprecated.PlayerBucketFillEvent
(Player who, Block block, Block blockClicked, BlockFace blockFace, Material bucket, ItemStack itemInHand) Deprecated.PlayerBucketFillEvent
(Player who, Block block, Block blockClicked, BlockFace blockFace, Material bucket, ItemStack itemInHand, EquipmentSlot hand) PlayerBucketFishEvent
(Player player, Fish fish, ItemStack waterBucket, ItemStack fishBucket, EquipmentSlot hand) Deprecated.PlayerInteractEvent
(Player who, Action action, ItemStack item, Block clickedBlock, BlockFace clickedFace) PlayerInteractEvent
(Player who, Action action, ItemStack item, Block clickedBlock, BlockFace clickedFace, EquipmentSlot hand) PlayerInteractEvent
(Player who, Action action, ItemStack item, Block clickedBlock, BlockFace clickedFace, EquipmentSlot hand, Vector clickedPosition) PlayerItemBreakEvent
(Player player, ItemStack brokenItem) PlayerItemConsumeEvent
(Player player, ItemStack item) Deprecated.PlayerItemConsumeEvent
(Player player, ItemStack item, EquipmentSlot hand) PlayerItemDamageEvent
(Player player, ItemStack what, int damage) PlayerItemMendEvent
(Player who, ItemStack item, ExperienceOrb experienceOrb, int repairAmount) Deprecated.PlayerItemMendEvent
(Player who, ItemStack item, EquipmentSlot slot, ExperienceOrb experienceOrb, int repairAmount) PlayerRiptideEvent
(Player who, ItemStack item) Deprecated.PlayerRiptideEvent
(Player who, ItemStack item, Vector velocity) PlayerShearEntityEvent
(Player who, Entity what, ItemStack item, EquipmentSlot hand) PlayerSwapHandItemsEvent
(Player player, ItemStack mainHandItem, ItemStack offHandItem) ModifierConstructorDescriptionPlayerHarvestBlockEvent
(Player player, Block harvestedBlock, List<ItemStack> itemsHarvested) Deprecated.PlayerHarvestBlockEvent
(Player player, Block harvestedBlock, EquipmentSlot hand, List<ItemStack> itemsHarvested) -
Uses of ItemStack in org.bukkit.event.world
Modifier and TypeMethodDescriptionLootGenerateEvent.getLoot()
Get a mutable list of all loot to be generated.Modifier and TypeMethodDescriptionvoid
LootGenerateEvent.setLoot
(Collection<ItemStack> loot) Set the loot to be generated.ModifierConstructorDescriptionLootGenerateEvent
(World world, Entity entity, InventoryHolder inventoryHolder, LootTable lootTable, LootContext lootContext, List<ItemStack> items, boolean plugin) -
Uses of ItemStack in org.bukkit.inventory
Modifier and TypeMethodDescriptionItemStack.clone()
ItemFactory.createItemStack
(String input) Create a newItemStack
given the supplied input.ItemType.createItemStack()
Constructs a new itemstack with this item type that has the amount 1.ItemType.createItemStack
(int amount) Constructs a new itemstack with this item type.ItemType.Typed.createItemStack
(int amount, Consumer<? super M> metaConfigurator) Constructs a new item stack with this item type.ItemType.Typed.createItemStack
(Consumer<? super M> metaConfigurator) Constructs a new item stack with this item type with the amount 1.static ItemStack
ItemStack.deserialize
(Map<String, Object> args) Required method for configuration serializationItemFactory.enchantItem
(Entity entity, ItemStack item, int level, boolean allowTreasures) Enchants the given item at the provided level.ItemFactory.enchantItem
(ItemStack item, int level, boolean allowTreasures) Enchants the given item at the provided level.ItemFactory.enchantItem
(World world, ItemStack item, int level, boolean allowTreasures) Enchants the given item at the provided level.MerchantRecipe.getAdjustedIngredient1()
Gets theadjusted
first ingredient.HorseInventory.getArmor()
Gets the item in the horse's armor slot.EntityEquipment.getArmorContents()
Gets all ItemStacks from the armor slots.PlayerInventory.getArmorContents()
Gets all ItemStacks from the armor slots.EntityEquipment.getBoots()
Gets a copy of the boots currently being worn by the entityPlayerInventory.getBoots()
Return the ItemStack from the boots slotEntityEquipment.getChestplate()
Gets a copy of the chest plate currently being worn by the entityPlayerInventory.getChestplate()
Return the ItemStack from the chestplate slotInventory.getContents()
Returns all ItemStacks from the inventoryfinal ItemStack
InventoryView.getCursor()
Get the item on the cursor of one of the viewing players.LlamaInventory.getDecor()
Gets the item in the llama's decor slot.PlayerInventory.getExtraContents()
Get all additional ItemStacks stored in this inventory.BrewerInventory.getFuel()
Get the current fuel for brewing.FurnaceInventory.getFuel()
Get the current fuel.EntityEquipment.getHelmet()
Gets a copy of the helmet currently being worn by the entityPlayerInventory.getHelmet()
Return the ItemStack from the helmet slotBrewerInventory.getIngredient()
Get the current ingredient for brewing.CookingRecipe.getInput()
Get the input material.StonecuttingRecipe.getInput()
Get the input material.BeaconInventory.getItem()
Get the item powering the beacon.DecoratedPotInventory.getItem()
Get the item stack in the decorated pot.EnchantingInventory.getItem()
Get the item being enchanted.EntityEquipment.getItem
(EquipmentSlot slot) Gets the ItemStack at the given equipment slot in the inventory.Inventory.getItem
(int index) Returns the ItemStack found in the slot at the given indexInventoryView.getItem
(int slot) Gets one item in this inventory view by its raw slot ID.PlayerInventory.getItem
(EquipmentSlot slot) Gets the ItemStack at the given equipment slot in the inventory.EntityEquipment.getItemInHand()
Deprecated.entities can duel wield now use the methods for the specific hand insteadPlayerInventory.getItemInHand()
Deprecated.players can duel wield now use the methods for the specific hand insteadEntityEquipment.getItemInMainHand()
Gets a copy of the item the entity is currently holding in their main hand.PlayerInventory.getItemInMainHand()
Gets a copy of the item the player is currently holding in their main hand.EntityEquipment.getItemInOffHand()
Gets a copy of the item the entity is currently holding in their off hand.PlayerInventory.getItemInOffHand()
Gets a copy of the item the player is currently holding in their off hand.RecipeChoice.ExactChoice.getItemStack()
RecipeChoice.getItemStack()
Deprecated.for compatibility onlyRecipeChoice.MaterialChoice.getItemStack()
EntityEquipment.getLeggings()
Gets a copy of the leggings currently being worn by the entityPlayerInventory.getLeggings()
Return the ItemStack from the leg slotCraftingInventory.getMatrix()
Get the contents of the crafting matrix.JukeboxInventory.getRecord()
Get the record in the jukebox.CookingRecipe.getResult()
Get the result of this recipe.CraftingInventory.getResult()
Check what item is in the result slot of this crafting inventory.CraftingRecipe.getResult()
Get the result of this recipe.FurnaceInventory.getResult()
Get the current item in the result slot.ItemCraftResult.getResult()
The resultingItemStack
that was crafted.MerchantRecipe.getResult()
Recipe.getResult()
Get the result of this recipe.SmithingInventory.getResult()
Check what item is in the result slot of this smithing table.SmithingRecipe.getResult()
StonecuttingRecipe.getResult()
Get the result of this recipe.ItemCraftResult.getResultingMatrix()
Gets the resulting matrix from the crafting operation.AbstractHorseInventory.getSaddle()
Gets the item in the horse's saddle slot.EnchantingInventory.getSecondary()
Get the secondary item being used for the enchant.FurnaceInventory.getSmelting()
Get the item currently smelting.Inventory.getStorageContents()
Return the contents from the section of the inventory where items can reasonably be expected to be stored.Modifier and TypeMethodDescriptionStores the given ItemStacks in the inventory.Finds all slots in the inventory containing any ItemStacks with the given ItemStack.Returns a HashMap with all slots and ItemStacks in the inventory with the given Material.RecipeChoice.ExactChoice.getChoices()
ShapelessRecipe.getIngredientList()
Get the list of ingredients used for this recipe.ShapedRecipe.getIngredientMap()
Get a copy of the ingredients map.MerchantRecipe.getIngredients()
ItemCraftResult.getOverflowItems()
Gets the overflowed items for items that don't fit back into the crafting matrix.Inventory.iterator()
Inventory.iterator
(int index) Returns an iterator starting at the given index.Inventory.removeItem
(ItemStack... items) Removes the given ItemStacks from the inventory.Modifier and TypeMethodDescriptionvoid
MerchantRecipe.addIngredient
(ItemStack item) Stores the given ItemStacks in the inventory.void
Modifies the amount of the givenItemStack
in the same way as MerchantRecipe dynamically adjusts the amount of the first ingredient during trading.Finds all slots in the inventory containing any ItemStacks with the given ItemStack.Returns an appropriate item meta for the specified stack.boolean
Checks if the inventory contains any ItemStacks matching the given ItemStack.boolean
Checks if the inventory contains at least the minimum amount specified of exactly matching ItemStacks.boolean
Inventory.containsAtLeast
(ItemStack item, int amount) Checks if the inventory contains ItemStacks matching the given ItemStack whose amounts sum to at least the minimum amount specified.ItemFactory.enchantItem
(Entity entity, ItemStack item, int level, boolean allowTreasures) Enchants the given item at the provided level.ItemFactory.enchantItem
(ItemStack item, int level, boolean allowTreasures) Enchants the given item at the provided level.ItemFactory.enchantItem
(World world, ItemStack item, int level, boolean allowTreasures) Enchants the given item at the provided level.int
Returns the first slot in the inventory containing an ItemStack with the given stack.boolean
ItemFactory.isApplicable
(ItemMeta meta, ItemStack stack) This method checks the item meta to confirm that it is applicable (no data lost if applied) to the specified ItemStack.boolean
This method is the same as equals, but does not consider stack size (amount).void
Removes all stacks in the inventory matching the given stack.Inventory.removeItem
(ItemStack... items) Removes the given ItemStacks from the inventory.void
Sets the item in the horse's armor slot.void
EntityEquipment.setArmorContents
(ItemStack[] items) Sets the entities armor to the provided array of ItemStacksvoid
PlayerInventory.setArmorContents
(ItemStack[] items) Put the given ItemStacks into the armor slotsvoid
Sets the boots worn by the entityvoid
Sets the boots worn by the entityvoid
Put the given ItemStack into the boots slot.void
EntityEquipment.setChestplate
(ItemStack chestplate) Sets the chest plate worn by the entityvoid
EntityEquipment.setChestplate
(ItemStack chestplate, boolean silent) Sets the chest plate worn by the entityvoid
PlayerInventory.setChestplate
(ItemStack chestplate) Put the given ItemStack into the chestplate slot.void
Inventory.setContents
(ItemStack[] items) Completely replaces the inventory's contents.final void
Sets the item on the cursor of one of the viewing players.void
Sets the item in the llama's decor slot.void
PlayerInventory.setExtraContents
(ItemStack[] items) Put the given ItemStacks into the extra slots
SeePlayerInventory.getExtraContents()
for an explanation of extra slots.void
Set the current fuel for brewing.void
Set the current fuel.void
Sets the helmet worn by the entityvoid
Sets the helmet worn by the entityvoid
Put the given ItemStack into the helmet slot.void
BrewerInventory.setIngredient
(ItemStack ingredient) Set the current ingredient for brewing.void
Set the item powering the beacon.void
Set the item stack in the decorated pot.void
Set the item being enchanted.void
EntityEquipment.setItem
(EquipmentSlot slot, ItemStack item) Stores the ItemStack at the given equipment slot in the inventory.void
EntityEquipment.setItem
(EquipmentSlot slot, ItemStack item, boolean silent) Stores the ItemStack at the given equipment slot in the inventory.void
Stores the ItemStack at the given index of the inventory.void
Sets one item in this inventory view by its raw slot ID.void
Stores the ItemStack at the given index of the inventory.void
PlayerInventory.setItem
(EquipmentSlot slot, ItemStack item) Stores the ItemStack at the given equipment slot in the inventory.void
EntityEquipment.setItemInHand
(ItemStack stack) Deprecated.entities can duel wield now use the methods for the specific hand insteadvoid
PlayerInventory.setItemInHand
(ItemStack stack) Deprecated.players can duel wield now use the methods for the specific hand insteadvoid
EntityEquipment.setItemInMainHand
(ItemStack item) Sets the item the entity is holding in their main hand.void
EntityEquipment.setItemInMainHand
(ItemStack item, boolean silent) Sets the item the entity is holding in their main hand.void
PlayerInventory.setItemInMainHand
(ItemStack item) Sets the item the player is holding in their main hand.void
EntityEquipment.setItemInOffHand
(ItemStack item) Sets the item the entity is holding in their off hand.void
EntityEquipment.setItemInOffHand
(ItemStack item, boolean silent) Sets the item the entity is holding in their off hand.void
PlayerInventory.setItemInOffHand
(ItemStack item) Sets the item the player is holding in their off hand.void
EntityEquipment.setLeggings
(ItemStack leggings) Sets the leggings worn by the entityvoid
EntityEquipment.setLeggings
(ItemStack leggings, boolean silent) Sets the leggings worn by the entityvoid
PlayerInventory.setLeggings
(ItemStack leggings) Put the given ItemStack into the leg slot.void
Replace the contents of the crafting matrixvoid
Set the record in the jukebox.void
Set the item in the result slot of the crafting inventory.void
Set the current item in the result slot.void
Set the item in the result slot of the smithing tablevoid
Sets the item in the horse's saddle slot.void
EnchantingInventory.setSecondary
(ItemStack item) Set the secondary item being used for the enchant.void
FurnaceInventory.setSmelting
(ItemStack stack) Set the item currently smelting.void
Inventory.setStorageContents
(ItemStack[] items) Put the given ItemStacks into the storage slotsboolean
boolean
boolean
Modifier and TypeMethodDescriptionvoid
MerchantRecipe.setIngredients
(List<ItemStack> ingredients) ModifierConstructorDescriptionBlastingRecipe
(NamespacedKey key, ItemStack result, RecipeChoice input, float experience, int cookingTime) BlastingRecipe
(NamespacedKey key, ItemStack result, Material source, float experience, int cookingTime) CampfireRecipe
(NamespacedKey key, ItemStack result, RecipeChoice input, float experience, int cookingTime) CampfireRecipe
(NamespacedKey key, ItemStack result, Material source, float experience, int cookingTime) CookingRecipe
(NamespacedKey key, ItemStack result, RecipeChoice input, float experience, int cookingTime) Create a cooking recipe to craft the specified ItemStack.CookingRecipe
(NamespacedKey key, ItemStack result, Material source, float experience, int cookingTime) Create a cooking recipe to craft the specified ItemStack.protected
CraftingRecipe
(NamespacedKey key, ItemStack result) ExactChoice
(ItemStack stack) ExactChoice
(ItemStack... stacks) FurnaceRecipe
(ItemStack result, Material source) Deprecated.FurnaceRecipe
(ItemStack result, MaterialData source) Deprecated.FurnaceRecipe
(ItemStack result, MaterialData source, float experience) Deprecated.FurnaceRecipe
(ItemStack result, Material source, int data) Deprecated.FurnaceRecipe
(NamespacedKey key, ItemStack result, RecipeChoice input, float experience, int cookingTime) Create a furnace recipe to craft the specified ItemStack.FurnaceRecipe
(NamespacedKey key, ItemStack result, Material source, float experience, int cookingTime) Create a furnace recipe to craft the specified ItemStack.FurnaceRecipe
(NamespacedKey key, ItemStack result, Material source, int data, float experience, int cookingTime) Deprecated.Creates a new item stack derived from the specified stackMerchantRecipe
(ItemStack result, int maxUses) MerchantRecipe
(ItemStack result, int uses, int maxUses, boolean experienceReward) MerchantRecipe
(ItemStack result, int uses, int maxUses, boolean experienceReward, int villagerExperience, float priceMultiplier) MerchantRecipe
(ItemStack result, int uses, int maxUses, boolean experienceReward, int villagerExperience, float priceMultiplier, int demand, int specialPrice) ShapedRecipe
(ItemStack result) Deprecated.Recipes must have keys.ShapedRecipe
(NamespacedKey key, ItemStack result) Create a shaped recipe to craft the specified ItemStack.ShapelessRecipe
(ItemStack result) Deprecated.ShapelessRecipe
(NamespacedKey key, ItemStack result) Create a shapeless recipe to craft the specified ItemStack.SmithingRecipe
(NamespacedKey key, ItemStack result, RecipeChoice base, RecipeChoice addition) Deprecated.as of Minecraft 1.20, smithing recipes are now separated into two distinct recipe types,SmithingTransformRecipe
andSmithingTrimRecipe
.SmithingTransformRecipe
(NamespacedKey key, ItemStack result, RecipeChoice template, RecipeChoice base, RecipeChoice addition) Create a smithing recipe to produce the specified result ItemStack.SmokingRecipe
(NamespacedKey key, ItemStack result, RecipeChoice input, float experience, int cookingTime) SmokingRecipe
(NamespacedKey key, ItemStack result, Material source, float experience, int cookingTime) StonecuttingRecipe
(NamespacedKey key, ItemStack result, RecipeChoice input) Create a cooking recipe to craft the specified ItemStack.StonecuttingRecipe
(NamespacedKey key, ItemStack result, Material source) Create a Stonecutting recipe to craft the specified ItemStack. -
Uses of ItemStack in org.bukkit.inventory.meta
Modifier and TypeMethodDescriptionCrossbowMeta.getChargedProjectiles()
Returns an immutable list of the projectiles charged on this item.BundleMeta.getItems()
Returns an immutable list of the items stored in this item.Modifier and TypeMethodDescriptionvoid
CrossbowMeta.addChargedProjectile
(ItemStack item) Adds a charged projectile to this item.void
Adds an item to this item. -
Uses of ItemStack in org.bukkit.loot
Modifier and TypeMethodDescriptionLootTable.populateLoot
(Random random, LootContext context) Returns a mutable list of loot generated by this LootTable. -
Uses of ItemStack in org.bukkit.material
Modifier and TypeMethodDescriptionMaterialData.toItemStack()
Deprecated.this method creates an ItemStack of size 0 which is not generally useful.MaterialData.toItemStack
(int amount) Deprecated.Creates a new ItemStack based on this MaterialData
EntityEquipment.getBoots()