类的使用
org.bukkit.inventory.ItemStack
程序包
说明
Bukkit API的顶级程序包, 包含通用的API类和接口.
与进度有关的接口.
用于操作在
世界
内的三位像素(方块),包括一些特定的状态.各种方块的 BlockData 类.
专门用于处理插件运行时配置的类.
为在
世界
内存在的非三维像素单位(实体)提供的接口,包含玩家、怪物、抛射物等.参与操作玩家物品栏和物品交互的类.
用于操作可以存储在
物品堆
的额外数据的接口.Isolated components which may form part of item meta.
与战利品表产生与操作有关的类 (Minecraft Wiki - 战利品表).
代表每种体素(意义可参考维基百科或百度百科相关条目,即物品被抽象为体素)的种类和状态.
-
org.bukkit中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.Get the crafted item using the list ofItemStack
provided.Bukkit.createExplorerMap
(@NotNull World world, @NotNull Location location, @NotNull StructureType structureType) Create a new explorer map targeting the closest nearby structure of a givenStructureType
.Bukkit.createExplorerMap
(@NotNull World world, @NotNull Location location, @NotNull StructureType structureType, int radius, boolean findUnexplored) Create a new explorer map targeting the closest nearby structure of a givenStructureType
.Server.createExplorerMap
(@NotNull World world, @NotNull Location location, @NotNull StructureType structureType) Create a new explorer map targeting the closest nearby structure of a givenStructureType
.Server.createExplorerMap
(@NotNull World world, @NotNull Location location, @NotNull 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) 已过时。修饰符和类型方法说明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.Get the crafted item using the list ofItemStack
provided.static @NotNull ItemCraftResult
Bukkit.craftItemResult
(@NotNull ItemStack[] craftingMatrix, @NotNull World world) Get the crafted item using the list ofItemStack
provided.static @NotNull ItemCraftResult
Bukkit.craftItemResult
(@NotNull ItemStack[] craftingMatrix, @NotNull World world, @NotNull Player player) Get the crafted item using the list ofItemStack
provided.Server.craftItemResult
(@NotNull ItemStack[] craftingMatrix, @NotNull World world) Get the crafted item using the list ofItemStack
provided.Server.craftItemResult
(@NotNull ItemStack[] craftingMatrix, @NotNull World world, @NotNull Player player) Get the crafted item using the list ofItemStack
provided.在指定的位置
丢出一个物品.World.dropItem
(@NotNull Location location, @NotNull ItemStack item, @Nullable Consumer<? super Item> function) Drops an item at the specifiedLocation
Note that functions will run before the entity is spawnedWorld.dropItemNaturally
(@NotNull Location location, @NotNull ItemStack item) 在指定的位置
丢出一个随机偏移的物品.World.dropItemNaturally
(@NotNull Location location, @NotNull ItemStack item, @Nullable Consumer<? super Item> function) Drops an item at the specifiedLocation
with a random offset Note that functions will run before the entity is spawnedBukkit.getCraftingRecipe
(@NotNull ItemStack[] craftingMatrix, @NotNull World world) Get theRecipe
for the list of ItemStacks provided.Server.getCraftingRecipe
(@NotNull ItemStack[] craftingMatrix, @NotNull World world) Get theRecipe
for the list of ItemStacks provided.Bukkit.getRecipesFor
(@NotNull ItemStack result) 获取对指定物品适用的所有合成配方的列表.Server.getRecipesFor
(@NotNull ItemStack result) 获取对指定物品适用的所有合成配方的列表.UnsafeValues.getTranslationKey
(ItemStack itemStack) 已过时。UnsafeValues.modifyItemStack
(ItemStack stack, String arguments) 已过时。 -
org.bukkit.advancement中ItemStack的使用
-
org.bukkit.block中ItemStack的使用
修饰符和类型方法说明BrushableBlock.getItem()
Get the item which will be revealed when the sand is fully brushed away and uncovered.Campfire.getItem
(int index) Jukebox.getRecord()
获取插入该唱片机的唱片 (译注:这是较新版本才有的API, 建议使用getPlaying).修饰符和类型方法说明boolean
Block.breakNaturally
(@Nullable ItemStack tool) 破坏此方块并生成掉落物, 就像是玩家手持工具挖掘方块一样.返回当某实体使用某工具破坏此方块时掉落的物品.返回当使用特定工具破坏此方块时掉落的物品.boolean
Block.isPreferredTool
(@NotNull 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
设置将要播放的唱片, 唱片机将自动播放. -
org.bukkit.block.data中ItemStack的使用
-
org.bukkit.configuration中ItemStack的使用
修饰符和类型方法说明ConfigurationSection.getItemStack
(@NotNull String path) 在指定路径获取一个ItemStack
类型的值.ConfigurationSection.getItemStack
(@NotNull String path, @Nullable ItemStack def) 在指定路径上获取一个ItemStack
, 如果无法获取, 则直接返回默认值.MemorySection.getItemStack
(@NotNull String path) MemorySection.getItemStack
(@NotNull String path, @Nullable ItemStack def) -
org.bukkit.enchantments中ItemStack的使用
-
org.bukkit.entity中ItemStack的使用
修饰符和类型方法说明ArmorStand.getBoots()
已过时。ArmorStand.getChestplate()
已过时。SizedFireball.getDisplayItem()
Gets the displayItemStack
.ArmorStand.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()
获取在展示框内的物品.OminousItemSpawner.getItem()
Gets the item which will be spawned by this spawner.ThrowableProjectile.getItem()
Gets the ItemStack the thrown projectile will display.ThrownPotion.getItem()
返回此药水瓶物品的副本.ArmorStand.getItemInHand()
已过时。HumanEntity.getItemInHand()
已过时。人类现能双持, 请使用PlayerInventory
中更明确的方法LivingEntity.getItemInUse()
获取玩家正在使用的物品(吃食物、拉弓、格挡等)。HumanEntity.getItemOnCursor()
返回你的鼠标正在拖动的物品, 可能为空.Item.getItemStack()
获取与此掉落物相关的物品堆.ItemDisplay.getItemStack()
Gets the displayed item stack.ArmorStand.getLeggings()
已过时。AbstractArrow.getWeapon()
Gets the ItemStack which fired this arrow.修饰符和类型方法说明HumanEntity.fireworkBoost
(@NotNull ItemStack fireworkItemStack) Perform a firework boost.LivingEntity.getDrinkingSound
(@NotNull ItemStack itemStack) LivingEntity.getEatingSound
(@NotNull ItemStack itemStack) boolean
Animals.isBreedItem
(@NotNull ItemStack stack) Check if the provided ItemStack is the correct item used for breeding this entity.void
为玩家打开一本成书
.void
Player.sendEquipmentChange
(@NotNull LivingEntity entity, @NotNull EquipmentSlot slot, @Nullable ItemStack item) 向玩家发送某个实体的盔甲槽变化数据包.void
void
ArmorStand.setChestplate
(@Nullable ItemStack item) void
SizedFireball.setDisplayItem
(@NotNull ItemStack item) Sets the displayItemStack
for the fireball.void
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
设置在展示框内的物品.void
设置在此物品展示框中的物品.void
Sets the item which will be spawned by this spawner.void
Sets the display ItemStack for the thrown projectile.void
设置此药水瓶物品.void
ArmorStand.setItemInHand
(@Nullable ItemStack item) void
HumanEntity.setItemInHand
(@Nullable ItemStack item) 已过时。人类现能双持, 请使用PlayerInventory
中更明确的方法void
HumanEntity.setItemOnCursor
(@Nullable ItemStack item) 设置你正在拖动的物品, 将替换你所拖动的任何物品.void
Item.setItemStack
(@NotNull ItemStack stack) 设置与此掉落物相关的物品堆.void
ItemDisplay.setItemStack
(@Nullable ItemStack item) Sets the displayed item stack.void
ArmorStand.setLeggings
(@Nullable ItemStack item) void
Sets the ItemStack which fired this arrow.修饰符和类型方法说明void
Player.sendEquipmentChange
(@NotNull LivingEntity entity, @NotNull Map<EquipmentSlot, ItemStack> items) Send multiple equipment changes for the target entity. -
org.bukkit.event.block中ItemStack的使用
修饰符和类型方法说明BlockDispenseEvent.getItem()
获取被射出的物品.BlockDamageAbortEvent.getItemInHand()
Gets the ItemStack for the item currently in the player's hand.BlockDamageEvent.getItemInHand()
获取当前玩家手上的物品.BlockPlaceEvent.getItemInHand()
获取玩家放置的方块的物品形式(在玩家手上).BlockCookEvent.getResult()
获取烹饪后得到的物品堆 (比如熟食).BlockCookEvent.getSource()
获取被烹饪的物品堆 (比如生的食物).InventoryBlockStartEvent.getSource()
Gets the source ItemStack for this event.BlockShearEntityEvent.getTool()
获取剪这只羊(实体)的工具.修饰符和类型方法说明void
设置被射出的物品.void
设置烹饪后得到的物品堆.限定符构造器说明BlockDamageEvent
(@NotNull Player player, @NotNull Block block, @NotNull ItemStack itemInHand, boolean instaBreak) BlockDispenseArmorEvent
(@NotNull Block block, @NotNull ItemStack dispensed, @NotNull LivingEntity target) BlockMultiPlaceEvent
(@NotNull List<BlockState> states, @NotNull Block clicked, @NotNull ItemStack itemInHand, @NotNull Player thePlayer, boolean canBuild) BlockPlaceEvent
(@NotNull Block placedBlock, @NotNull BlockState replacedBlockState, @NotNull Block placedAgainst, @NotNull ItemStack itemInHand, @NotNull Player thePlayer, boolean canBuild) 已过时。BlockPlaceEvent
(@NotNull Block placedBlock, @NotNull BlockState replacedBlockState, @NotNull Block placedAgainst, @NotNull ItemStack itemInHand, @NotNull Player thePlayer, boolean canBuild, @NotNull EquipmentSlot hand) BrewingStartEvent
(@NotNull Block furnace, @NotNull ItemStack source, int brewingTime) CampfireStartEvent
(@NotNull Block furnace, @NotNull ItemStack source, @NotNull CampfireRecipe recipe) InventoryBlockStartEvent
(@NotNull Block block, @NotNull ItemStack source) -
org.bukkit.event.enchantment中ItemStack的使用
修饰符和类型方法说明EnchantItemEvent.getItem()
获取被附魔的物品(可改动).PrepareItemEnchantEvent.getItem()
获取准备附魔的物品(可改动).限定符构造器说明EnchantItemEvent
(@NotNull Player enchanter, @NotNull InventoryView view, @NotNull Block table, @NotNull ItemStack item, int level, @NotNull Map<Enchantment, Integer> enchants, @NotNull Enchantment enchantmentHint, int levelHint, int i) PrepareItemEnchantEvent
(@NotNull Player enchanter, @NotNull InventoryView view, @NotNull Block table, @NotNull ItemStack item, @NotNull EnchantmentOffer[] offers, int bonus) -
org.bukkit.event.entity中ItemStack的使用
修饰符和类型方法说明EntityShootBowEvent.getBow()
Gets the bow ItemStack used to fire the arrow.EntityBreedEvent.getBredWith()
获取用于引起此次繁殖的物品 (若存在).EntityShootBowEvent.getConsumable()
Get the ItemStack to be consumed in this event (if any).PiglinBarterEvent.getInput()
Gets the input of the barter.FoodLevelChangeEvent.getItem()
若存在的话, 返回触发本事件的物品.修饰符和类型方法说明EntityDeathEvent.getDrops()
返回这实体死亡掉落物品的集合.PiglinBarterEvent.getOutcome()
Returns a mutable list representing the outcome of the barter.限定符构造器说明EntityBreedEvent
(@NotNull LivingEntity child, @NotNull LivingEntity mother, @NotNull LivingEntity father, @Nullable LivingEntity breeder, @Nullable ItemStack bredWith, int experience) EntityShootBowEvent
(@NotNull LivingEntity shooter, @Nullable ItemStack bow, @Nullable ItemStack consumable, @NotNull Entity projectile, @NotNull EquipmentSlot hand, float force, boolean consumeItem) FoodLevelChangeEvent
(@NotNull HumanEntity what, int level, @Nullable ItemStack item) 限定符构造器说明EntityDeathEvent
(@NotNull LivingEntity entity, @NotNull DamageSource damageSource, @NotNull List<ItemStack> drops) EntityDeathEvent
(@NotNull LivingEntity what, @NotNull DamageSource damageSource, @NotNull List<ItemStack> drops, int droppedExp) PlayerDeathEvent
(@NotNull Player player, @NotNull DamageSource damageSource, @NotNull List<ItemStack> drops, int droppedExp, int newExp, int newTotalExp, int newLevel, @Nullable String deathMessage) PlayerDeathEvent
(@NotNull Player player, @NotNull DamageSource damageSource, @NotNull List<ItemStack> drops, int droppedExp, int newExp, @Nullable String deathMessage) PlayerDeathEvent
(@NotNull Player player, @NotNull DamageSource damageSource, @NotNull List<ItemStack> drops, int droppedExp, @Nullable String deathMessage) -
org.bukkit.event.hanging中ItemStack的使用
-
org.bukkit.event.inventory中ItemStack的使用
修饰符和类型方法说明InventoryClickEvent.getCurrentItem()
获取被点击的格子的物品InventoryClickEvent.getCursor()
获取被光标所拿起来的物品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()
获取这个事件中的燃料.InventoryMoveItemEvent.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.修饰符和类型方法说明InventoryDragEvent.getNewItems()
Gets all items to be added to the inventory in this drag.BrewEvent.getResults()
Gets the resulting items in the Brewing Stand.修饰符和类型方法说明void
InventoryClickEvent.setCurrentItem
(@Nullable ItemStack stack) Sets the ItemStack currently in the clicked slot.void
已过时。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.限定符构造器说明BrewingStandFuelEvent
(@NotNull Block brewingStand, @NotNull ItemStack fuel, int fuelPower) FurnaceBurnEvent
(@NotNull Block furnace, @NotNull ItemStack fuel, int burnTime) FurnaceStartSmeltEvent
(@NotNull Block furnace, @NotNull ItemStack source, @NotNull CookingRecipe<?> recipe) InventoryCreativeEvent
(@NotNull InventoryView what, @NotNull InventoryType.SlotType type, int slot, @NotNull ItemStack newItem) InventoryDragEvent
(@NotNull InventoryView what, @Nullable ItemStack newCursor, @NotNull ItemStack oldCursor, boolean right, @NotNull Map<Integer, ItemStack> slots) InventoryMoveItemEvent
(@NotNull Inventory sourceInventory, @NotNull ItemStack itemStack, @NotNull Inventory destinationInventory, boolean didSourceInitiate) PrepareAnvilEvent
(@NotNull InventoryView inventory, @Nullable ItemStack result) PrepareGrindstoneEvent
(@NotNull InventoryView inventory, @Nullable ItemStack result) PrepareInventoryResultEvent
(@NotNull InventoryView inventory, @Nullable ItemStack result) PrepareSmithingEvent
(@NotNull InventoryView inventory, @Nullable ItemStack result) -
org.bukkit.event.player中ItemStack的使用
修饰符和类型方法说明PlayerArmorStandManipulateEvent.getArmorStandItem()
返回盔甲架的物品.PlayerTakeLecternBookEvent.getBook()
Gets the current ItemStack on the lectern.PlayerItemBreakEvent.getBrokenItem()
获得因耐久值不足将要被销毁的物品.PlayerBucketEntityEvent.getEntityBucket()
Gets the bucket that theEntity
will be put into.PlayerBucketFishEvent.getFishBucket()
PlayerInteractEvent.getItem()
获取玩家手中的物品, 手中未拿物品时会返回null.PlayerItemConsumeEvent.getItem()
获取正在被消耗掉的ItemStack.PlayerItemDamageEvent.getItem()
Gets the item being damaged.PlayerItemMendEvent.getItem()
将要被修复的ItemStack
.PlayerRiptideEvent.getItem()
获取玩家使用的带激流附魔的三叉戟.PlayerShearEntityEvent.getItem()
获取用于剪切实体的物品.PlayerBucketEvent.getItemStack()
得到使用桶之后会得到的物品堆叠.PlayerSwapHandItemsEvent.getMainHandItem()
获取切换到主手的物品.PlayerSwapHandItemsEvent.getOffHandItem()
获取切换到副手的物品.PlayerBucketEntityEvent.getOriginalBucket()
Gets the bucket used to capture theEntity
.PlayerArmorStandManipulateEvent.getPlayerItem()
返回玩家手持的物品.PlayerBucketFishEvent.getWaterBucket()
修饰符和类型方法说明void
设置正在被消耗掉的ItemStackvoid
PlayerBucketEvent.setItemStack
(@Nullable ItemStack itemStack) 设置使用桶之后得到的物品.void
PlayerSwapHandItemsEvent.setMainHandItem
(@Nullable ItemStack mainHandItem) 设置主手里的物品.void
PlayerSwapHandItemsEvent.setOffHandItem
(@Nullable ItemStack offHandItem) 设置副手里的物品.限定符构造器说明PlayerArmorStandManipulateEvent
(@NotNull Player who, @NotNull ArmorStand clickedEntity, @NotNull ItemStack playerItem, @NotNull ItemStack armorStandItem, @NotNull EquipmentSlot slot) 已过时。PlayerArmorStandManipulateEvent
(@NotNull Player who, @NotNull ArmorStand clickedEntity, @NotNull ItemStack playerItem, @NotNull ItemStack armorStandItem, @NotNull EquipmentSlot slot, @NotNull EquipmentSlot hand) PlayerBucketEmptyEvent
(@NotNull Player who, @NotNull Block blockClicked, @NotNull BlockFace blockFace, @NotNull Material bucket, @NotNull ItemStack itemInHand) 已过时。PlayerBucketEmptyEvent
(@NotNull Player who, @NotNull Block block, @NotNull Block blockClicked, @NotNull BlockFace blockFace, @NotNull Material bucket, @NotNull ItemStack itemInHand) 已过时。PlayerBucketEmptyEvent
(@NotNull Player who, @NotNull Block block, @NotNull Block blockClicked, @NotNull BlockFace blockFace, @NotNull Material bucket, @NotNull ItemStack itemInHand, @NotNull EquipmentSlot hand) PlayerBucketEntityEvent
(@NotNull Player player, @NotNull Entity entity, @NotNull ItemStack originalBucket, @NotNull ItemStack entityBucket, @NotNull EquipmentSlot hand) PlayerBucketEvent
(@NotNull Player who, @NotNull Block blockClicked, @NotNull BlockFace blockFace, @NotNull Material bucket, @NotNull ItemStack itemInHand) 已过时。PlayerBucketEvent
(@NotNull Player who, @NotNull Block block, @NotNull Block blockClicked, @NotNull BlockFace blockFace, @NotNull Material bucket, @NotNull ItemStack itemInHand) 已过时。PlayerBucketEvent
(@NotNull Player who, @NotNull Block block, @NotNull Block blockClicked, @NotNull BlockFace blockFace, @NotNull Material bucket, @NotNull ItemStack itemInHand, @NotNull EquipmentSlot hand) PlayerBucketFillEvent
(@NotNull Player who, @NotNull Block blockClicked, @NotNull BlockFace blockFace, @NotNull Material bucket, @NotNull ItemStack itemInHand) 已过时。PlayerBucketFillEvent
(@NotNull Player who, @NotNull Block block, @NotNull Block blockClicked, @NotNull BlockFace blockFace, @NotNull Material bucket, @NotNull ItemStack itemInHand) 已过时。PlayerBucketFillEvent
(@NotNull Player who, @NotNull Block block, @NotNull Block blockClicked, @NotNull BlockFace blockFace, @NotNull Material bucket, @NotNull ItemStack itemInHand, @NotNull EquipmentSlot hand) PlayerBucketFishEvent
(@NotNull Player player, @NotNull Fish fish, @NotNull ItemStack waterBucket, @NotNull ItemStack fishBucket, @NotNull EquipmentSlot hand) 已过时。PlayerInteractEvent
(@NotNull Player who, @NotNull Action action, @Nullable ItemStack item, @Nullable Block clickedBlock, @NotNull BlockFace clickedFace) PlayerInteractEvent
(@NotNull Player who, @NotNull Action action, @Nullable ItemStack item, @Nullable Block clickedBlock, @NotNull BlockFace clickedFace, @Nullable EquipmentSlot hand) PlayerInteractEvent
(@NotNull Player who, @NotNull Action action, @Nullable ItemStack item, @Nullable Block clickedBlock, @NotNull BlockFace clickedFace, @Nullable EquipmentSlot hand, @Nullable Vector clickedPosition) PlayerItemBreakEvent
(@NotNull Player player, @NotNull ItemStack brokenItem) PlayerItemConsumeEvent
(@NotNull Player player, @NotNull ItemStack item) PlayerItemConsumeEvent
(@NotNull Player player, @NotNull ItemStack item, @NotNull EquipmentSlot hand) PlayerItemDamageEvent
(@NotNull Player player, @NotNull ItemStack what, int damage) PlayerItemMendEvent
(@NotNull Player who, @NotNull ItemStack item, @NotNull ExperienceOrb experienceOrb, int repairAmount) 已过时。PlayerItemMendEvent
(@NotNull Player who, @NotNull ItemStack item, @NotNull EquipmentSlot slot, @NotNull ExperienceOrb experienceOrb, int repairAmount) PlayerRiptideEvent
(@NotNull Player who, @NotNull ItemStack item) 已过时。PlayerShearEntityEvent
(@NotNull Player who, @NotNull Entity what, @NotNull ItemStack item, @NotNull EquipmentSlot hand) PlayerSwapHandItemsEvent
(@NotNull Player player, @NotNull ItemStack mainHandItem, @NotNull ItemStack offHandItem) -
org.bukkit.event.world中ItemStack的使用
限定符构造器说明LootGenerateEvent
(@NotNull World world, @Nullable Entity entity, @Nullable InventoryHolder inventoryHolder, @NotNull LootTable lootTable, @NotNull LootContext lootContext, @NotNull List<ItemStack> items, boolean plugin) -
org.bukkit.inventory中ItemStack的使用
修饰符和类型方法说明ItemStack.clone()
ItemFactory.createItemStack
(@NotNull 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, @Nullable Consumer<? super M> metaConfigurator) Constructs a new item stack with this item type.ItemType.Typed.createItemStack
(@Nullable Consumer<? super M> metaConfigurator) Constructs a new item stack with this item type with the amount 1.ItemStack.deserialize
(@NotNull Map<String, Object> args) 实现配置序列化与反序列化需要的方法.ItemFactory.enchantItem
(@NotNull Entity entity, @NotNull ItemStack item, int level, boolean allowTreasures) Enchants the given item at the provided level.ItemFactory.enchantItem
(@NotNull ItemStack item, int level, boolean allowTreasures) Enchants the given item at the provided level.ItemFactory.enchantItem
(@NotNull World world, @NotNull ItemStack item, int level, boolean allowTreasures) Enchants the given item at the provided level.MerchantRecipe.getAdjustedIngredient1()
Gets theadjusted
first ingredient.HorseInventory.getArmor()
获取马所装备的盔甲.EntityEquipment.getArmorContents()
获得实体当前所有穿着盔甲的拷贝.PlayerInventory.getArmorContents()
获取装备槽内的全部物品.EntityEquipment.getBoots()
获取该实体当前正在穿戴的鞋子的拷贝.PlayerInventory.getBoots()
返回靴子槽内的物品.EntityEquipment.getChestplate()
获取该实体当前正在穿戴的胸甲的拷贝.PlayerInventory.getChestplate()
返回胸甲槽内的物品.Inventory.getContents()
返回这个物品栏内的所有物品堆.InventoryView.getCursor()
获取玩家客户端鼠标光标所指位置上的物品.LlamaInventory.getDecor()
得到羊驼背包中装饰槽的物品, 通常是毛毯.PlayerInventory.getExtraContents()
获取存储在此背包的所有额外物品.BrewerInventory.getFuel()
获取当前用来酿造的燃料.FurnaceInventory.getFuel()
获取当前熔炉的燃料物品.EntityEquipment.getHelmet()
获取该实体当前正在佩戴的头盔的拷贝.PlayerInventory.getHelmet()
返回头盔槽内的物品.BrewerInventory.getIngredient()
获取当前酿造台的原料.CookingRecipe.getInput()
Get the input material.StonecuttingRecipe.getInput()
Get the input material.BeaconInventory.getItem()
返回信标内的物品.DecoratedPotInventory.getItem()
Get the item stack in the decorated pot.EnchantingInventory.getItem()
获取将被附魔的物品.EntityEquipment.getItem
(@NotNull EquipmentSlot slot) Gets the ItemStack at the given equipment slot in the inventory.Inventory.getItem
(int index) 返回在指定索引的物品堆.InventoryView.getItem
(int slot) 获取该物品栏指定槽位的物品.PlayerInventory.getItem
(@NotNull EquipmentSlot slot) Gets the ItemStack at the given equipment slot in the inventory.EntityEquipment.getItemInHand()
已过时。现在实体可以双持, 所以需要特定的方法来获取指定的手PlayerInventory.getItemInHand()
已过时。players can duel wield now use the methods for the specific hand insteadEntityEquipment.getItemInMainHand()
获取实体当前主手中手持的物品的拷贝.PlayerInventory.getItemInMainHand()
获得玩家握在主手的物品(的副本).EntityEquipment.getItemInOffHand()
获取实体当前副手中手持的物品的拷贝.PlayerInventory.getItemInOffHand()
获取玩家握在副手的物品(的副本).RecipeChoice.ExactChoice.getItemStack()
RecipeChoice.getItemStack()
已过时。for compatibility onlyRecipeChoice.MaterialChoice.getItemStack()
EntityEquipment.getLeggings()
获取该实体当前正在穿戴的护腿的拷贝.PlayerInventory.getLeggings()
返回护腿槽内的物品.CraftingInventory.getMatrix()
获取合成公式.JukeboxInventory.getRecord()
Get the record in the jukebox.CookingRecipe.getResult()
Get the result of this recipe.CraftingInventory.getResult()
获取合成台产生的合成品.CraftingRecipe.getResult()
Get the result of this recipe.FurnaceInventory.getResult()
获取当前熔炉生成的的物品.ItemCraftResult.getResult()
The resultingItemStack
that was crafted.MerchantRecipe.getResult()
Recipe.getResult()
得到这个配方的结果.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()
获取马所装备的马鞍.EnchantingInventory.getSecondary()
获取将被用于附魔的第二物品(如青金石).FurnaceInventory.getSmelting()
获取当前熔炉的被冶炼的物品.Inventory.getStorageContents()
返回物品栏中可以合理存放物品的区域的内容.修饰符和类型方法说明向物品栏添加所给的物品堆.本方法将尽可能完美地尝试填充已有的但还未达到堆叠上限的物品堆 和空格子.查找在物品栏内的包含指定物品的所有格子与物品堆.查找在物品栏内的包含指定物品堆的所有格子与物品堆.只有 物品堆的数目和种类都相同时才会匹配.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) 返回一个从指定索引开始的迭代器.Inventory.removeItem
(@NotNull ItemStack... items) 移除在物品栏内的指定物品堆.修饰符和类型方法说明void
MerchantRecipe.addIngredient
(@NotNull ItemStack item) 向物品栏添加所给的物品堆.本方法将尽可能完美地尝试填充已有的但还未达到堆叠上限的物品堆 和空格子.void
Modifies the amount of the givenItemStack
in the same way as MerchantRecipe dynamically adjusts the amount of the first ingredient during trading.查找在物品栏内的包含指定物品堆的所有格子与物品堆.只有 物品堆的数目和种类都相同时才会匹配.返回一个适用于给定的ItemStack的ItemMetaboolean
检测这个物品栏是否含有与给定的物品堆匹配的物品堆.boolean
检测物品栏是否含有一定数量的完全匹配的物品堆.boolean
Inventory.containsAtLeast
(@Nullable ItemStack item, int amount) 检测物品栏是否含有与所给物品堆匹配的并数量足够的物品堆.ItemFactory.enchantItem
(@NotNull Entity entity, @NotNull ItemStack item, int level, boolean allowTreasures) Enchants the given item at the provided level.ItemFactory.enchantItem
(@NotNull ItemStack item, int level, boolean allowTreasures) Enchants the given item at the provided level.ItemFactory.enchantItem
(@NotNull World world, @NotNull ItemStack item, int level, boolean allowTreasures) Enchants the given item at the provided level.int
查找包含此物品堆的第一个格子。boolean
ItemFactory.isApplicable
(@Nullable ItemMeta meta, @Nullable ItemStack stack) 该方法用于检查元数据是否能够适用于指定的ItemStack上(如果适用则物品不会丢失之前的数据).boolean
该方法与equals方法相同, 但不考虑堆叠数量.void
移除在此物品栏内与给定物品堆匹配的所有物品堆.Inventory.removeItem
(@NotNull ItemStack... items) 移除在物品栏内的指定物品堆.void
为这匹马装备盔甲.void
EntityEquipment.setArmorContents
(@NotNull ItemStack[] items) 将实体所穿戴的盔甲设置为提供的ItemStacks数组.void
PlayerInventory.setArmorContents
(@Nullable ItemStack[] items) 设置装备槽的全部物品.void
设置该实体当前正在穿戴的鞋子.void
设置该实体当前正在穿戴的鞋子.void
设置靴子物品栏内的物品.void
EntityEquipment.setChestplate
(@Nullable ItemStack chestplate) 设置该实体当前正在穿戴的胸甲.void
EntityEquipment.setChestplate
(@Nullable ItemStack chestplate, boolean silent) 设置该实体当前正在穿戴的胸甲.void
PlayerInventory.setChestplate
(@Nullable ItemStack chestplate) 设置胸甲物品栏内的物品.void
Inventory.setContents
(@NotNull ItemStack[] items) 完全地覆盖物品栏的内容.移除所有存在的内容并替换为指定的物品堆.void
设置玩家客户端鼠标光标所指位置上的物品.void
设置羊驼背包中装饰槽的物品.void
PlayerInventory.setExtraContents
(@Nullable ItemStack[] items) 将给定的物品放在额外物品槽内.void
设置当前用来酿造的燃料.一般只有Material.BLAZE_POWDER
将使用此方法.void
设置当前熔炉的燃料物品.void
设置该实体当前正在佩戴的头盔.void
设置该实体当前正在佩戴的头盔.void
设置头盔物品栏内的物品.void
BrewerInventory.setIngredient
(@Nullable ItemStack ingredient) 设置当前酿造台的原料成分.void
设置信标内的物品.void
Set the item stack in the decorated pot.void
设置将被附魔的物品.void
EntityEquipment.setItem
(@NotNull EquipmentSlot slot, @Nullable ItemStack item) Stores the ItemStack at the given equipment slot in the inventory.void
EntityEquipment.setItem
(@NotNull EquipmentSlot slot, @Nullable ItemStack item, boolean silent) Stores the ItemStack at the given equipment slot in the inventory.void
在物品栏指定索引存放物品堆.void
设置该物品栏指定槽位的物品.void
把物品放在背包的指定位置.void
PlayerInventory.setItem
(@NotNull EquipmentSlot slot, @Nullable ItemStack item) Stores the ItemStack at the given equipment slot in the inventory.void
EntityEquipment.setItemInHand
(@Nullable ItemStack stack) 已过时。现在实体可以双持, 所以需要特定的方法来获取指定的手void
PlayerInventory.setItemInHand
(@Nullable ItemStack stack) 已过时。players can duel wield now use the methods for the specific hand insteadvoid
EntityEquipment.setItemInMainHand
(@Nullable ItemStack item) 设置实体在主手中手持的物品.void
EntityEquipment.setItemInMainHand
(@Nullable ItemStack item, boolean silent) 设置实体在主手中手持的物品.void
PlayerInventory.setItemInMainHand
(@Nullable ItemStack item) 设置玩家握在主手的物品.void
EntityEquipment.setItemInOffHand
(@Nullable ItemStack item) 设置实体在副手中手持的物品.void
EntityEquipment.setItemInOffHand
(@Nullable ItemStack item, boolean silent) 设置实体在副手中手持的物品.void
PlayerInventory.setItemInOffHand
(@Nullable ItemStack item) 设置玩家握在副手的物品.void
EntityEquipment.setLeggings
(@Nullable ItemStack leggings) 设置该实体当前正在穿戴的护腿.void
EntityEquipment.setLeggings
(@Nullable ItemStack leggings, boolean silent) 设置该实体当前正在穿戴的护腿.void
PlayerInventory.setLeggings
(@Nullable ItemStack leggings) 设置护腿物品栏内的物品.void
Replace the contents of the crafting matrixvoid
Set the record in the jukebox.void
设置最终合成品.void
设置当前熔炉的生成物.void
Set the item in the result slot of the smithing tablevoid
为这匹马装备一个马鞍.void
EnchantingInventory.setSecondary
(@Nullable ItemStack item) 设置将被用于附魔的第二物品(如青金石).void
FurnaceInventory.setSmelting
(@Nullable ItemStack stack) 设置当前熔炉的被冶炼物物品.void
Inventory.setStorageContents
(@NotNull ItemStack[] items) 放置所给的物品堆至物品栏.boolean
boolean
boolean
限定符构造器说明BlastingRecipe
(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice input, float experience, int cookingTime) BlastingRecipe
(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull Material source, float experience, int cookingTime) CampfireRecipe
(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice input, float experience, int cookingTime) CampfireRecipe
(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull Material source, float experience, int cookingTime) CookingRecipe
(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice input, float experience, int cookingTime) Create a cooking recipe to craft the specified ItemStack.CookingRecipe
(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull Material source, float experience, int cookingTime) Create a cooking recipe to craft the specified ItemStack.protected
CraftingRecipe
(@NotNull NamespacedKey key, @NotNull ItemStack result) ExactChoice
(@NotNull ItemStack stack) ExactChoice
(@NotNull ItemStack... stacks) FurnaceRecipe
(@NotNull ItemStack result, @NotNull Material source) 已过时。FurnaceRecipe
(@NotNull ItemStack result, @NotNull MaterialData source) 已过时。FurnaceRecipe
(@NotNull ItemStack result, @NotNull MaterialData source, float experience) 已过时。FurnaceRecipe
(@NotNull ItemStack result, @NotNull Material source, int data) 已过时。FurnaceRecipe
(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice input, float experience, int cookingTime) Create a furnace recipe to craft the specified ItemStack.FurnaceRecipe
(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull Material source, float experience, int cookingTime) Create a furnace recipe to craft the specified ItemStack.FurnaceRecipe
(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull Material source, int data, float experience, int cookingTime) 已过时。构造一个指定物品堆的副本.MerchantRecipe
(@NotNull ItemStack result, int maxUses) MerchantRecipe
(@NotNull ItemStack result, int uses, int maxUses, boolean experienceReward) MerchantRecipe
(@NotNull ItemStack result, int uses, int maxUses, boolean experienceReward, int villagerExperience, float priceMultiplier) MerchantRecipe
(@NotNull ItemStack result, int uses, int maxUses, boolean experienceReward, int villagerExperience, float priceMultiplier, int demand, int specialPrice) ShapedRecipe
(@NotNull ItemStack result) 已过时。Recipes must have keys.ShapedRecipe
(@NotNull NamespacedKey key, @NotNull ItemStack result) Create a shaped recipe to craft the specified ItemStack.ShapelessRecipe
(@NotNull ItemStack result) 已过时。ShapelessRecipe
(@NotNull NamespacedKey key, @NotNull ItemStack result) Create a shapeless recipe to craft the specified ItemStack.SmithingRecipe
(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice base, @NotNull RecipeChoice addition) 已过时。as of Minecraft 1.20, smithing recipes are now separated into two distinct recipe types,SmithingTransformRecipe
andSmithingTrimRecipe
.SmithingTransformRecipe
(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice template, @NotNull RecipeChoice base, @NotNull RecipeChoice addition) Create a smithing recipe to produce the specified result ItemStack.SmokingRecipe
(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice input, float experience, int cookingTime) SmokingRecipe
(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull Material source, float experience, int cookingTime) StonecuttingRecipe
(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice input) Create a cooking recipe to craft the specified ItemStack.StonecuttingRecipe
(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull Material source) Create a Stonecutting recipe to craft the specified ItemStack. -
org.bukkit.inventory.meta中ItemStack的使用
修饰符和类型方法说明CrossbowMeta.getChargedProjectiles()
返回弩装填的抛射物的不可变列表.BundleMeta.getItems()
Returns an immutable list of the items stored in this item.修饰符和类型方法说明void
CrossbowMeta.addChargedProjectile
(@NotNull ItemStack item) 向本弩装填一个抛射物.void
Adds an item to this item. -
org.bukkit.inventory.meta.components中ItemStack的使用
修饰符和类型方法说明void
FoodComponent.setUsingConvertsTo
(@Nullable ItemStack item) Sets the item this food will convert to once eaten. -
org.bukkit.loot中ItemStack的使用
修饰符和类型方法说明LootTable.populateLoot
(@Nullable Random random, @NotNull LootContext context) Returns a mutable list of loot generated by this LootTable. -
org.bukkit.material中ItemStack的使用
修饰符和类型方法说明MaterialData.toItemStack()
已过时。该方法创建了一个堆叠数为0的物品堆,一般没什么用.MaterialData.toItemStack
(int amount) 已过时。基于此MaterialData创建一个新的物品堆实例.
EntityEquipment.getBoots()