Setup

When using the Registry system you need to set up some mod loader dependent functions, This mod works by creating the mod loader registries To be used when a Registry function is called. When creating/using a Architectury based mod your structure might look like this (1). when setting up, you need to go into the initialization of the wanted mod loader/mod loader's and call the appropriate initialization function's

  1. img

Example

Warning

Forge is only supported until Minecraft 1.19.2

@Mod("modid")
public final class VLModForge {
    public VLModForge() {
        ForgeRegistryCreator.Create(FMLJavaModLoadingContext.get().getModEventBus(), "modid");
        MyModInCommonsProject.init();
    }

    @Mod.EventBusSubscriber(modid = "modid", bus = Mod.EventBusSubscriber.Bus.MOD)
    public static class ClientModEvents {
        @SubscribeEvent
        public static void onClientSetup(FMLClientSetupEvent event) {
            ForgeRegistryCreator.CreateClient("modid");
        }
    }
}

Warning

NeoForge is only supported from Minecraft 1.20.4 and onwards

@Mod("modid")
public final class VLModNeoForge {
    public VLModNeoForge() {
        NeoForgeRegistryCreator.Create(ModLoadingContext.get().getActiveContainer().getEventBus(), "modid");
        MyModInCommonsProject.init();
    }

    @Mod.EventBusSubscriber(modid = "modid", bus = Mod.EventBusSubscriber.Bus.MOD)
    public static class ClientModEvents {
        @SubscribeEvent
        public static void onClientSetup(FMLClientSetupEvent event) {
            NeoForgeRegistryCreator.CreateClient("modid");
        }
    }
}
1
2
3
4
5
6
public final class VLModFabric implements ModInitializer {
    @Override
    public void onInitialize() {
        VLModFabricLike.init("modid", ()->MyModInCommonsProject.init());
    }
}
1
2
3
4
5
6
public final class VLModQuilt implements ModInitializer {
    @Override
    public void onInitialize() {
        VLModFabricLike.init("modid", ()->MyModInCommonsProject.init());
    }
}