Skip to content

Create a LoadersHolder

LoadersHolder class is responsible to hold models and textures loaders for your mod. These loaders are going to automatically load .obj models and custom sized textures.

  1. Create instance of the LoadersHolder class inside the main class
    • Directorylibs/
    • Directorysrc/main/
      • Directoryjava/your/namespace/your_mod_id/
        • ExampleMod.java
      • Directoryresources/assets/your_mod_id/
        • Directorytextures/
          • Directorytesr/
        • Directorymodels/
          • Directorytesr/
    ExampleMod.java
    import dev.tauri.jsg.core.client.LoadersHolder;
    @Mod("your_mod_id")
    public class ExampleMod implements JSGAddon {
    public static final LoadersHolder LOADERS_HOLDER = LoadersHolder.getOrCreate("your_mod_id", ExampleMod.class);
    // ...
    }
  2. That’s it! No registration needed when the instance is created inside the main class.