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(new Identifier("modid", "registry_name"));
  Registry<String> registry = FabricRegistryBuilder.createSimple(registryKey)
 													.attribute(RegistryAttribute.SYNCED)
 													.buildAndRegister();