🇬🇧 English
🇬🇧 English
Appearance
🇬🇧 English
🇬🇧 English
Appearance
This page is written for version:
1.21.8
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.
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
.
WARNING
Make sure you remember your mod's ID! Whenever you find mod-id
in these docs, especially in file paths, you will have to replace it with your own.
For example, if your mod ID was fabric-docs-reference
, instead of resources/assets/mod-id
use resources/assets/fabric-docs-reference
.
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:
WARNING
You should follow these rules when choosing the path to your project:
An example of a "good" path may be: C:\Projects\YourProjectName
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.
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:
git clone https://github.com/FabricMC/fabric-example-mod/ my-mod-project
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.
Once the project has been imported, you should modify the project's details to match your mod's details:
gradle.properties
file to change the maven_group
and archive_base_name
properties to match your mod's details.fabric.mod.json
file to change the id
, name
, and description
properties to match your mod's details.You can obviously change the package name and the mod's main class to match your mod's details.