Skip to content

Project Structure

This page will go over the structure of a Fabric mod project, and the purpose of each file and folder in the project.


The fabric.mod.json file is the main file that describes your mod to Fabric Loader. It contains information such as the mod's ID, version, and dependencies.

The most important fields in the fabric.mod.json file are:

  • id: The mod's ID, which should be unique.
  • name: The mod's name.
  • environment: The environment that your mod runs in, such as client, server, or * for both.
  • entrypoints: The entrypoints that your mod provides, such as main or client.
  • depends: The mods that your mod depends on.
  • mixins: The mixins that your mod provides.

You can see an example fabric.mod.json file below - this is the fabric.mod.json file for the reference project that powers this documentation site.

Reference Project fabric.mod.json
	"schemaVersion": 1,
	"id": "fabric-docs-reference",
	"version": "1.0.0",
	"name": "Fabric docs reference",
	"icon": "assets/fabric-docs-reference/icon.png",
	"environment": "*",
	"entrypoints": {
		"main": [
		"client": [
		"fabric-datagen": [
	"mixins": [
			"config": "fabric-docs-reference.client.mixins.json",
			"environment": "client"
	"depends": {
		"fabricloader": ">=0.15.3",
		"minecraft": "~1.20.4",
		"java": ">=17",
		"fabric-api": "*"


As mentioned before, the fabric.mod.json file contains a field called entrypoints - this field is used to specify the entrypoints that your mod provides.

The template mod generator creates both a main and client entrypoint by default - the main entrypoint is used for common code, and the client entrypoint is used for client-specific code. These entrypoints are called respectively when the game starts.

public class FabricDocsReference implements ModInitializer {
	// This logger is used to write text to the console and the log file.
	// It is considered best practice to use your mod id as the logger's name.
	// That way, it's clear which mod wrote info, warnings, and errors.
	public static final String MOD_ID = "fabric-docs-reference";
	public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);

	public void onInitialize() {
		// This code runs as soon as Minecraft is in a mod-load-ready state.
		// However, some things (like resources) may still be uninitialized.
		// Proceed with mild caution."Hello Fabric world!");

The above is an example of a simple main entrypoint that logs a message to the console when the game starts.


The src/main/resources folder is used to store the resources that your mod uses, such as textures, models, and sounds.

It's also the location of fabric.mod.json and any mixin configuration files that your mod uses.

Assets are stored in a structure that mirrors the structure of resource packs - for example, a texture for a block would be stored in assets/modid/textures/block/block.png.


The src/client/resources folder is used to store client-specific resources, such as textures, models, and sounds that are only used on the client side.


The src/main/java folder is used to store the Java source code for your mod - it exists on both the client and server environments.


The src/client/java folder is used to store client-specific Java source code, such as rendering code or client-side logic - such as block color providers.