User Tools

Site Tools


← Go back to the homepage

Fabric Tutorials



These pages are essential must-reads when modding with Fabric, and modding Minecraft in general, if you are new to modding, it is recommended you read the following.


Blocks and Block Entities

Data Generation

World Generation


These pages will guide you through Mojang's Brigadier library which allows you to create commands with complex arguments and actions.


These pages will guide you through using the many events included in Fabric API, and how to create your own events for you or other mods to use.



Mixins & ASM

These pages will guide you through the usage of SpongePowered's Mixin library, which is a highly complex topic. We recommend you read these pages thoroughly.



Contribute to Fabric


Language Generation

You can generate translation entries from existing language files and classes that support translation keys.

Firstly, create a class that extends FabricLanguageProvider and implement the base methods like so:

private static class MyModEnglishLangProvider extends FabricLanguageProvider {
	private MyModEnglishLangProvider(FabricDataGenerator dataGenerator) {
                // Specifying en_us is optional, by default is is en_us.
		super(dataGenerator, "en_us");
	public void generateTranslations(TranslationBuilder translationBuilder) {

Lets add some translation entries:

public void generateTranslations(TranslationBuilder translationBuilder) {
	translationBuilder.add(SIMPLE_ITEM, "Simple Item");
	translationBuilder.add(SIMPLE_BLOCK, "Simple Block");
	translationBuilder.add(SIMPLE_ITEM_GROUP, "Simple Item Group");
	// Load an existing language file.
	try {
		Path existingFilePath = dataGenerator.getModContainer().findPath("assets/mymod/lang/en_us.existing.json").get();
	} catch (Exception e) {
		throw new RuntimeException("Failed to add existing language file!", e);

Now, we will need to add the provider to our data generator in the onInitializeDataGenerator in your entrypoint class like so:

public class DataGeneration implements DataGeneratorEntrypoint {
    public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) {

Supported Classes

These are the game objects that have a translation key for you to translate:

  • Item
  • Block
  • ItemGroup
  • EntityType<T>
  • Enchantment
  • EntityAttribute
  • StatType<T>
  • StatusEffect
  • Identifier
tutorial/datagen_language.txt · Last modified: 2022/12/22 11:54 by jmanc3