Back to mods
Registrar project artwork

Modrinth · Minecraft mod

Registrar

SkyNotTheLimit's registration helper

Choose a version Pick your version below, then grab the matching file.

Quick answer

Which Registrar release should I use?

Updated 10 days ago
Latest stable file 0.1.4+26.2
Game version 26.2
Loader Fabric

Registrar 0.1.4+26.2 targets 26.2 with Fabric. Installation on the client is optional. Installation on the dedicated server is optional. No extra mods listed for this file.

Where it goes

Is Registrar required on the client, server, or both?

Installation on the client is optional. Installation on the dedicated server is optional.

Client Optional
Dedicated server Optional
Loader for this release Fabric
Required install it here Optional supported, not mandatory Not supported do not install here Source doesn’t say do not assume

The source marks this as usable on both the client and server.

What else does Registrar 0.1.4+26.2 need?

0.1.4+26.2. Change the file and its required mods may change too.

No extra mods listed for this file

This file does not list any required mods. Do not add a library just because a different file uses it.

This file does not list any required or optional mods.

Before you install it

Add Registrar without breaking your instance.

Built for Registrar 0.1.4+26.2. Pick another file and the loader, install side or required mods may change.

  1. 01

    Stick to this file

    Use 0.1.4+26.2. It targets 26.2 with Fabric; another release may have different loader, side or dependency requirements.

  2. 02

    Bring the mods it needs

    This file does not list any required mods. Do not add a library just because a different file uses it.

  3. 03

    Put it on the correct side

    Installation on the client is optional. Installation on the dedicated server is optional.

  4. 04

    Pick the file you checked

    Use the “Get this file” button beside 0.1.4+26.2. It opens that exact file at the source.

About this project

What does Registrar add?

Registrar

A registry helper for Minecraft modding

Adding Registrar To Your Project

Modrinth Maven

If you don't have the Modrinth maven in your repositories block, add it like so:

build.gradle:

maven {
    url("https://api.modrinth.com/maven")
    content {
        includeGroupAndSubgroups("maven.modrinth")
    }
}

or build.gradle.kts:

maven("https://api.modrinth.com/maven") {
    content {
        includeGroupAndSubgroups("maven.modrinth")
    }
}

Then, add this project to your dependencies.

If you're using deobfuscated Minecraft:

api("maven.modrinth:registrar:${project.registrar_version}") // or implementation
include("maven.modrinth:registrar:${project.registrar_version}")

If you're using obfuscated Minecraft:

modApi("maven.modrinth:registrar:${project.registrar_version}") // or modImplementation
include("maven.modrinth:registrar:${project.registrar_version}")
mavenLocal

First, fork or download this repository and publish it to your mavenLocal.

Then, adding the following to your repositories block:

mavenLocal()

Then, add this project to your dependencies.

If you're using deobfuscated Minecraft:

api("survivalblock.atmosphere:registrar:${project.registrar_version}") // or implementation
include("survivalblock.atmosphere:registrar:${project.registrar_version}")

If you're using obfuscated Minecraft:

modApi("survivalblock.atmosphere:registrar:${project.registrar_version}") // or modImplementation
include("survivalblock.atmosphere:registrar:${project.registrar_version}")

Normal Registrants

To start, create a Registrant instance of the type you need, like so:

private static final BlockRegistrant BLOCK_REGISTRANT = new BlockRegistrant(ExampleMod.MOD_ID);

If a registrant of the required type does not exist, you can create one!

private static final Registrant RECIPE_SERIALIZER_REGISTRANT = new Registrant(ExampleMod.MOD_ID, BuiltinRegistries.RECIPE_SERIALIZER);

Feel free to open an issue to notify me if there is a need to add other common registrants.

To register an object, simply call Registrant#register.

REGISTRANT.register("name", THING);

Note that some registrant classes have special register methods.
For example, ItemRegistrant has a register method that takes three parameters.

ITEM_REGISTRANT.register("name", Item::new, new Item.Properties());

ItemRegistrant is also capable of registering BlockItems via separate register overloads.
For more information, see the Documentation.

Delayed Registrants

All normal registrants have a delayed counterpart, which can be found in the delayed package.

Delayed registrants are identical to normal registrants, with one exception:
DelayedRegistrant#consumeAll must be called to actually register the objects.

public static void init() {
  REGISTRANT.consumeAll();
}

Dynamic Registrants

Dynamic registrants are registrants for dynamic registries.
Currently, only registrants for DamageTypes and Enchantments exist in the base library.
See these links for examples of registering damage types and enchantments.

To add the registrants for datagen, override buildRegistry in your mod's DataGeneratorEntrypoint like so:

@Override
public void buildRegistry(RegistrySetBuilder registryBuilder) {
    DYNAMIC_REGISTRANT.bootstrap(registryBuilder);
}

where bootstrap is a shorthand for registryBuilder.addRegistry(REGISTRY_KEY, DYNAMIC_REGISTRANT::bootstrap);

Special Registrants

Special registrants are registrants which have no backing Registry. They may or may not
extend Registrant. (Note that GameRuleRegistrant before 1.21.11 is technically a special
registrant.)

Currently, this only includes AttachmentTypeRegistrant.

Documentation

Registrar provides some javadocs, but if you don't want to download the source jar to avoid my multiversioned comments, read this.

Attachment Types

AttachmentTypeRegistrant contains overloads to register with the builder or register with method parameters.

Block Entity Types

BlockEntityTypeRegistrant and DelayedBlockEntityTypeRegistrant implement IBlockEntityTypeRegistrant,
which can register BlockEntityType.Builder/FabricBlockEntityTypeBuilders depending on the version. It
can also take the BE's constructor (as a lambda) and a Block varargs to construct the BlockEntityType.

Blocks

BlockRegistrant and DelayedBlockRegistrant implement IBlockRegistrant, which can register Blocks
based on a constructor and their BlockBehaviour$Properties. Note that BlockBehaviour$Properties#setId
is called for you.

In 26.2, createId methods are available to create BlockItemIds.

Game Rules

Due to BuiltinRegistries.GAME_RULE not existing before 1.21.11, GameRuleRegistrant's registry is
null in those versions. Registration in those versions is done via Fabric API's GameRuleRegistry, which
is not a real Registry.

DelayedGameRuleRegistrant does not exist before 1.21.11 for reasons described above.

Both GameRuleRegistrant and DelayedGameRuleRegistrant implement IGameRuleRegistrant, which contains
methods to register GameRules$Key/GameRules depending on the version. Overloads to register a boolean
rule exist, but due to the larger variation of ways to construct rules pre-1.21.11, these are not exhaustive.
It is recommended to make your own helpers as necessary.

IGameRuleRegistrant also contains minor multiversion utilities to obtain values from GameRules. These
can also be found in the actual registrants, which perform unboxing for some rules.

Items

ItemRegistrant and DelayedItemRegistrant implement IItemRegistrant (funny double I), which can register
Items based on a constructor and their Item$Properties. Note that Item$Properties#setId is called for
you.

The two IItemRegistrants are also capable of registering BlockItems with other register overloads. In
addition, reflective registration for BlockItems is also supported with the ConstructItem annotation.
This requires the invocation of IItemRegistrant#registerFromAnnotations, which returns a map of the Blocks
to registered Items. The class parameter dictates which class's fields to check, while tryAllByDefault
will tell the registrant to construct items even if no annotation is present.

Setting useBlockTranslation to true in ConstructItem will invoke useBlockDescriptionPrefix on the
Item$Properties. This isn't necessary in 1.21.1, because it is determined by BlockItem#getDescriptionId.

You can also exclude the item from being automatically registered with exclude = true. This is helpful when
manual registration is required for BlockItems that have more than Block block, Item.Properties properties
in their constructors (such as signs and banners), because these are unsupported by the reflective registration.
For classes with a constructor with those parameters, you can specify the class with
constructor = CustomBlockItem.class.

ConstructItem must be annotated on a public static Block or BlockItemId field. Note that annotating a
Block field in this way beyond 26.2 is deprecated and will result in spammed warnings in your logs unless you
set suppressIdWarnings = true in the annotation.

Project description from Modrinth.

Pick your setup

Registrar by Minecraft version and loader

Choose the version and loader you play, then open the matching release.

16 available setups

Showing the newest 12 of 16 game versions. Older files are in the list below.

Check the dependencies, then try the file in a copied instance before changing a world you care about.

Recent files

Registrar versions and loaders

43 of 43 releases match

Looking for an older file? The official Modrinth project page is in Resources.