Annotation Interface ObjectHolder


@Retention(RUNTIME) @Target(FIELD) public @interface ObjectHolder
ObjectHolder can be used to automatically populate public static final fields with entries from the registry. These values can then be referred within mod code directly.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The name of the registry to load registry entries from.
    Represents a name in the form of a ResourceLocation which points to a registry object from the registry given by registryName().
  • Element Details

    • registryName

      String registryName
      The name of the registry to load registry entries from. This string is parsed as a ResourceLocation and can contain a namespace.
      Returns:
      the registry name
    • value

      String value
      Represents a name in the form of a ResourceLocation which points to a registry object from the registry given by registryName(). Must specify the modid if not inside a class annotated with Mod.
      Returns:
      a name in the form of a ResourceLocation