类的使用
org.bukkit.inventory.ItemStack
使用ItemStack的程序包
程序包
说明
Bukkit API的顶级程序包, 包含通用的API类和接口.
与进度相关的类和接口.
用于操作在
世界内的三位像素(方块),包括一些特定的状态.各种方块的 BlockData 类.
专门用于处理插件运行时配置的类.
为在
世界内存在的非三维像素单位(实体)提供的接口,包含玩家、怪物、抛射物等.参与操作玩家物品栏和物品交互的类.
用于操作可以存储在
物品堆的额外数据的接口.与战利品表产生与操作有关的类 (Minecraft Wiki - 战利品表).
代表每种体素(意义可参考维基百科或百度百科相关条目,即物品被抽象为体素)的种类和状态.
-
org.bukkit中ItemStack的使用
返回ItemStack的org.bukkit中的方法修饰符和类型方法说明使用提供的ItemStack列表获取合成后的物品.使用提供的ItemStack列表获取合成后的物品.使用提供的ItemStack列表获取合成后的物品.使用提供的ItemStack列表获取合成后的物品.Bukkit.createExplorerMap(@NotNull World world, @NotNull Location location, @NotNull StructureType structureType) 创建一个以最近的指定结构类型为目标的新探险家地图.Bukkit.createExplorerMap(@NotNull World world, @NotNull Location location, @NotNull StructureType structureType, int radius, boolean findUnexplored) 创建一个以最近的指定结构类型为目标的新探险家地图.Server.createExplorerMap(@NotNull World world, @NotNull Location location, @NotNull StructureType structureType) 创建一个新的探索者地图, 以定位最近的指定StructureType结构.Server.createExplorerMap(@NotNull World world, @NotNull Location location, @NotNull StructureType structureType, int radius, boolean findUnexplored) 创建一个新的探索者地图, 以定位最近的指定StructureType结构.UnsafeValues.modifyItemStack(ItemStack stack, String arguments) 已过时。参数类型为ItemStack的org.bukkit中的方法修饰符和类型方法说明使用提供的ItemStack列表获取合成后的物品.使用提供的ItemStack列表获取合成后的物品.使用提供的ItemStack列表获取合成后的物品.使用提供的ItemStack列表获取合成后的物品.static @NotNull ItemCraftResultBukkit.craftItemResult(@NotNull ItemStack[] craftingMatrix, @NotNull World world) 使用提供的ItemStack列表获取合成后的物品.static @NotNull ItemCraftResultBukkit.craftItemResult(@NotNull ItemStack[] craftingMatrix, @NotNull World world, @NotNull Player player) 使用提供的ItemStack列表获取合成后的物品.Server.craftItemResult(@NotNull ItemStack[] craftingMatrix, @NotNull World world) 使用提供的ItemStack列表获取合成后的物品.Server.craftItemResult(@NotNull ItemStack[] craftingMatrix, @NotNull World world, @NotNull Player player) 使用提供的ItemStack列表获取合成后的物品.在指定的位置丢出一个物品.World.dropItem(@NotNull Location location, @NotNull ItemStack item, @Nullable Consumer<? super Item> function) 在指定的位置丢出一个物品.World.dropItemNaturally(@NotNull Location location, @NotNull ItemStack item) 在指定的位置丢出一个随机偏移的物品.World.dropItemNaturally(@NotNull Location location, @NotNull ItemStack item, @Nullable Consumer<? super Item> function) 在指定的位置丢出一个随机偏移的物品.Bukkit.getCraftingRecipe(@NotNull ItemStack[] craftingMatrix, @NotNull World world) 获取给定物品堆列表对应的配方.Server.getCraftingRecipe(@NotNull ItemStack[] craftingMatrix, @NotNull World world) 获取指定物品堆栈列表对应的配方.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的使用
返回ItemStack的org.bukkit.block中的方法修饰符和类型方法说明BrushableBlock.getItem()获取当沙子被完全刷掉并露出时将显示的物品。Campfire.getItem(int index) Vault.getKeyItem()获取玩家必须用来解锁此保险库的物品堆.Jukebox.getRecord()获取插入该唱片机的唱片 (译注:这是较新版本才有的API, 建议使用getPlaying).返回变量类型为ItemStack的类型的org.bukkit.block中的方法参数类型为ItemStack的org.bukkit.block中的方法修饰符和类型方法说明booleanBlock.breakNaturally(@Nullable ItemStack tool) 破坏此方块并生成掉落物, 就像是玩家手持工具挖掘方块一样.返回当某实体使用某工具破坏此方块时掉落的物品.返回当使用特定工具破坏此方块时掉落的物品.booleanBlock.isPreferredTool(@NotNull ItemStack tool) 返回给定物品是否是破坏此方块的首选工具.void设置当沙子被完全刷掉并露出时将显示的物品。voidvoidVault.setKeyItem(@NotNull ItemStack keyItem) 设置玩家必须用来解锁此保险库的物品堆.voidLockable.setLockItem(@Nullable ItemStack key) 设置访问此容器所需的钥匙.void设置将要播放的唱片, 唱片机将自动播放. -
org.bukkit.block.data中ItemStack的使用
参数类型为ItemStack的org.bukkit.block.data中的方法 -
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) 参数类型为ItemStack的org.bukkit.configuration中的方法 -
org.bukkit.enchantments中ItemStack的使用
参数类型为ItemStack的org.bukkit.enchantments中的方法 -
org.bukkit.entity中ItemStack的使用
返回ItemStack的org.bukkit.entity中的方法修饰符和类型方法说明ArmorStand.getBoots()已过时。ArmorStand.getChestplate()已过时。(since = "1.15.2") 建议使用EntityEquipment.getChestplate()SizedFireball.getDisplayItem()获取显示用的ItemStack。ArmorStand.getHelmet()已过时。(since = "1.15.2") 建议使用EntityEquipment.getHelmet()AbstractArrow.getItem()获取此箭被拾起时将获得的 ItemStack.EnderSignal.getItem()获取末影之眼在空中时显示的物品堆以及死亡时掉落的物品.ItemFrame.getItem()获取在展示框内的物品.OminousItemSpawner.getItem()获取此生成器将生成的物品。ThrowableProjectile.getItem()获取投掷弹射物将显示的ItemStack.ThrownPotion.getItem()返回此药水瓶物品的副本.ArmorStand.getItemInHand()已过时。(since = "1.15.2") 建议使用EntityEquipment.getItemInHand()HumanEntity.getItemInHand()已过时。人类现能双持, 请使用PlayerInventory中更明确的方法LivingEntity.getItemInUse()获取玩家正在使用的物品(吃食物、拉弓、格挡等)。HumanEntity.getItemOnCursor()返回你的鼠标正在拖动的物品, 可能为空.Item.getItemStack()获取与此掉落物相关的物品堆.ItemDisplay.getItemStack()获取显示的物品堆。ArmorStand.getLeggings()已过时。(since = "1.15.2") 建议使用EntityEquipment.getLeggings()AbstractArrow.getWeapon()获取发射此箭的 ItemStack.参数类型为ItemStack的org.bukkit.entity中的方法修饰符和类型方法说明HumanEntity.fireworkBoost(@NotNull ItemStack fireworkItemStack) 执行烟花火箭加速。intHumanEntity.getCooldown(@NotNull ItemStack item) 获取指定物品的剩余冷却时间(以tick为单位)。LivingEntity.getDrinkingSound(@NotNull ItemStack itemStack) LivingEntity.getEatingSound(@NotNull ItemStack itemStack) booleanHumanEntity.hasCooldown(@NotNull ItemStack item) 检查指定物品是否处于冷却状态。booleanAnimals.isBreedItem(@NotNull ItemStack stack) 检查提供的ItemStack是否是用于繁殖此实体的正确物品.void为玩家打开一本成书.voidPlayer.sendEquipmentChange(@NotNull LivingEntity entity, @NotNull EquipmentSlot slot, @Nullable ItemStack item) 向玩家发送某个实体的盔甲槽变化数据包.void已过时。(since = "1.15.2") 建议使用EntityEquipment.setBoots(org.bukkit.inventory.ItemStack)voidArmorStand.setChestplate(@Nullable ItemStack item) 已过时。(since = "1.15.2") 建议使用EntityEquipment.setChestplate(org.bukkit.inventory.ItemStack)voidHumanEntity.setCooldown(@NotNull ItemStack item, int ticks) 为指定物品设置一定tick数的冷却时间。voidSizedFireball.setDisplayItem(@NotNull ItemStack item) 设置火球显示用的ItemStack。void已过时。(since = "1.15.2") 建议使用EntityEquipment.setHelmet(org.bukkit.inventory.ItemStack)void设置此箭被拾起时将获得的 ItemStack.void设置末影之眼在空中时显示的物品堆以及死亡时掉落的物品.void设置在展示框内的物品.void设置在此物品展示框中的物品.void设置此生成器将生成的物品。void设置投掷弹射物显示的ItemStack.void设置此药水瓶物品.voidArmorStand.setItemInHand(@Nullable ItemStack item) 已过时。(since = "1.15.2") 建议使用EntityEquipment.setItemInHand(org.bukkit.inventory.ItemStack)voidHumanEntity.setItemInHand(@Nullable ItemStack item) 已过时。人类现能双持, 请使用PlayerInventory中更明确的方法voidHumanEntity.setItemOnCursor(@Nullable ItemStack item) 设置你正在拖动的物品, 将替换你所拖动的任何物品.voidItem.setItemStack(@NotNull ItemStack stack) 设置与此掉落物相关的物品堆.voidItemDisplay.setItemStack(@Nullable ItemStack item) 设置显示的物品堆。voidArmorStand.setLeggings(@Nullable ItemStack item) 已过时。(since = "1.15.2") 建议使用EntityEquipment.setLeggings(org.bukkit.inventory.ItemStack)void设置发射此箭的 ItemStack.voidHumanEntity.startRiptideAttack(int duration, float attackStrength, @Nullable ItemStack attackItem) 使玩家开始激流旋转攻击。类型变量类型为ItemStack的org.bukkit.entity中的方法参数修饰符和类型方法说明voidPlayer.sendEquipmentChange(@NotNull LivingEntity entity, @NotNull Map<EquipmentSlot, ItemStack> items) 发送目标实体的多个装备槽变更数据包. -
org.bukkit.event.block中ItemStack的使用
声明为ItemStack的org.bukkit.event.block中的字段修饰符和类型方法说明VaultDisplayItemEvent.getDisplayItem()获取将在宝库内显示的物品.BlockDispenseEvent.getItem()获取被射出的物品.BlockDamageAbortEvent.getItemInHand()获取玩家手中当前物品的 ItemStack.BlockDamageEvent.getItemInHand()获取当前玩家手上的物品.BlockPlaceEvent.getItemInHand()获取玩家放置的方块的物品形式(在玩家手上).BlockCookEvent.getResult()获取烹饪后得到的物品堆 (比如熟食).CrafterCraftEvent.getResult()获取合成的结果.BlockCookEvent.getSource()获取被烹饪的物品堆 (比如生的食物).InventoryBlockStartEvent.getSource()获取此事件的源 ItemStack.BlockShearEntityEvent.getTool()获取剪这只羊(实体)的工具.返回变量类型为ItemStack的类型的org.bukkit.event.block中的方法修饰符和类型方法说明BlockDispenseLootEvent.getDispensedLoot()获取将被发放的战利品.CrafterCraftEvent.getRemainingItems()获取配方合成后将剩余的物品.参数类型为ItemStack的org.bukkit.event.block中的方法修饰符和类型方法说明voidVaultDisplayItemEvent.setDisplayItem(@Nullable ItemStack displayItem) 设置将在宝库内显示的物品.void设置被射出的物品.void设置烹饪后得到的物品堆.void设置合成的结果.类型变量类型为ItemStack的org.bukkit.event.block中的方法参数修饰符和类型方法说明voidBlockDispenseLootEvent.setDispensedLoot(@Nullable List<ItemStack> dispensedLoot) 设置将被发放的战利品.参数类型为ItemStack的org.bukkit.event.block中的构造器限定符构造器说明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) CrafterCraftEvent(@NotNull Block theBlock, @NotNull CraftingRecipe recipe, @NotNull ItemStack result) 已过时。CrafterCraftEvent(@NotNull Block theBlock, @NotNull CraftingRecipe recipe, @NotNull ItemStack result, @NotNull List<ItemStack> remainingItems) InventoryBlockStartEvent(@NotNull Block block, @NotNull ItemStack source) VaultDisplayItemEvent(@NotNull Block theBlock, @Nullable ItemStack displayItem) 类型变量类型为ItemStack的org.bukkit.event.block中的构造器参数 -
org.bukkit.event.enchantment中ItemStack的使用
修饰符和类型方法说明EnchantItemEvent.getItem()获取被附魔的物品(可改动).PrepareItemEnchantEvent.getItem()获取准备附魔的物品(可改动).参数类型为ItemStack的org.bukkit.event.enchantment中的构造器限定符构造器说明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 EnchantmentView view, @NotNull Block table, @NotNull ItemStack item, @NotNull EnchantmentOffer[] offers, int bonus) -
org.bukkit.event.entity中ItemStack的使用
修饰符和类型方法说明EntityShootBowEvent.getBow()获取用于发射箭矢的弓 ItemStack。EntityBreedEvent.getBredWith()获取用于引起此次繁殖的物品 (若存在).EntityShootBowEvent.getConsumable()获取此事件中将被消耗的 ItemStack(如果有)。PiglinBarterEvent.getInput()获取以物易物的输入。FoodLevelChangeEvent.getItem()若存在的话, 返回触发本事件的物品.返回变量类型为ItemStack的类型的org.bukkit.event.entity中的方法修饰符和类型方法说明EntityDeathEvent.getDrops()返回这实体死亡掉落物品的集合.PiglinBarterEvent.getOutcome()返回表示以物易物结果的可变列表。参数类型为ItemStack的org.bukkit.event.entity中的构造器限定符构造器说明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) 类型变量类型为ItemStack的org.bukkit.event.entity中的构造器参数限定符构造器说明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的使用
参数类型为ItemStack的org.bukkit.event.hanging中的构造器 -
org.bukkit.event.inventory中ItemStack的使用
修饰符和类型方法说明InventoryClickEvent.getCurrentItem()获取被点击的格子的物品InventoryClickEvent.getCursor()获取被光标所拿起来的物品InventoryCreativeEvent.getCursor()InventoryDragEvent.getCursor()获取拖拽完成后的结果光标。BrewingStandFuelEvent.getFuel()获取燃料的 ItemStack,在数量被扣除之前。FurnaceBurnEvent.getFuel()获取这个事件中的燃料.InventoryMoveItemEvent.getItem()获取正在移动的 ItemStack;如果被修改,原始物品将不会从源物品栏中移除。InventoryDragEvent.getOldCursor()获取一个 ItemStack,表示在此拖拽导致任何修改之前的光标。PrepareInventoryResultEvent.getResult()获取结果物品,可能为 null。返回变量类型为ItemStack的类型的org.bukkit.event.inventory中的方法修饰符和类型方法说明InventoryDragEvent.getNewItems()获取此次拖拽中将添加到物品栏的所有物品。BrewEvent.getResults()Gets the resulting items in the Brewing Stand.参数类型为ItemStack的org.bukkit.event.inventory中的方法修饰符和类型方法说明voidInventoryClickEvent.setCurrentItem(@Nullable ItemStack stack) 设置被点击格子中的物品.void已过时。这会在对物品栏应用任何计算之前更改他们手中的 ItemStack, 这往往会导致玩家与服务器之间的不一致, 并对被点击的物品栏的行为产生意外更改。voidvoid设置拖拽完成后的结果光标。void设置正在移动的 ItemStack;如果这与原始 ItemStack 不同,原始物品将不会从源物品栏中移除。void设置结果物品,可能为 null。参数类型为ItemStack的org.bukkit.event.inventory中的构造器限定符构造器说明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 AnvilView 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) 类型变量类型为ItemStack的org.bukkit.event.inventory中的构造器参数 -
org.bukkit.event.player中ItemStack的使用
声明为ItemStack的org.bukkit.event.player中的字段修饰符和类型方法说明PlayerArmorStandManipulateEvent.getArmorStandItem()返回盔甲架的物品.PlayerTakeLecternBookEvent.getBook()获取讲台上的当前 ItemStack.PlayerItemBreakEvent.getBrokenItem()获得因耐久值不足将要被销毁的物品.PlayerBucketEntityEvent.getEntityBucket()获取Entity将被放入的桶.PlayerBucketFishEvent.getFishBucket()PlayerInteractEvent.getItem()获取玩家手中的物品, 手中未拿物品时会返回null.PlayerItemConsumeEvent.getItem()获取正在被消耗掉的ItemStack.PlayerItemDamageEvent.getItem()获取正在受损的物品.PlayerItemMendEvent.getItem()将要被修复的ItemStack.PlayerRiptideEvent.getItem()获取玩家使用的带激流附魔的三叉戟.PlayerShearEntityEvent.getItem()获取用于剪切实体的物品.PlayerBucketEvent.getItemStack()得到使用桶之后会得到的物品堆叠.PlayerSwapHandItemsEvent.getMainHandItem()获取切换到主手的物品.PlayerSwapHandItemsEvent.getOffHandItem()获取切换到副手的物品.PlayerBucketEntityEvent.getOriginalBucket()获取用于捕获Entity的桶.PlayerArmorStandManipulateEvent.getPlayerItem()返回玩家手持的物品.PlayerBucketFishEvent.getWaterBucket()返回变量类型为ItemStack的类型的org.bukkit.event.player中的方法参数类型为ItemStack的org.bukkit.event.player中的方法修饰符和类型方法说明void设置正在被消耗掉的ItemStackvoidPlayerBucketEvent.setItemStack(@Nullable ItemStack itemStack) 设置使用桶之后得到的物品.voidPlayerSwapHandItemsEvent.setMainHandItem(@Nullable ItemStack mainHandItem) 设置主手里的物品.voidPlayerSwapHandItemsEvent.setOffHandItem(@Nullable ItemStack offHandItem) 设置副手里的物品.参数类型为ItemStack的org.bukkit.event.player中的构造器限定符构造器说明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) 类型变量类型为ItemStack的org.bukkit.event.player中的构造器参数 -
org.bukkit.event.world中ItemStack的使用
返回变量类型为ItemStack的类型的org.bukkit.event.world中的方法类型变量类型为ItemStack的org.bukkit.event.world中的方法参数类型变量类型为ItemStack的org.bukkit.event.world中的构造器参数限定符构造器说明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的使用
修饰符和类型方法说明CraftingRecipe.checkResult(@NotNull ItemStack result) 检查用于 CraftingRecipe 相关构造器的 ItemStack 是否为空。ItemStack.clone()ItemFactory.createExplorerMap(@NotNull World world, @NotNull Location structureLocation, MapCursor.Type mapIcon) Create a new explorer map targeting the given structure location.ItemFactory.createItemStack(@NotNull String input) 根据提供的输入创建一个新的ItemStack。ItemType.createItemStack()使用此物品类型创建数量为 1 的新物品堆。ItemType.createItemStack(int amount) 使用此物品类型创建新物品堆。ItemType.Typed.createItemStack(int amount, @Nullable Consumer<? super M> metaConfigurator) 使用此物品类型创建新物品堆。ItemType.Typed.createItemStack(@Nullable Consumer<? super M> metaConfigurator) 使用此物品类型创建数量为 1 的新物品堆。ItemStack.deserialize(@NotNull Map<String, Object> args) 实现配置序列化与反序列化需要的方法.ItemFactory.enchantItem(@NotNull Entity entity, @NotNull ItemStack item, int level, boolean allowTreasures) 在指定等级对给定物品进行附魔。ItemFactory.enchantItem(@NotNull ItemStack item, int level, boolean allowTreasures) 在指定等级对给定物品进行附魔。ItemFactory.enchantItem(@NotNull World world, @NotNull ItemStack item, int level, boolean allowTreasures) 在指定等级对给定物品进行附魔。MerchantRecipe.getAdjustedIngredient1()获取调整后的第一种材料。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()获取输入材料。StonecuttingRecipe.getInput()获取输入材料。BeaconInventory.getItem()返回信标内的物品.DecoratedPotInventory.getItem()获取装饰陶罐中的物品堆。EnchantingInventory.getItem()获取将被附魔的物品.EntityEquipment.getItem(@NotNull EquipmentSlot slot) 获取物品栏中指定装备槽位的 ItemStack.Inventory.getItem(int index) 返回在指定索引的物品堆.InventoryView.getItem(int slot) 获取该物品栏指定槽位的物品.PlayerInventory.getItem(@NotNull EquipmentSlot slot) 获取指定装备槽位中的物品栈.EntityEquipment.getItemInHand()已过时。现在实体可以双持, 所以需要特定的方法来获取指定的手PlayerInventory.getItemInHand()已过时。玩家现在可以双持了, 请使用针对特定手的方法代替.EntityEquipment.getItemInMainHand()获取实体当前主手中手持的物品的拷贝.PlayerInventory.getItemInMainHand()获得玩家握在主手的物品(的副本).EntityEquipment.getItemInOffHand()获取实体当前副手中手持的物品的拷贝.PlayerInventory.getItemInOffHand()获取玩家握在副手的物品(的副本).RecipeChoice.ExactChoice.getItemStack()RecipeChoice.getItemStack()已过时。仅为兼容性保留。RecipeChoice.MaterialChoice.getItemStack()EntityEquipment.getLeggings()获取该实体当前正在穿戴的护腿的拷贝.PlayerInventory.getLeggings()返回护腿槽内的物品.CraftingInventory.getMatrix()获取合成公式.JukeboxInventory.getRecord()获取唱片机中的唱片。BrewingRecipe.getResult()CookingRecipe.getResult()获取此配方的结果。CraftingInventory.getResult()获取合成台产生的合成品.CraftingRecipe.getResult()获取此配方的结果。FurnaceInventory.getResult()获取当前熔炉生成的的物品.ItemCraftResult.getResult()合成产出的ItemStack.MerchantRecipe.getResult()Recipe.getResult()得到这个配方的结果.SmithingInventory.getResult()检查锻造台结果槽中的物品。SmithingRecipe.getResult()StonecuttingRecipe.getResult()获取此配方的结果。ItemCraftResult.getResultingMatrix()获取合成操作产出的矩阵.AbstractHorseInventory.getSaddle()已过时。不能给羊驼装配鞍HorseInventory.getSaddle()获取马所装备的鞍.EnchantingInventory.getSecondary()获取将被用于附魔的第二物品(如青金石).FurnaceInventory.getSmelting()获取当前熔炉的被冶炼的物品.Inventory.getStorageContents()返回物品栏中可以合理存放物品的区域的内容.返回变量类型为ItemStack的类型的org.bukkit.inventory中的方法修饰符和类型方法说明向物品栏添加所给的物品堆.本方法将尽可能完美地尝试填充已有的但还未达到堆叠上限的物品堆 和空格子.查找在物品栏内的包含指定物品的所有格子与物品堆.查找在物品栏内的包含指定物品堆的所有格子与物品堆.只有 物品堆的数目和种类都相同时才会匹配.RecipeChoice.ExactChoice.getChoices()ShapelessRecipe.getIngredientList()获取此配方使用的成分列表。ShapedRecipe.getIngredientMap()获取成分映射的副本。MerchantRecipe.getIngredients()ItemCraftResult.getOverflowItems()获取无法放回合成矩阵的溢出物品.Inventory.iterator()Inventory.iterator(int index) 返回一个从指定索引开始的迭代器.Inventory.removeItem(@NotNull ItemStack... items) 移除在物品栏内的指定物品堆.参数类型为ItemStack的org.bukkit.inventory中的方法修饰符和类型方法说明voidMerchantRecipe.addIngredient(@NotNull ItemStack item) 向物品栏添加所给的物品堆.本方法将尽可能完美地尝试填充已有的但还未达到堆叠上限的物品堆 和空格子.void以与 MerchantRecipe 在交易期间动态调整第一种材料数量相同的方式修改给定ItemStack的数量。查找在物品栏内的包含指定物品堆的所有格子与物品堆.只有 物品堆的数目和种类都相同时才会匹配.返回一个适用于给定的ItemStack的ItemMetaCraftingRecipe.checkResult(@NotNull ItemStack result) 检查用于 CraftingRecipe 相关构造器的 ItemStack 是否为空。boolean检测这个物品栏是否含有与给定的物品堆匹配的物品堆.boolean检测物品栏是否含有一定数量的完全匹配的物品堆.booleanInventory.containsAtLeast(@Nullable ItemStack item, int amount) 检测物品栏是否含有与所给物品堆匹配的并数量足够的物品堆.ItemFactory.enchantItem(@NotNull Entity entity, @NotNull ItemStack item, int level, boolean allowTreasures) 在指定等级对给定物品进行附魔。ItemFactory.enchantItem(@NotNull ItemStack item, int level, boolean allowTreasures) 在指定等级对给定物品进行附魔。ItemFactory.enchantItem(@NotNull World world, @NotNull ItemStack item, int level, boolean allowTreasures) 在指定等级对给定物品进行附魔。int查找包含此物品堆的第一个格子。booleanItemFactory.isApplicable(@Nullable ItemMeta meta, @Nullable ItemStack stack) 该方法用于检查元数据是否能够适用于指定的ItemStack上(如果适用则物品不会丢失之前的数据).boolean该方法与equals方法相同, 但不考虑堆叠数量.void移除在此物品栏内与给定物品堆匹配的所有物品堆.Inventory.removeItem(@NotNull ItemStack... items) 移除在物品栏内的指定物品堆.void为这匹马装备盔甲.voidEntityEquipment.setArmorContents(@NotNull ItemStack[] items) 将实体所穿戴的盔甲设置为提供的ItemStacks数组.voidPlayerInventory.setArmorContents(@Nullable ItemStack[] items) 设置装备槽的全部物品.void设置该实体当前正在穿戴的鞋子.void设置该实体当前正在穿戴的鞋子.void设置靴子物品栏内的物品.voidEntityEquipment.setChestplate(@Nullable ItemStack chestplate) 设置该实体当前正在穿戴的胸甲.voidEntityEquipment.setChestplate(@Nullable ItemStack chestplate, boolean silent) 设置该实体当前正在穿戴的胸甲.voidPlayerInventory.setChestplate(@Nullable ItemStack chestplate) 设置胸甲物品栏内的物品.voidInventory.setContents(@NotNull ItemStack[] items) 完全地覆盖物品栏的内容.移除所有存在的内容并替换为指定的物品堆.void设置玩家客户端鼠标光标所指位置上的物品.void设置羊驼背包中装饰槽的物品.voidPlayerInventory.setExtraContents(@Nullable ItemStack[] items) 将给定的物品放在额外物品槽内.void设置当前用来酿造的燃料.一般只有Material.BLAZE_POWDER将使用此方法.void设置当前熔炉的燃料物品.void设置该实体当前正在佩戴的头盔.void设置该实体当前正在佩戴的头盔.void设置头盔物品栏内的物品.voidBrewerInventory.setIngredient(@Nullable ItemStack ingredient) 设置当前酿造台的原料成分.void设置信标内的物品.void设置装饰陶罐中的物品堆。void设置将被附魔的物品.voidEntityEquipment.setItem(@NotNull EquipmentSlot slot, @Nullable ItemStack item) 将给定的 ItemStack 存储到物品栏中指定的装备槽位.voidEntityEquipment.setItem(@NotNull EquipmentSlot slot, @Nullable ItemStack item, boolean silent) 将给定的 ItemStack 存储到物品栏中指定的装备槽位.void在物品栏指定索引存放物品堆.void设置该物品栏指定槽位的物品.void把物品放在背包的指定位置.voidPlayerInventory.setItem(@NotNull EquipmentSlot slot, @Nullable ItemStack item) 将给定的物品栈设置到指定的装备槽位中.voidEntityEquipment.setItemInHand(@Nullable ItemStack stack) 已过时。现在实体可以双持, 所以需要特定的方法来获取指定的手voidPlayerInventory.setItemInHand(@Nullable ItemStack stack) 已过时。玩家现在可以双持了, 请使用针对特定手的方法代替.voidEntityEquipment.setItemInMainHand(@Nullable ItemStack item) 设置实体在主手中手持的物品.voidEntityEquipment.setItemInMainHand(@Nullable ItemStack item, boolean silent) 设置实体在主手中手持的物品.voidPlayerInventory.setItemInMainHand(@Nullable ItemStack item) 设置玩家握在主手的物品.voidEntityEquipment.setItemInOffHand(@Nullable ItemStack item) 设置实体在副手中手持的物品.voidEntityEquipment.setItemInOffHand(@Nullable ItemStack item, boolean silent) 设置实体在副手中手持的物品.voidPlayerInventory.setItemInOffHand(@Nullable ItemStack item) 设置玩家握在副手的物品.voidEntityEquipment.setLeggings(@Nullable ItemStack leggings) 设置该实体当前正在穿戴的护腿.voidEntityEquipment.setLeggings(@Nullable ItemStack leggings, boolean silent) 设置该实体当前正在穿戴的护腿.voidPlayerInventory.setLeggings(@Nullable ItemStack leggings) 设置护腿物品栏内的物品.void替换合成矩阵的内容.void设置唱片机中的唱片。void设置最终合成品.void设置当前熔炉的生成物.void设置锻造台结果槽中的物品。void已过时。不能给羊驼装配鞍void为这匹马装备鞍.voidEnchantingInventory.setSecondary(@Nullable ItemStack item) 设置将被用于附魔的第二物品(如青金石).voidFurnaceInventory.setSmelting(@Nullable ItemStack stack) 设置当前熔炉的被冶炼物物品.voidInventory.setStorageContents(@NotNull ItemStack[] items) 放置所给的物品堆至物品栏.booleanbooleanboolean类型变量类型为ItemStack的org.bukkit.inventory中的方法参数参数类型为ItemStack的org.bukkit.inventory中的构造器限定符构造器说明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) BrewingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result) 已过时。this is for internal use only and will not create a viable recipeCampfireRecipe(@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) 创建一个烹饪配方来制作指定的物品堆。CookingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull Material source, float experience, int cookingTime) 创建一个烹饪配方来制作指定的物品堆。protectedCraftingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result) DyeRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice input, @NotNull RecipeChoice material) Create a dye recipe to produce a result of the specified type.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) 创建一个熔炉配方来制作指定的 ItemStack.FurnaceRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull Material source, float experience, int cookingTime) 创建一个熔炉配方来制作指定的 ItemStack.FurnaceRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull Material source, int data, float experience, int cookingTime) 已过时。ImbueRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice input, @NotNull RecipeChoice material) Create an imbue recipe to produce a result of the specified type.构造一个指定物品堆的副本.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) 已过时。配方必须有键。ShapedRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result) 创建一个合成指定物品的配方。ShapelessRecipe(@NotNull ItemStack result) 已过时。ShapelessRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result) 创建一个合成指定物品的无序配方。SmithingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @Nullable RecipeChoice base, @Nullable RecipeChoice addition) 已过时。从 Minecraft 1.20 开始,锻造配方现在被分为两种不同的配方类型:SmithingTransformRecipe和SmithingTrimRecipe。SmithingTransformRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @Nullable RecipeChoice template, @Nullable RecipeChoice base, @Nullable RecipeChoice addition) 创建一个锻造配方以产生指定的结果物品。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) 创建一个烹饪配方以合成指定的物品。StonecuttingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull Material source) 创建一个切石配方以合成指定的物品。TransmuteRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice input, @NotNull RecipeChoice material) 创建一个转化配方以产生指定类型的结果。TransmuteRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice input, @NotNull RecipeChoice material, int minimumMaterialCount, int maximumMaterialCount, boolean addMaterialCountToResult) Create a transmute recipe to produce a result of the specified type.类型变量类型为ItemStack的org.bukkit.inventory中的构造器参数 -
org.bukkit.inventory.meta中ItemStack的使用
返回变量类型为ItemStack的类型的org.bukkit.inventory.meta中的方法修饰符和类型方法说明CrossbowMeta.getChargedProjectiles()返回弩装填的抛射物的不可变列表.BundleMeta.getItems()返回存储在此物品中的物品的不可变列表.参数类型为ItemStack的org.bukkit.inventory.meta中的方法修饰符和类型方法说明voidCrossbowMeta.addChargedProjectile(@NotNull ItemStack item) 向本弩装填一个抛射物.void向此物品添加一个物品.voidItemMeta.setUseRemainder(@Nullable ItemStack remainder) 设置当此物品被使用后, 其将转换为何种物品.类型变量类型为ItemStack的org.bukkit.inventory.meta中的方法参数 -
org.bukkit.loot中ItemStack的使用
返回变量类型为ItemStack的类型的org.bukkit.loot中的方法修饰符和类型方法说明LootTable.populateLoot(@Nullable Random random, @NotNull LootContext context) 返回由此战利品表生成的可变物品列表。 -
org.bukkit.material中ItemStack的使用
返回ItemStack的org.bukkit.material中的方法修饰符和类型方法说明MaterialData.toItemStack()已过时。该方法创建了一个堆叠数为0的物品堆,一般没什么用.MaterialData.toItemStack(int amount) 已过时。基于此MaterialData创建一个新的物品堆实例.
EntityEquipment.getBoots()