类的使用
org.bukkit.NamespacedKey
程序包
说明
Bukkit API的顶级程序包, 包含通用的API类和接口.
与属性有关的类 (Minecraft Wiki - 属性).
用于操作在
世界
内的三位像素(方块),包括一些特定的状态.与旗帜方块有关的类.
为在
世界
内存在的非三维像素单位(实体)提供的接口,包含玩家、怪物、抛射物等.与实体的持久化内存有关的类, 目前仅与村民有关.
参与操作玩家物品栏和物品交互的类.
用于操作可以存储在
物品堆
的额外数据的接口.Isolated components which may form part of item meta.
通过本包的API可允许向物品附加自定义数据.
与战利品表产生与操作有关的类 (Minecraft Wiki - 战利品表).
Classes dedicated to handling data pack information.
用于向各种对象附加持久化数据的类.
代表每种
药水
属性和操作的类的集合.Classes related to creating or using
structures
without creating Structure
blocks
in the world.-
org.bukkit中NamespacedKey的使用
修饰符和类型方法说明static @Nullable NamespacedKey
NamespacedKey.fromString
(@NotNull String key) 根据提供的字符串获取 NamespacedKey 对象.static @Nullable NamespacedKey
NamespacedKey.fromString
(@NotNull String string, @Nullable Plugin defaultNamespace) 根据提供的字符串获取 NamespacedKey 对象, 若字符串未指定命名空间名, 将使用参数给定的默认命名空间.Art.getKey()
Fluid.getKey()
Keyed.getKey()
返回用于此对象的命名空间标识符.Material.getKey()
Particle.getKey()
Sound.getKey()
Statistic.getKey()
StructureType.getKey()
已过时。static @NotNull NamespacedKey
获取 Minecraft 命名空间内的一个 key.static @NotNull NamespacedKey
NamespacedKey.randomKey()
已过时。插件应永不使用此方法, 仅供内部使用!!修饰符和类型方法说明static @NotNull KeyedBossBar
Bukkit.createBossBar
(@NotNull NamespacedKey key, @Nullable String title, @NotNull BarColor color, @NotNull BarStyle style, @NotNull BarFlag... flags) 创建一个Boss血量条实例.Server.createBossBar
(@NotNull NamespacedKey key, @Nullable String title, @NotNull BarColor color, @NotNull BarStyle style, @NotNull BarFlag... flags) 创建一个Boss血量条实例.Registry.get
(@NotNull NamespacedKey key) Get the object by its key.Registry.SimpleRegistry.get
(@NotNull NamespacedKey key) <B extends Keyed>
BUnsafeValues.get
(Registry<B> registry, NamespacedKey key) 已过时。static @Nullable Advancement
Bukkit.getAdvancement
(@NotNull NamespacedKey key) 通过Key获得特定的进度对象.Server.getAdvancement
(@NotNull NamespacedKey key) 通过Key获得特定的进度对象.static @Nullable KeyedBossBar
Bukkit.getBossBar
(@NotNull NamespacedKey key) Gets theKeyedBossBar
specified by this key.Server.getBossBar
(@NotNull NamespacedKey key) Gets theKeyedBossBar
specified by this key.GameEvent.getByKey
(@NotNull NamespacedKey namespacedKey) 已过时。static @Nullable MusicInstrument
MusicInstrument.getByKey
(@NotNull NamespacedKey namespacedKey) 已过时。UseRegistry.get(NamespacedKey)
instead.UnsafeValues.getFeatureFlag
(@NotNull NamespacedKey key) 已过时。UnsafeValues.getInternalPotionData
(NamespacedKey key) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Bukkit.getLootTable
(@NotNull NamespacedKey key) 获取指定的战利品表
.Server.getLootTable
(@NotNull NamespacedKey key) 获取指定的战利品表
.Bukkit.getRecipe
(@NotNull NamespacedKey recipeKey) 根据指定的 key 获取配方
.Server.getRecipe
(@NotNull NamespacedKey recipeKey) 根据指定的 key 获取配方
.Gets a tag which has already been defined within the server.Gets a tag which has already been defined within the server.UnsafeValues.loadAdvancement
(NamespacedKey key, String advancement) 已过时。Load an advancement represented by the specified string into the server.boolean
UnsafeValues.removeAdvancement
(NamespacedKey key) 已过时。Delete an advancement which was loaded and saved byUnsafeValues.loadAdvancement(org.bukkit.NamespacedKey, java.lang.String)
.static boolean
Bukkit.removeBossBar
(@NotNull NamespacedKey key) Removes aKeyedBossBar
specified by this key.boolean
Server.removeBossBar
(@NotNull NamespacedKey key) Removes aKeyedBossBar
specified by this key.static boolean
Bukkit.removeRecipe
(@NotNull NamespacedKey key) 从服务器移除指定的合成配方.boolean
Server.removeRecipe
(@NotNull NamespacedKey key) 从服务器移除指定的合成配方. -
org.bukkit.attribute中NamespacedKey的使用
限定符构造器说明AttributeModifier
(@NotNull NamespacedKey key, double amount, @NotNull AttributeModifier.Operation operation, @NotNull EquipmentSlotGroup slot) -
org.bukkit.block中NamespacedKey的使用
修饰符和类型方法说明Biome.getKey()
Skull.getNoteBlockSound()
Gets the sound to play if the skull is placed on a note block.修饰符和类型方法说明void
Skull.setNoteBlockSound
(@Nullable NamespacedKey noteBlockSound) Sets the sound to play if the skull is placed on a note block. -
org.bukkit.block.banner中NamespacedKey的使用
-
org.bukkit.enchantments中NamespacedKey的使用
修饰符和类型方法说明static @Nullable Enchantment
Enchantment.getByKey
(@Nullable NamespacedKey key) 已过时。仅为保障作向后兼容性, 请使用Registry.get(NamespacedKey)
instead -
org.bukkit.entity中NamespacedKey的使用
修饰符和类型方法说明HumanEntity.getDiscoveredRecipes()
Get an immutable set of recipes this entity has discovered.修饰符和类型方法说明boolean
HumanEntity.discoverRecipe
(@NotNull NamespacedKey recipe) Discover a recipe for this player such that it has not already been discovered.boolean
HumanEntity.hasDiscoveredRecipe
(@NotNull NamespacedKey recipe) Check whether or not this entity has discovered the specified recipe.@NotNull CompletableFuture<byte[]>
Player.retrieveCookie
(@NotNull NamespacedKey key) Retrieves a cookie from this player.void
Player.storeCookie
(@NotNull NamespacedKey key, @org.jetbrains.annotations.NotNull byte[] value) Stores a cookie in this player's client.boolean
HumanEntity.undiscoverRecipe
(@NotNull NamespacedKey recipe) Undiscover a recipe for this player such that it has already been discovered.修饰符和类型方法说明int
HumanEntity.discoverRecipes
(@NotNull Collection<NamespacedKey> recipes) Discover a collection of recipes for this player such that they have not already been discovered.int
HumanEntity.undiscoverRecipes
(@NotNull Collection<NamespacedKey> recipes) Undiscover a collection of recipes for this player such that they have already been discovered. -
org.bukkit.entity.memory中NamespacedKey的使用
修饰符和类型方法说明MemoryKey.getByKey
(@NotNull NamespacedKey namespacedKey) Returns aMemoryKey
by aNamespacedKey
. -
org.bukkit.event.player中NamespacedKey的使用
-
org.bukkit.event.world中NamespacedKey的使用
修饰符和类型方法说明AsyncStructureGenerateEvent.getBlockTransformers()
Gets all block transformers in a unmodifiable map.AsyncStructureGenerateEvent.getEntityTransformers()
Gets all entity transformers in a unmodifiable map.修饰符和类型方法说明AsyncStructureGenerateEvent.getBlockTransformer
(@NotNull NamespacedKey key) Gets a block transformer by key.AsyncStructureGenerateEvent.getEntityTransformer
(@NotNull NamespacedKey key) Gets a entity transformer by key.void
AsyncStructureGenerateEvent.removeBlockTransformer
(@NotNull NamespacedKey key) Removes a block transformer.void
AsyncStructureGenerateEvent.removeEntityTransformer
(@NotNull NamespacedKey key) Removes a entity transformer.void
AsyncStructureGenerateEvent.setBlockTransformer
(@NotNull NamespacedKey key, @NotNull BlockTransformer transformer) Sets a block transformer to a key.void
AsyncStructureGenerateEvent.setEntityTransformer
(@NotNull NamespacedKey key, @NotNull EntityTransformer transformer) Sets a entity transformer to a key. -
org.bukkit.inventory中NamespacedKey的使用
修饰符和类型方法说明CookingRecipe.getKey()
CraftingRecipe.getKey()
SmithingRecipe.getKey()
StonecuttingRecipe.getKey()
限定符构造器说明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) 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) 已过时。ShapedRecipe
(@NotNull NamespacedKey key, @NotNull ItemStack result) Create a shaped recipe to craft the specified ItemStack.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.SmithingTrimRecipe
(@NotNull NamespacedKey key, @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中NamespacedKey的使用
修饰符和类型方法说明SkullMeta.getNoteBlockSound()
Gets the sound to play if the skull is placed on a note block.修饰符和类型方法说明void
KnowledgeBookMeta.addRecipe
(@NotNull NamespacedKey... recipes) 向书的末尾添加新的合成配方.void
SkullMeta.setNoteBlockSound
(@Nullable NamespacedKey noteBlockSound) Sets the sound to play if the skull is placed on a note block.修饰符和类型方法说明void
KnowledgeBookMeta.setRecipes
(@NotNull List<NamespacedKey> recipes) 清空书本内原有的合成配方, 替换为提供的合成配方. -
org.bukkit.inventory.meta.components中NamespacedKey的使用
修饰符和类型方法说明JukeboxPlayableComponent.getSongKey()
Gets the key of the song assigned to this component.修饰符和类型方法说明void
JukeboxPlayableComponent.setSongKey
(@NotNull NamespacedKey song) Sets the key of the song assigned to this component. -
org.bukkit.inventory.meta.tags中NamespacedKey的使用
修饰符和类型方法说明<T,
Z> Z CustomItemTagContainer.getCustomTag
(@NotNull NamespacedKey key, @NotNull ItemTagType<T, Z> type) 已过时。Returns the custom tag's value that is stored on the item.<T,
Z> boolean CustomItemTagContainer.hasCustomTag
(@NotNull NamespacedKey key, @NotNull ItemTagType<T, Z> type) 已过时。Returns if the item meta has a custom tag registered matching the provided parameters.void
CustomItemTagContainer.removeCustomTag
(@NotNull NamespacedKey key) 已过时。Removes a custom key from the item meta.<T,
Z> void CustomItemTagContainer.setCustomTag
(@NotNull NamespacedKey key, @NotNull ItemTagType<T, Z> type, Z value) 已过时。Stores a custom value on theItemMeta
. -
org.bukkit.loot中NamespacedKey的使用
-
org.bukkit.packs中NamespacedKey的使用
修饰符和类型方法说明DataPackManager.getDataPack
(@NotNull NamespacedKey dataPackKey) Gets aDataPack
by its key. -
org.bukkit.persistence中NamespacedKey的使用
修饰符和类型方法说明PersistentDataContainer.getKeys()
Get the set of keys present on thisPersistentDataContainer
instance.修饰符和类型方法说明<P,
C> C PersistentDataContainer.get
(@NotNull NamespacedKey key, @NotNull PersistentDataType<P, C> type) Returns the metadata value that is stored on thePersistentDataHolder
instance.<P,
C> C PersistentDataContainer.getOrDefault
(@NotNull NamespacedKey key, @NotNull PersistentDataType<P, C> type, C defaultValue) Returns the metadata value that is stored on thePersistentDataHolder
instance.boolean
PersistentDataContainer.has
(@NotNull NamespacedKey key) Returns if the persistent metadata provider has metadata registered matching the provided parameters.<P,
C> boolean PersistentDataContainer.has
(@NotNull NamespacedKey key, @NotNull PersistentDataType<P, C> type) Returns if the persistent metadata provider has metadata registered matching the provided parameters.void
PersistentDataContainer.remove
(@NotNull NamespacedKey key) Removes a custom key from thePersistentDataHolder
instance.<P,
C> void PersistentDataContainer.set
(@NotNull NamespacedKey key, @NotNull PersistentDataType<P, C> type, C value) Stores a metadata value on thePersistentDataHolder
instance. -
org.bukkit.potion中NamespacedKey的使用
修饰符和类型方法说明static @Nullable PotionEffectType
PotionEffectType.getByKey
(@Nullable NamespacedKey key) 已过时。仅为保障向后兼容性, 请使用Registry.get(NamespacedKey)
-
org.bukkit.structure中NamespacedKey的使用
修饰符和类型方法说明void
StructureManager.deleteStructure
(@NotNull NamespacedKey structureKey) Unregisters the specified structure and deletes itsstructure file
from the primary world folder.void
StructureManager.deleteStructure
(@NotNull NamespacedKey structureKey, boolean unregister) Deletes thestructure file
for the specified structure from the primary world folder.StructureManager.getStructure
(@NotNull NamespacedKey structureKey) Gets a registered Structure.StructureManager.getStructureFile
(@NotNull NamespacedKey structureKey) Gets the location where a structure file would exist in the primary world directory based on the NamespacedKey using the format world/generated/{NAMESPACE}/structures/{KEY}.nbt.StructureManager.loadStructure
(@NotNull NamespacedKey structureKey) Loads the structure for the specified key and automatically registers it.StructureManager.loadStructure
(@NotNull NamespacedKey structureKey, boolean register) Loads a structure for the specified key and optionallyregisters
it.StructureManager.registerStructure
(@NotNull NamespacedKey structureKey, @NotNull Structure structure) Registers the given structure.void
StructureManager.saveStructure
(@NotNull NamespacedKey structureKey) Saves the currentlyregistered structure
for the specifiedkey
to the primary world folder as specified by {#getStructureFile(NamespacedKey}.void
StructureManager.saveStructure
(@NotNull NamespacedKey structureKey, @NotNull Structure structure) Saves a structure with a given key to the primary world folder.StructureManager.unregisterStructure
(@NotNull NamespacedKey structureKey) Unregisters a structure.