-
Notifications
You must be signed in to change notification settings - Fork 4
Getting Started (Variant Loader)
The Variant Loader allows you to register entity textures using a server-side data path, enabling users to create datapacks and resource packs to modify variants, entityData, and parameters.
To begin using the Variant Loader, you need to register your JSON path by looping through all specified paths and loading all entities at once. This approach ensures all textures are preloaded, minimizing the likelihood of encountering missing textures during runtime. Here’s a basic implementation:
public class VariantProvider implements IVariantProvider {
@Override
public List<String> getEntityNames() {
return List.of("entityOne", "entityTwo");
}
@Override
public String getBasePath() {
return IVariantProvider.super.getBasePath();
}
}Make sure to register the Provider in the constructor of your mod.
ReloadHandler.registerProvider(new VariantProvider());When using the Variant Loader, your mod's resource structure should be organized to ensure that textures and JSON files are easily accessible and correctly linked. Below is an example of how your resource directory would be structured using the example code above.
src/
└── main/
└── resources/
├── assets/
| └── <modid>/
| └── textures/
| └── entity/
| ├── entityOne/
| │ └── texture.png
| └── entityTwo/
| └── texture.png
└── data/
└── <modid>/
└── variant/
└── entity/
├── entityOne/
│ ├── VariantOne.json
│ └── VariantTwo.json
└── entityTwo/
├── VariantOne.json
└── VariantTwo.json- Use
ReloadHandler.setProvider(): Call this in your mod constructor or initialization event to register yourVariantProviderand activate the loader.
By following this guide, you'll be able to effectively register and manage entity textures in your Minecraft mod using the Variant Loader. Happy modding!
Variant Loader
Data Pipeline
Network & Packets
Logging
Markdown
Utility Classes
- Conversion
- Math
- Minecraft
- Schedular