tutorial:setup
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
tutorial:setup [2021/09/17 18:34] – fix typo siglong | tutorial:setup [2023/05/22 12:03] – modmuss50 | ||
---|---|---|---|
Line 2: | Line 2: | ||
===== Prerequisites ===== | ===== Prerequisites ===== | ||
- | * A Java Development Kit (JDK) for Java 16 (recommended) or newer. Visit [[https://adoptopenjdk.net/]] for installers. | + | * A Java Development Kit (JDK) for Java 17 (recommended) or newer. Visit [[https://adoptium.net/releases.html]] for installers. |
* If you are professional, | * If you are professional, | ||
* Any Java IDE, for example [[https:// | * Any Java IDE, for example [[https:// | ||
* If you are not familiar with any of these, we recommend to use Intellij IDEA as that is what most people choose for modding. | * If you are not familiar with any of these, we recommend to use Intellij IDEA as that is what most people choose for modding. | ||
- | ==== Minecraft Development (mcdev) IntelliJ IDEA Plugin | + | ===== Mod Setup ===== |
- | If you are using IntelliJ IDEA you can use the [[https:// | + | |
- | This plugin adds support for automatically generating Fabric projects as well as some mixin related features like inspections, | + | |
- | generating accessors/ | + | |
- | You can install it using IntelliJ' | + | |
- | then clicking the Marketplace tab and searching for Minecraft. | + | |
- | + | ||
- | ===== Mod Startup | + | |
- | There are two main ways to make a new mod for Minecraft based on Fabric. | + | |
- | You can either manually download fabric-example-mod and setup by yourself, or use automatic tools for you. | + | |
- | + | ||
- | **NOTE:** The template in the mcdev plugin blindly uses the latest unstable version of the loom. Use with caution. | + | |
==== Manual Steps ==== | ==== Manual Steps ==== | ||
- | - Copy the starting files from [[https:// | + | - Copy the starting files from [[https:// |
- Edit '' | - Edit '' | ||
* Make sure to set '' | * Make sure to set '' | ||
- | * Make sure to update the versions of Minecraft, the mappings, the loader and the loom - all of which can be queried through https:// | + | * Make sure to update the versions of Minecraft, the mappings, the loader and the loom - all of which can be queried through https:// |
* Add any other dependencies you plan to use in '' | * Add any other dependencies you plan to use in '' | ||
- Import the build.gradle file to your IDE. You may refer to the next section for specific IDE's. | - Import the build.gradle file to your IDE. You may refer to the next section for specific IDE's. | ||
- Happy modding! | - Happy modding! | ||
- | If you are unable to use the mc plugin or the fabric-example-mod, | + | === Fabric Mod ID Change === |
- | - Download latest release | + | As of Minecraft 1.19.2, Fabric API's mod ID has changed from '' |
- | - Make a new directory, then run a command shell there and type '' | + | |
- | | + | |
- | - You're now done, just open the project folder with in your IDE. | + | |
=== IntelliJ IDEA === | === IntelliJ IDEA === | ||
Line 46: | Line 31: | ||
- Open the ' | - Open the ' | ||
- Change the 'Build and run using' and 'Run tests using' fields to ' | - Change the 'Build and run using' and 'Run tests using' fields to ' | ||
- | - Go to File -> Project Structure -> Project and set ' | ||
Unfortunately, | Unfortunately, | ||
**NOTE:** Don't run the '' | **NOTE:** Don't run the '' | ||
+ | |||
+ | If you are using IntelliJ IDEA you can use the [[https:// | ||
+ | This plugin adds support for automatically generating Fabric projects as well as some mixin related features like inspections, | ||
+ | generating accessors/ | ||
+ | You can install it using IntelliJ' | ||
+ | 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. | ||
=== Eclipse === | === Eclipse === | ||
Line 64: | Line 56: | ||
To generate the Minecraft source. run the '' | To generate the Minecraft source. run the '' | ||
- | If your IDE doesn' | + | If your IDE doesn' |
It can take a while depending on your computer power. | It can take a while depending on your computer power. | ||
You may need to refresh gradle after running the task. | You may need to refresh gradle after running the task. | ||
Line 76: | Line 68: | ||
* While Fabric API is not strictly necessary for developing mods, its primary goal is to provide cross-compatibility and hooks where the game engine does not, and as such it is highly recommended! Even some of the tutorials on the wiki implicitly require Fabric API. | * While Fabric API is not strictly necessary for developing mods, its primary goal is to provide cross-compatibility and hooks where the game engine does not, and as such it is highly recommended! Even some of the tutorials on the wiki implicitly require Fabric API. | ||
* Occasionally, | * Occasionally, | ||
+ | * Keep up with the latest Loom version (which is defined in '' | ||
+ | * Keep up with the latest Gradle version, which can be defined in '' | ||
+ | * Different Gradle versions require different Java versions. Usually latest Gradle supports the recommended Java version 17. | ||
+ | * If you're developing mods for old version Minecraft, besides changing '' | ||
* Don't hesitate to ask questions! We're here to help you and work with you to make your dream mod a reality. | * Don't hesitate to ask questions! We're here to help you and work with you to make your dream mod a reality. | ||
Line 83: | Line 79: | ||
Sometimes, when importing the Gradle project into an IDE, the assets might not download correctly. In this case, run the '' | Sometimes, when importing the Gradle project into an IDE, the assets might not download correctly. In this case, run the '' | ||
+ | ==== java.lang.ClassNotFoundException: | ||
+ | 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 " | ||
+ | ===== What's Next? ===== | ||
+ | Create your first [[tutorial: |
tutorial/setup.txt · Last modified: 2024/04/15 00:35 by solidblock