Skip to content

RegistrarHelper

abstract class RegistrarHelper(modId: String)

A base for declaring custom Architectury registries (i.e. a whole new registry, the way net.minecraft.core.registries.Registries.ITEM is a registry) via lazily-built Registrars.

This is unrelated to registering entries into an existing registry - for that, use RegistryHelper/ADeferredRegistryHolder with a dev.architectury.registry.registries.DeferredRegister. Once a custom registry declared here exists, populating it with entries still requires its own dev.architectury.registry.registries.DeferredRegister targeting the Registrar's registry key, created separately from this helper.

Parameters

  • modId: The mod id passed to RegistrarManager.get and used as the namespace for each registry.

Constructors

RegistrarHelper

constructor(modId: String)

Parameters

  • modId: The mod id passed to RegistrarManager.get and used as the namespace for each registry.

Functions

init

fun init()

Forces every custom registry declared via registry to be built.

registry

fun <T : Any> registry(id: String, block: RegistrarBuilder<T>.() -> Unit = {}): Lazy<Registrar<T>>

Declares a lazily-built custom Registrar (registry) for id, configured via block.

Parameters

  • id: The unqualified registry id, namespaced under modId.