Fabric provides an easy way to create a new mod project using the Fabric Template Mod Generator - if you want, you can manually create a new project using the example mod repository, you should refer to the Manual Project Creation section.
Generating a Project
You can use the Fabric Template Mod Generator to generate a new project for your mod - you should fill in the required fields, such as the mod name, package name, and the Minecraft version that you want to develop for.
The package name should be lowercase, separated by dots, and unique to avoid conflicts with other programmers' packages. It is typically formatted as a reversed internet domain, such as com.example.mod-id.

If you either want to use Kotlin, or Mojang's official mappings rather than the Yarn mappings, or want to add data generators, you can select the appropriate options in the Advanced Options section.

Once you've filled in the required fields, click the Generate button, and the generator will create a new project for you to use in the form of a zip file.
You should extract this zip file to a location of your choice, and then open the extracted folder in IntelliJ IDEA:

Importing the Project
Once you've opened the project in IntelliJ IDEA, the IDE should automatically load the project's Gradle configuration and perform the necessary setup tasks.
If you receive a notification talking about a Gradle build script, you should click the Import Gradle Project button:

Once the project has been imported, you should see the project's files in the project explorer, and you should be able to start developing your mod.
Manual Project Creation
WARNING
You will need Git installed in order to clone the example mod repository.
If you cannot use the Fabric Template Mod Generator, you can create a new project manually by following these steps.
Firstly, clone the example mod repository using Git:
sh
git clone https://github.com/FabricMC/fabric-example-mod/ my-mod-project1
This will clone the repository into a new folder called my-mod-project.
You should then delete the .git folder from the cloned repository, and then open the project in IntelliJ IDEA. If the .git folder does not appear, you should enable the display of hidden files in your file manager.
Once you've opened the project in IntelliJ IDEA, it should automatically load the project's Gradle configuration and perform the necessary setup tasks.
Again, as previously mentioned, if you receive a notification talking about a Gradle build script, you should click the Import Gradle Project button.
Modifying the Template
Once the project has been imported, you should modify the project's details to match your mod's details:
- Modify the project's
gradle.propertiesfile to change themaven_groupandarchive_base_nameproperties to match your mod's details. - Modify the
fabric.mod.jsonfile to change theid,name, anddescriptionproperties to match your mod's details. - Make sure to update the versions of Minecraft, the mappings, the Loader and the Loom - all of which can be queried through https://fabricmc.net/develop/ - to match the versions you wish to target.
You can obviously change the package name and the mod's main class to match your mod's details.



