类的使用
org.bukkit.NamespacedKey
使用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的使用
返回NamespacedKey的org.bukkit中的方法修饰符和类型方法说明static @Nullable NamespacedKeyNamespacedKey.fromString(@NotNull String key) 根据提供的字符串获取 NamespacedKey 对象.static @Nullable NamespacedKeyNamespacedKey.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 NamespacedKeyNamespacedKey.randomKey()已过时。插件应永不使用此方法, 仅供内部使用!!参数类型为NamespacedKey的org.bukkit中的方法修饰符和类型方法说明static @NotNull KeyedBossBarBukkit.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 AdvancementBukkit.getAdvancement(@NotNull NamespacedKey key) 通过Key获得特定的进度对象.Server.getAdvancement(@NotNull NamespacedKey key) 通过Key获得特定的进度对象.static @Nullable KeyedBossBarBukkit.getBossBar(@NotNull NamespacedKey key) Gets theKeyedBossBarspecified by this key.Server.getBossBar(@NotNull NamespacedKey key) Gets theKeyedBossBarspecified by this key.GameEvent.getByKey(@NotNull NamespacedKey namespacedKey) 已过时。static @Nullable MusicInstrumentMusicInstrument.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.booleanUnsafeValues.removeAdvancement(NamespacedKey key) 已过时。Delete an advancement which was loaded and saved byUnsafeValues.loadAdvancement(org.bukkit.NamespacedKey, java.lang.String).static booleanBukkit.removeBossBar(@NotNull NamespacedKey key) Removes aKeyedBossBarspecified by this key.booleanServer.removeBossBar(@NotNull NamespacedKey key) Removes aKeyedBossBarspecified by this key.static booleanBukkit.removeRecipe(@NotNull NamespacedKey key) 从服务器移除指定的合成配方.booleanServer.removeRecipe(@NotNull NamespacedKey key) 从服务器移除指定的合成配方. -
org.bukkit.attribute中NamespacedKey的使用
参数类型为NamespacedKey的org.bukkit.attribute中的构造器限定符构造器说明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.参数类型为NamespacedKey的org.bukkit.block中的方法修饰符和类型方法说明voidSkull.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的使用
参数类型为NamespacedKey的org.bukkit.enchantments中的方法修饰符和类型方法说明static @Nullable EnchantmentEnchantment.getByKey(@Nullable NamespacedKey key) 已过时。仅为保障作向后兼容性, 请使用Registry.get(NamespacedKey)instead -
org.bukkit.entity中NamespacedKey的使用
返回变量类型为NamespacedKey的类型的org.bukkit.entity中的方法修饰符和类型方法说明HumanEntity.getDiscoveredRecipes()Get an immutable set of recipes this entity has discovered.参数类型为NamespacedKey的org.bukkit.entity中的方法修饰符和类型方法说明booleanHumanEntity.discoverRecipe(@NotNull NamespacedKey recipe) Discover a recipe for this player such that it has not already been discovered.booleanHumanEntity.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.voidPlayer.storeCookie(@NotNull NamespacedKey key, @org.jetbrains.annotations.NotNull byte[] value) Stores a cookie in this player's client.booleanHumanEntity.undiscoverRecipe(@NotNull NamespacedKey recipe) Undiscover a recipe for this player such that it has already been discovered.类型变量类型为NamespacedKey的org.bukkit.entity中的方法参数修饰符和类型方法说明intHumanEntity.discoverRecipes(@NotNull Collection<NamespacedKey> recipes) Discover a collection of recipes for this player such that they have not already been discovered.intHumanEntity.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的使用
参数类型为NamespacedKey的org.bukkit.entity.memory中的方法修饰符和类型方法说明MemoryKey.getByKey(@NotNull NamespacedKey namespacedKey) Returns aMemoryKeyby aNamespacedKey. -
org.bukkit.event.player中NamespacedKey的使用
参数类型为NamespacedKey的org.bukkit.event.player中的构造器 -
org.bukkit.event.world中NamespacedKey的使用
返回变量类型为NamespacedKey的类型的org.bukkit.event.world中的方法修饰符和类型方法说明AsyncStructureGenerateEvent.getBlockTransformers()Gets all block transformers in a unmodifiable map.AsyncStructureGenerateEvent.getEntityTransformers()Gets all entity transformers in a unmodifiable map.参数类型为NamespacedKey的org.bukkit.event.world中的方法修饰符和类型方法说明AsyncStructureGenerateEvent.getBlockTransformer(@NotNull NamespacedKey key) Gets a block transformer by key.AsyncStructureGenerateEvent.getEntityTransformer(@NotNull NamespacedKey key) Gets a entity transformer by key.voidAsyncStructureGenerateEvent.removeBlockTransformer(@NotNull NamespacedKey key) Removes a block transformer.voidAsyncStructureGenerateEvent.removeEntityTransformer(@NotNull NamespacedKey key) Removes a entity transformer.voidAsyncStructureGenerateEvent.setBlockTransformer(@NotNull NamespacedKey key, @NotNull BlockTransformer transformer) Sets a block transformer to a key.voidAsyncStructureGenerateEvent.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()参数类型为NamespacedKey的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) 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.protectedCraftingRecipe(@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,SmithingTransformRecipeandSmithingTrimRecipe.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.返回变量类型为NamespacedKey的类型的org.bukkit.inventory.meta中的方法参数类型为NamespacedKey的org.bukkit.inventory.meta中的方法修饰符和类型方法说明voidKnowledgeBookMeta.addRecipe(@NotNull NamespacedKey... recipes) 向书的末尾添加新的合成配方.voidSkullMeta.setNoteBlockSound(@Nullable NamespacedKey noteBlockSound) Sets the sound to play if the skull is placed on a note block.类型变量类型为NamespacedKey的org.bukkit.inventory.meta中的方法参数修饰符和类型方法说明voidKnowledgeBookMeta.setRecipes(@NotNull List<NamespacedKey> recipes) 清空书本内原有的合成配方, 替换为提供的合成配方. -
org.bukkit.inventory.meta.components中NamespacedKey的使用
修饰符和类型方法说明JukeboxPlayableComponent.getSongKey()Gets the key of the song assigned to this component.修饰符和类型方法说明voidJukeboxPlayableComponent.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.voidCustomItemTagContainer.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的使用
返回NamespacedKey的org.bukkit.loot中的方法 -
org.bukkit.packs中NamespacedKey的使用
参数类型为NamespacedKey的org.bukkit.packs中的方法修饰符和类型方法说明DataPackManager.getDataPack(@NotNull NamespacedKey dataPackKey) Gets aDataPackby its key. -
org.bukkit.persistence中NamespacedKey的使用
返回变量类型为NamespacedKey的类型的org.bukkit.persistence中的方法修饰符和类型方法说明PersistentDataContainer.getKeys()Get the set of keys present on thisPersistentDataContainerinstance.参数类型为NamespacedKey的org.bukkit.persistence中的方法修饰符和类型方法说明<P,C> C PersistentDataContainer.get(@NotNull NamespacedKey key, @NotNull PersistentDataType<P, C> type) Returns the metadata value that is stored on thePersistentDataHolderinstance.<P,C> C PersistentDataContainer.getOrDefault(@NotNull NamespacedKey key, @NotNull PersistentDataType<P, C> type, C defaultValue) Returns the metadata value that is stored on thePersistentDataHolderinstance.booleanPersistentDataContainer.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.voidPersistentDataContainer.remove(@NotNull NamespacedKey key) Removes a custom key from thePersistentDataHolderinstance.<P,C> void PersistentDataContainer.set(@NotNull NamespacedKey key, @NotNull PersistentDataType<P, C> type, C value) Stores a metadata value on thePersistentDataHolderinstance. -
org.bukkit.potion中NamespacedKey的使用
参数类型为NamespacedKey的org.bukkit.potion中的方法修饰符和类型方法说明static @Nullable PotionEffectTypePotionEffectType.getByKey(@Nullable NamespacedKey key) 已过时。仅为保障向后兼容性, 请使用Registry.get(NamespacedKey) -
org.bukkit.structure中NamespacedKey的使用
返回变量类型为NamespacedKey的类型的org.bukkit.structure中的方法参数类型为NamespacedKey的org.bukkit.structure中的方法修饰符和类型方法说明voidStructureManager.deleteStructure(@NotNull NamespacedKey structureKey) Unregisters the specified structure and deletes itsstructure filefrom the primary world folder.voidStructureManager.deleteStructure(@NotNull NamespacedKey structureKey, boolean unregister) Deletes thestructure filefor 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 optionallyregistersit.StructureManager.registerStructure(@NotNull NamespacedKey structureKey, @NotNull Structure structure) Registers the given structure.voidStructureManager.saveStructure(@NotNull NamespacedKey structureKey) Saves the currentlyregistered structurefor the specifiedkeyto the primary world folder as specified by {#getStructureFile(NamespacedKey}.voidStructureManager.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.