Interface TagKey<T>

Type Parameters:
T - the type of the members

public sealed interface TagKey<T>
A tag bound to the registry its members belong to.

It is not a Key: use key() to get the plain key of the tag, without the leading #. Two tag keys are equal when they have the same registry and the same key, and a tag key never equals a TypedKey, even one with the same namespace and value.

Since:
0.1.0
  • Method Details

    • withRegistry

      static <T> TagKey<T> withRegistry(RegistryKey<T> registry, Key key)
      Returns a tag of the given registry.
      Type Parameters:
      T - the type of the members
      Parameters:
      registry - the registry
      key - the key of the tag
      Returns:
      a tag of the given registry
      Since:
      0.1.0
    • withRegistry

      static <T> TagKey<T> withRegistry(RegistryKey<T> registry, @KeyPattern String key)
      Returns a tag of the given registry.
      Type Parameters:
      T - the type of the members
      Parameters:
      registry - the registry
      key - the key of the tag, for instance minecraft:logs
      Returns:
      a tag of the given registry
      Since:
      0.1.0
    • registry

      RegistryKey<T> registry()
      Returns the registry of the tag.
      Returns:
      the registry of the tag
      Since:
      0.1.0
    • key

      Key key()
      Returns the plain key of the tag, without the registry.
      Returns:
      the plain key of the tag, without the registry
      Since:
      0.1.0