-
Notifications
You must be signed in to change notification settings - Fork 4
Adding Variants (Variant Loader)
This variant loader has been designed with Geckolib in mind; therefore, using Geckolib is recommended.
-
Register Your Entity:
- Follow the instructions outlined in the Getting Started section to register your entity with the Variant Loader.
-
Create Your Entity:
- Follow the instructions outlined in the Adding Entities section to create your entity.
- Completing these steps is crucial for ensuring that your entity exists and is recognized by the Variant Loader.
When adding variants to the Variant Loader, it is essential to create JSON configuration files and place them in the data/<modid>/variant/entity/
folder of your mod. This allows users to modify the variants using Data and Resource Packs.
- Note: If you are familiar with resource management in Minecraft, you may modify the resource paths to fit your preferences. Just ensure that your modifications are consistent and correctly referenced in your code.
Users can create multiple JSON configuration files, flexibility is extended but not limited to:
- Add one JSON file per variant.
- Combine multiple variants within a single file.
Here is an example of how to structure your JSON configuration file:
One Variant per file
{
"entityOne": [
{
"variantName": "entityOneTextureOne"
}
]
}
Multiple Variants per File
{
"entityOne": [
{
"variantName": "entityOneTextureOne"
},
{
"variantName": "entityOneTextureTwo"
}
]
}
Important Notes:
- Ensure you replace
"entityOneTexture"
with the actual texture file name located in yourassets/
folder. - Replace
entityOne
with the name of the entity you are defining.
Developers can customize the JSON configuration input named variantName
to align with their preferred naming conventions.
To modify this parameter, call the method setVariantParameter(String)
(software.bluelib.entity.variant.variantParameter
) in the constructor of your mod. This method allows you to redefine the parameter name used across your variant configurations.
Note: If you change the
variantName
parameter, you must update it consistently in all previously created JSON configuration files to ensure compatibility with the Variant Loader.
- Each variant entry within the JSON array should have a unique
variantName
that corresponds to the texture files you have created. - The structure of your JSON files must adhere to proper JSON formatting to avoid errors during loading.
- Organizing your variants logically will help in managing them efficiently, especially as the number of entities grows.
For further information and advanced customization options, refer to the official Discord community where you can seek help, share experiences, and learn from other developers. You may also refer to our API Documentation.
Variant Loader
Logging
Interfaces
Utility Classes
- Conversion
- Math
- Minecraft