Getting Started

Data Generation

Learn how to use Data Generation with Balm.

Data Generation is an extremely useful tool that allows you to generate the correct JSON files needed for your blocks, items, tags, etc.

It is recommended to setup Data Generation even for small mods - you will save yourself and your users a lot of time by ensuring all your JSON data is always up-to-date for the Minecraft version you're targeting.

Using Data Generation

The Balm Project Generator and balm-mod template come with a data generation setup already included.

We use Fabric for data generation, as Fabric is usually the first to be available for snapshots. Generated files are saved into the common project, making them available on all loaders without needing data generator code for each loader.

You can find the data generation classes under fabric/src/main/java/.../datagen. The template comes with data generators for recipes, loot tables, models and tags, which is the most common ones you'll need; but you can of course add additional classes by just adding them in the ModDataGenerator class.

Run the :fabric:runData Gradle task to (re-)generate your resource and data files.

Verifying Data Generation with GitHub Actions

The balm-mod template also includes a verify-resources job in its GitHub Actions workflows, which will error if you forgot to run :fabric:runData or are missing language keys that were detected in use.

If you used the Balm Project Generator, feel free to copy those workflows from the template repository.