LICENSE
y el README.md
- ya que no son necesarias para tu mod, luego podrás hacerlas como prefieras.gradle.properties
:archives_base_name
y maven_group
a tu preferencia.https://fabricmc.net/develop/ - para poder ajustar las versiones como tú desees.
build.gradle
.
Desde Minecraft 1.19.2, el mod ID de la Fabric API cambio de fabric
a fabric-api
. Cuando estés haciendo un backport de 1.19.2 a versiones más nuevas, asegúrate de cambiar esta parte en la sección de depends
en tu fabric.mod.json
.
Si estas usando IntelliJ IDEA, por favor sigue los siguientes pasos:
Optional, but recommended: By default, IntelliJ delegates to Gradle to build the project. This is unnecessary for Fabric and causes longer build times and hotswapping related weirdness, among other problems. To make it use the builtin compiler:
Unfortunately, it is currently impossible to set an IDE-wide default for the 'Build and run using' and 'Run tests using' options, so these steps have to be repeated for every new project.
NOTE: Don't run the idea
gradle task. It is known to break development environment.
If you are using IntelliJ IDEA you can use the MinecraftDev plugin. This plugin adds support for automatically generating Fabric projects as well as some mixin related features like inspections, generating accessors/shadow fields, and copying Mixin Target References (JVM Descriptors). You can install it using IntelliJ's internal plugin browser by navigating to File → Settings → Plugins, then clicking the Marketplace tab and searching for Minecraft.
NOTE: The default template in the mcdev plugin blindly uses the latest unstable version of the loom. Use with caution.
If you are using Eclipse and you would like to have the IDE run configs you can run gradlew eclipse
. The project can then be imported as a normal (non-gradle) Eclipse project into your workspace using the 'File' - 'Import…' menu, then 'General' → 'Existing Projects into Workspace'.
If you are using VSCode, please follow these instructions.
Reading the Minecraft source is an essential part of modding. Unfortunately, we can't publish the Minecraft source because it violates the Minecraft EULA. You need to generate the Minecraft source yourself.
To generate the Minecraft source. run the genSources
gradle task.
If your IDE doesn't have gradle integration, run the following command in the terminal: gradlew genSources
(or ./gradlew genSources
on Linux/macOS).
It can take a while depending on your computer power.
You may need to refresh gradle after running the task.
See Reading the Minecraft source for how to read the source.
Try adding an item or a block. It's also a good idea to visit Applying changes without restarting Minecraft.
gradlew cleanloom
. Running gradlew --stop
can also help with a few rare issues.build.gradle
) and the Fabric Loader and Fabric API version for your mod (which is defined in build.gradle
or gradle.properties
). Latest version can be found in https://fabricmc.net/develop/. Even the old version Minecraft is supported by latest Loom and latest Fabric Loader.gradle/wrapper/gradle-wrapper.properties
. Old version Minecraft is supported by latest Gradle.gradle.properties
, you may also need to change the Java compatibility version in build.gradle
and the mixin config.
After running the genSources
gradle task in IntelliJ IDEA, check if the sources are attached properly. Open a Minecraft .class file and click on the “Choose Sources…” button on the top right of the screen. Select the jar with “-sources” at the end (e.g. .gradle\loom-cache\1.20.1\net.fabricmc.yarn.1_20_1.1.20.1+build.10-v2\minecraft-project-@-merged-named-sources.jar
)
Sometimes, when importing the Gradle project into an IDE, the assets might not download correctly. In this case, run the downloadAssets
task manually - either using IDE's built-in menu or by simply running gradlew downloadAssets
.
It seems to be a bug of Intellij IDEA since a recent update 2023.2. To fix, just delete the `.idea` folder entirely and then restart Intellij IDEA. The module will be reconstructed. You may need to specify Java versions again. If after restarting there is no run config, you can run `gradle ideaSyncTask` then check it again.
This may be because the project path contains non-ASCII characters that may cause incompatibility. Try move the project to paths without non-ASCII characters, or in the run config of “Minecraft Client” and “Minecraft Server”, set “Shorten Command Line” from “@argfile (Java 9+)” to “none”.
Create your first item.