Interface TagKey

All Superinterfaces:
Wrapper

@NullMarked @AsOf("3.1.0") public interface TagKey extends Wrapper
A wrapper over Minecraft's TagKey<T>: a named reference to a tag within a specific registry. It is backed by a ResourceKey and the RegistryId of the registry it lives in.
Since:
3.1.0
  • Method Details

    • key

      @AsOf("3.1.0") ResourceKey key()
      The identifier of this tag.
      Returns:
      the tag identifier
      Since:
      3.1.0
    • registryId

      @AsOf("3.1.0") RegistryId registryId()
      The registry this tag belongs to.
      Returns:
      the registry discriminator
      Since:
      3.1.0
    • blocks

      @AsOf("3.1.0") static TagKey blocks(ResourceKey key)
      Creates a block tag key from its identifier.
      Parameters:
      key - the tag identifier
      Returns:
      a new block tag key
      Since:
      3.1.0
    • blocks

      @AsOf("3.1.0") static TagKey blocks(Tag<Material> tag)
      Creates a block tag key from a Bukkit block Tag.
      Parameters:
      tag - the Bukkit block tag
      Returns:
      a new block tag key
      Since:
      3.1.0
    • timelines

      @AsOf("3.2.0") static TagKey timelines(ResourceKey key)
      Creates a timeline tag key from its identifier.
      Parameters:
      key - the tag identifier
      Returns:
      a new timeline tag key
      Since:
      3.2.0
    • of

      @AsOf("3.1.0") static <T extends Keyed> TagKey of(RegistryId registry, Tag<T> tag)
      Creates a tag key from a Bukkit Tag, resolving against the given registry.
      Type Parameters:
      T - the Bukkit type of the tag's elements
      Parameters:
      registry - the registry the tag belongs to
      tag - the Bukkit tag
      Returns:
      a new tag key
      Since:
      3.1.0
    • of

      @AsOf("3.1.0") @Internal static TagKey of(RegistryId registry, ResourceKey key)
      Creates a tag key from its identifier, resolving against the given registry.
      Parameters:
      registry - the registry the tag belongs to
      key - the tag identifier
      Returns:
      a new tag key
      Since:
      3.1.0