Environment Setup
I. Prerequisites
- Install
IntelliJ IDEA - Install
IntelliJ IDEAplugins:
II. Create Repository from Addon Template
- Open the Addon Template Repository, click
Use this templatein the top right corner, and selectCreate a new repository; - Enter the relevant information for your addon mod on the new page, such as name and description. We recommend naming it in the format
AnvilCraft-${AddonName}, for exampleAnvilCraft-Demo; - Clone the repository to your local machine;
- Please search for instructions on how to do this
III. Build Environment
- Open the cloned repository directory with
IntelliJ IDEA - Open
gradle.propertiesand modify it with your mod information:maven_group- Maven group
- Usually the main package name
- Recommended to use
dev.anvilcraft.${addonId} - Example:
dev.anvilcraft.demo
mod_id- Mod ID
- Recommended to use
anvilcraft_addonId - Example:
anvilcraft_demo
mod_name- Mod name
- Recommended to use
AnvilCraft-${AddonName} - Example:
AnvilCraft-Demo
mod_description- Mod description
mod_license- Mod open source license, recommended to use
LGPL-3.0 license - If you directly include AnvilCraft source code or modified AnvilCraft source code, this must be
LGPL-3.0 license
- Mod open source license, recommended to use
mod_version- Mod version number
mod_authors- Mod authors
- Modify dependency information in
gradle/libs.versions.toml:versions.anvilCraft- AnvilCraft version number
- You can check the latest version at this link
- Modify the package name in the following paths to your own package name:
src/main/java- Example:
dev.anvilcraft.addon.demo
- Modify
MOD_IDinAnvilCraftAddonTemplate.javato your own mod id- Example:
anvilcraft_demo
- Example:
- Rename
AnvilCraftAddonTemplate.javato your own MOD class name- Example:
AnvilCraftDemo.java
- Example:
- Rename
AnvilCraftAddonTemplateClient.javato your own MOD class name- Example:
AnvilCraftDemoClient.java
- Example:
- Rename
src/main/resources/anvilcraft_addon_template.mixins.jsonto your own MOD mixins json name- Example:
src/main/resources/anvilcraft_demo.mixins.json
- Example:
- Rename
src/main/resources/assets/anvilcraft_addon_templateto your own MOD resource pack namespace- Example:
src/main/resources/assets/anvilcraft_demo
- Example:
- Reload Gradle scripts
- Run the
Tasks -> loom -> dataCopytask - Run the
Tasks -> loom -> genSourcestask - Reload Gradle scripts
- Your development environment is now fully ready
IV. Verify Environment
Run the
Tasks -> neoforge runs -> runClienttask to test the environment- If Minecraft starts normally and you can see your mod, the environment is configured successfully
Check log output
- Confirm there are no error messages
- Verify that the mod is loaded correctly
V. Common Issues and Solutions
Gradle Sync Failed
- Check your network connection and ensure you can access Maven repositories
- Try using the
./gradlew --refresh-dependenciescommand to refresh dependencies
Cannot Find AnvilCraft Dependency
- Check the latest version number in the Maven Repository
- Ensure the version number matches your Minecraft version
IDEA Cannot Recognize Project
- Delete the
.ideafolder and*.imlfiles, then re-import the project - Ensure you have selected the correct JDK version (Java 21)
- Delete the