Interface ITaggableElementRegistrationHandler


public interface ITaggableElementRegistrationHandler
Manages the registration of taggable elements and their managers used for tags.

Refer to the documentation of the various methods for more information.

Since:
9.1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    <T, U extends ITagManager<?>>
    void
    registerManager(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key, TagManagerFactory<T,U> factory)
    Registers a new TagManagerFactory for the given ResourceKey.
    <T> void
    registerTaggableElement(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key, Class<T> elementClass)
    Registers a new taggable element with the given ResourceKey of the Registry that holds the given element class.
  • Method Details

    • registerTaggableElement

      <T> void registerTaggableElement(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key, Class<T> elementClass)
      Registers a new taggable element with the given ResourceKey of the Registry that holds the given element class.

      The key is used to map <tag:> calls to the specific element.

      Type Parameters:
      T - The type of element being registered.
      Parameters:
      key - The ResourceKey of the Registry that holds the element is being registered.
      elementClass - A Class of the element that is being registered.
      Since:
      9.1.0
    • registerManager

      <T, U extends ITagManager<?>> void registerManager(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key, TagManagerFactory<T,U> factory)
      Registers a new TagManagerFactory for the given ResourceKey.

      A tag manager factory allows for a custom class to be used instead of the default KnownTagManager. A custom tag manager allows you to easily add new methods to your manager without having to expand it.

      Note: Taggable elements with type parameters require a custom factory, see EntityTypeTagManagerFactory and EntityTypeTagManager.

      Type Parameters:
      T - The type of element the tagmanager the factory makes deals with.
      Parameters:
      key - The ResourceKey of the Registry that holds the element is being registered.
      factory - The TagManagerFactory that is being registered.
      Since:
      9.1.0