Class FabricRegistryBuilder<T,R extends MutableRegistry<T>>

java.lang.Object
net.fabricmc.fabric.api.event.registry.FabricRegistryBuilder<T,R>
Type Parameters:
T - The type stored in the Registry
R - The registry type

public final class FabricRegistryBuilder<T,R extends MutableRegistry<T>> extends Object
Used to create custom registries, with specified registry attributes.

See the following example for creating a Registry of String objects.

 
  RegistryKey<Registry<String>> registryKey = RegistryKey.ofRegistry(Identifier.of("modid", "registry_name"));
  Registry<String> registry = FabricRegistryBuilder.createSimple(registryKey)
 													.attribute(RegistryAttribute.SYNCED)
 													.buildAndRegister();
 	
 

Tags for the entries of a custom registry must be placed in /tags/<registry namespace>/<registry path>/. For example, the tags for the example registry above would be placed in /tags/modid/registry_name/.