Interface RegisterEvent.RegisterHelper<T>

Enclosing class:
RegisterEvent
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface RegisterEvent.RegisterHelper<T>
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    register(String name, T value)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use the RL-explicit variant instead; mod ID inference will be removed in a later update, alongside the move of registration events to the NeoForge main bus
    default void
    register(ResourceKey<T> key, T value)
    Registers the given value with the given name to the registry.
    void
    register(ResourceLocation name, T value)
    Registers the given value with the given name to the registry.
  • Method Details

    • register

      @Deprecated(forRemoval=true, since="1.20.2") default void register(String name, T value)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use the RL-explicit variant instead; mod ID inference will be removed in a later update, alongside the move of registration events to the NeoForge main bus
      Registers the given value with the given name to the registry. The namespace is inferred based on the active mod container. If you wish to specify a namespace, use register(ResourceLocation, Object) instead.
      Parameters:
      name - the name of the object to register as its key with the namespaced inferred from the active mod container
      value - the object value
    • register

      default void register(ResourceKey<T> key, T value)
      Registers the given value with the given name to the registry.
      Parameters:
      key - the resource key of the object to register
      value - the object value
    • register

      void register(ResourceLocation name, T value)
      Registers the given value with the given name to the registry.
      Parameters:
      name - the name of the object to register as its key
      value - the object value