Welcome to the 1.12.2 Forge wiki!
Click on the sidebar links to start reading the wiki content.
The order in which this wiki should be read is from the top sidebar button to the bottom sidebar button.
Useful links
Fixing Forge for 1.12.2 in 2023: https://fexcraft.net/wiki/mod/forge/mdk-1.12-fix
Official Forge documentation for versions 1.12.x: https://docs.minecraftforge.net/en/1.12.x/
- Please frequently use these docs as a reference when making your mods.
Minecraft Assets Explorer - https://mcasset.cloud/
Setting up the development environment
Notes before you continue:
(NOTE FROM https://github.com/UEMxMDE): Much of the information on this page is already mentioned on the official 1.12.x Forge docs (https://docs.minecraftforge.net/en/1.12.x/) but when I was first learning how to set up modding for 1.12.2 back in early 2024 I ran into some issues, so this wiki page will contain a mix of steps that worked for me and steps that are already in the 1.12.x Forge docs.
(NOTE FROM https://github.com/UEMxMDE): This tutorial was made based off of my experience with the Forge MDK version 14.23.5.2860 for 1.12.2 because that was the latest version available back when I was first learning to make Minecraft mods in early 2024. The current latest version as of me typing this (which is February 10, 2026) is 14.23.5.2864, so if anything in the tutorial below does not function properly please create a new issue in the repository for this website here: https://github.com/wikiformoddinglegacyminecraftjava/wikiformoddinglegacyminecraftjava.github.io/issues
Software to download
Java JDK 8u401 - https://gist.github.com/wavezhang/ba8425f24a968ec9b2a8619d7c2d86a6?permalink_comment_id=4888806
- Unfortunately, the official website to download older JDKs requires an Oracle account to download them, so unless you already have an Oracle account you need to visit the above gist.github.com URL to find direct download URLs from the community for Java JDK 8u401.
- The download URL in the above gist.github.com URL for JDK 8u401 posted by DenKaGamer has been verified by this wiki's owner (https://github.com/UEMxMDEDE) to be safe to download and install for Windows.
- The other versions of the JDK in the above gist.github.com URL may also work so if you are running into trouble with JDK 8u401, consider using another Java 8 JDK version. This is especially true if you are not planning to use a Windows environment to develop mods (e.g. if you plan on using Linux or macOS instead).
In the above gist.github.com URL, you can click on "Load earlier comments" to see more download options for a Java 8 JDK that may be more suited to you. Make sure you are only using a Java 8 JDK instead of Java 17 JDK, 21 JDK, etc.
IntelliJ IDEA - https://www.jetbrains.com/idea/download/
- This is where you will be typing and running your Java code. Don't worry about any free trial expiring, because even if it expires, you will still have access to everything you will need to develop mods and much more anyway.
Latest Forge MDK for 1.12.2 - https://files.minecraftforge.net/net/minecraftforge/forge/index_1.12.2.html
Setting up Java JDK 8u401
-
Install Java JDK 8u401
-
. . .
Setting up JAVA_HOME (MAY NOT BE NEEDED, NEEDS MORE TESTING)
This tutorial only applies to Windows users.
-
In the search area of the task bar, type "advanced system settings"
-
Click on "View advanced system settings"
-
Click on "Environment Variables..."
-
Click on the "New..." button under the "User variables for " area
-
Set "JAVA_HOME" as the variable name
-
Set the directory of your Java 8 JDK installation as the variable value (for example, "C:\Program Files\Java\jdk-1.8")
-
Click "OK" to close the "New User Variable" window
-
Click on the "Path" variable under the "System variables" area
-
Click on the "Edit..." button under the "System variables" area
-
Click on the "New" button
-
In the newly created text box, type the exact path from step 5, but add "\bin" at the end of the path (for example, "C:\Program Files\Java\jdk-1.8\bin")
-
Click "OK" to close the "Edit environment variable" window
-
Click "OK" to close the "Environment Variables" window
-
Click "OK" to close the "System Properties" window
Setting up IntelliJ IDEA
-
Install IntelliJ IDEA
-
. . .
Setting up the Forge MDK
-
IMPORTANT: Create a dedicated folder containing all of your mods. This folder is where you will be doing all of your mod development. The tutorial starting from now will take place entirely in this folder unless otherwise specified.
-
Since you have already downloaded the latest Forge MDK for 1.12.2, move the MDK zip file to your dedicated mod development folder.
-
Unzip the MDK file into your mod development folder and rename the unzipped folder to the name of your mod. If you are following this entire setup for the first time, then for the sake of this tutorial it is recommended to rename the folder to "tutorial_mod" until you are able to make your own mod by generalizing this tutorial to your needs.
-
Open IntelliJ IDEA. If you are opening it for the first time you should see the "Welcome to IntelliJ IDEA" window along with an empty list of all your IntelliJ IDEA projects.
-
Click on the settings button and click on "Settings"
-
Search for "Importing" on the search bar, and in the "Importing" section look for "JDK for Importer:", then select "Use JAVA_HOME (Path: C:\Program Files\Java\jdk-1.8)"
-
The path may vary depending on where you installed your JDK, but reguardless of what path you choose it should still show up in the "Use JAVA_HOME" option.
-
Click on "OK" to close the Settings window
-
Open the unzippped MDK (tutorial_mod) in IntelliJ IDEA
-
In the "Welcome to IntelliJ IDEA" window, click on "Open"
-
Navigate to the directory of tutorial_mod (e.g. C:\. . .\<your_minecraft_mods_folder>\tutorial_mod)
-
Click on "Select Folder"
-
You may get a dialogue box that says "Trust and Open Project 'tutorial_mod'?". Enable "Trust all projects in '<your_minecraft_mods_folder>'" and click "Trust Project"
-
Once you clicked on "Trust Project", the tutorial_mod project will open. You can track the loading progress by checking the loading bar in the bottom-right corner of the window and waiting until it finishes loading.
-
Set the IntelliJ JDK for tutorial_mod to JDK 8u401 (or whichever JDK you decided to download and install) (see the JAVA_HOME tutorial just in case)
-
Click on File -> Project Structure...
-
In the "SDK:" section, select "1.8 Oracle OpenJDK 1.8.0_401" (or whichever JDK you decided to download and install). If this is already selected then you can move to the next step.
-
In the "SDK:" section, you may see all the "Detected SDKs" on your computer. If the directory for your installed JDK shows up there (e.g. "C:\Program Files\Java\jdk-1.8 Oracle OpenJDK 1.8.0_401") then you can select that instead.
-
Click "OK" to close the "Project Structure" window
-
Double press the CTRL key to open the "Run Anything" window and type "gradlew genIntellijRuns" (for macOS and Linux: "./gradlew genIntellijRuns"), then press the ENTER key.
-
Wait for the command to finish executing. This may take a few minutes.
-
Once this is finished executing you will have 2 run configurations: "runClient" and "runServer". These will be used to launch the game with your modified code to test if your code works properly.
-
IMPORTANT: Double press CTRL key and type "gradlew runClient" (for macOS and Linux: "./gradlew runClient") to make sure that the client runs properly (and that it runs with sound), then press the ENTER key.
-
Wait for the command to finish executing. This may take a few minutes.
-
Once this is finished executing you can close Minecraft.
-
Open the "build.gradle" file inside of IntelliJ IDEA on the left side by double clicking on it. Then copy and paste this code onto the very bottom of "build.gradle", then press CTRL+S to save the change:
sourceSets {
main {
output.resourcesDir = output.classesDir
}
}
This code is meant to fix some texture bugs that may occur when debugging your mod.
-
In the "build.gradle" file there are 3 important variables you need to keep track of called "version", "group", and "archivesBaseName".
-
The "version" variable keeps track of your mod version. It's default value is 1.0 so leave it as it is for now. You should update this variable when you decide to release updates to your own mods.
-
The "group" variable is used when you build your mod. In this variable, replace "yourname" with your username and replace "modid" with "tutorialmod".
-
The "archivesBaseName" is the name of your mod's built jar file. In this variable, replace "modid" with "tutorialmod".
-
Press CTRL+S to save the changes.
-
From the top menu in IntelliJ IDEA, click on View -> Tool Windows -> Gradle. In the Gradle window, click on "Sync All Gradle Projects" (the button looks like a refresh button / 2 circular arrows pointing at each other) and wait for the process to finish.
-
IMPORTANT: You MUST do this every time you make and save any change to the "build.gradle" file or "settings.gradle" file.
Your entire mod folder structure
On the left side of your IntelliJ IDEA project you should see a list of folders and files. All of your mod's code and assets will be located in "src/main/java" and "src/main/resources".
There are still some things you need to do before you look at the final folder structure:
If you finished the "Setting up the Forge MDK" tutorial then you should see the following folder structure in "src/main/java":
src/main
└─ java
└─ com.example.examplemod
└─ ExampleMod.java
You should delete "com.example.examplemod" and "ExampleMod.java" before you begin developing your mod.
After that, right click on the "java" folder in IntelliJ IDEA and go to New -> Package. For the package name, type "yourname.modid" (you already set up "yourname" and "modid" earlier in this tutorial) and press the ENTER key. Your new folder structure should look like this:
src/main
└─ java
└─ yourname.modid <- You replaced "yourname" and "modid" in the "Setting up the Forge MDK" tutorial above
If you finished the "Setting up the Forge MDK" tutorial then you should see a file called "mcmod.info" in "src/main/resources". This file contains information of your mod that players will see in-game when they view your mod from the in-game Mods button. By default it should look like this:
[
{
"modid": "examplemod",
"name": "Example Mod",
"description": "Example placeholder mod.",
"version": "${version}",
"mcversion": "${mcversion}",
"url": "",
"updateUrl": "",
"authorList": ["ExampleDude"],
"credits": "The Forge and FML guys, for making this example",
"logoFile": "",
"screenshots": [],
"dependencies": []
}
]
See the official 1.12.2 Forge docs for more information about this file: https://docs.minecraftforge.net/en/1.12.x/gettingstarted/structuring/#the-mcmodinfo-file
If you finished the "Setting up the Forge MDK" tutorial then you should see a file called "pack.mcmeta" in "src/main/resources". By default it should look like the code below. If for some reason you don't see this file, then create the file in "src/main/resources". Then copy the below code into "pack.mcmeta" and press CTRL+S to save the file.
{
"pack": {
"description": "examplemod resources",
"pack_format": 3,
"_comment": "A pack_format of 3 should be used starting with Minecraft 1.11. All resources, including language files, should be lowercase (eg: en_us.lang). A pack_format of 2 will load your mod resources with LegacyV2Adapter, which requires language files to have uppercase letters (eg: en_US.lang)."
}
}
Final mod folder structure
The folder structure below is what your entire mod folder structure should look like
only if you plan to add any of the features in your mod that appear in the folder structure tree below.. If any folder/file below isn't in your project already, create it yourself,
but only if you absolutely need to.
src/main
├─ java
│ └─ yourname.modid
└─ resources
├─ assets
│ ├─ minecraft
│ │ └─ textures
│ │ └─ gui
│ │ └─ container
│ │ └─ creative_inventory
│ │ └─ tab_modid.png <- Tutorial for this is here: https://wikiformoddinglegacyminecraftjava.github.io/1.12.2_forge/#make_creative_tab
│ └─ modid <- You replaced "modid" in the "Setting up the Forge MDK" tutorial above, so you MUST do the same here or nothing in this folder will work properly.
│ ├─ blockstates
│ ├─ lang
│ │ ├─ en_us.lang <- Tutorial for this is here: https://wikiformoddinglegacyminecraftjava.github.io/1.12.2_forge/#language_files
│ │ └─ Other .lang files go in this folder.
│ ├─ models
│ │ ├─ block
│ │ └─ item
│ └─ textures
│ ├─ blocks
│ └─ items
├─ mcmod.info
└─ pack.mcmeta
Finalizing everything
-
Make sure that all the mods you develop are set up in your dedicated Minecraft mods folder.
-
How to run the client:
Method #1:
-
Double press CTRL key and type "gradlew runClient" (for macOS and Linux: "./gradlew runClient") to make sure that the client runs properly.
-
Wait for the command to finish executing.
Method #2: In IntelliJ IDEA, there is a button on the top right that looks like a green triangle. To the left of this button is the dropdown menu for your run configurations. Select the "runClient" run configuration on this menu and then click on the green triangle button (the green triangle button is the "Run" button).
-
How to run the server:
Method #1:
-
Double press CTRL key and type "gradlew runServer" (for macOS and Linux: "./gradlew runServer") to make sure that the client runs properly.
-
Wait for the command to finish executing.
Method #2: In IntelliJ IDEA, there is a button on the top right that looks like a green triangle. To the left of this button is the dropdown menu for your run configurations. Select the "runServer" run configuration on this menu and then click on the green triangle button (the green triangle button is the "Run" button).
-
How to build the mod jar:
-
Open the main class of your mod in IntelliJ IDEA and change the "VERSION" variable to your desired mod version.
-
In IntelliJ, double press CTRL key and type "gradlew build" (for macOS and Linux: "./gradlew build")
-
Wait for the command to finish executing.
-
Once the command is finished executing, you can find your mod jar file in "<your_mod_folder>\build\libs\[archivesBaseName]-[version].jar"
-
Move the mod jar file to the mods folder to test it. You can test it by putting the mod jar file here: "<your_mod_folder>\run\mods\[archivesBaseName]-[version].jar" or by putting the mod jar file in the mods folder of any Minecraft installation on your computer that has a Forge 1.12.2 profile installed on it.
-
If you are having any issues with this tutorial, there are 3 things you can do:
-
Create an issue in the repository here: https://github.com/wikiformoddinglegacyminecraftjava/wikiformoddinglegacyminecraftjava.github.io/issues
-
Read the forge docs: https://docs.minecraftforge.net/en/1.12.x/
-
Search the issue online to see if anyone else has these issues.
Common issues
-
Running the client works but there is no sound.
Fix:
-
Running the client on a PC with a 4k monitor makes the game appear on the bottom right corner of the screen instead of the middle of the screen.
Fix:
Key concepts
Items
Blocks
Events
Capabilities
Language files
Language files are ___.
This page will provide a tutorial on how to set up a .lang file for en_us. You can generalize this tutorial to your language.
Open your mod project in IntelliJ IDEA. Create a new file called "en_us.lang" in "src/main/resources/modid/lang"
Final result: "src/main/resources/modid/lang/en_us.lang"
The code below shows everything that is possible in language files.
# Items, Armor, Tools
item.item_name.name=Item name
# Fluids
fluid.fluid_name.name=Fluid name
# Blocks
tile.block_name.name=Block name
# Tabs
itemGroup.creativemodemodtab=Creative Mode Mod Tab
# Containers
container.container_name=Container name
# Entities
entity.entity_name.name=Entity name
# World Types
generator.world_type_name=World Type name
# Enchantments
enchantment.enchantment_name=Enchantment name
Here is an explanation of everything you see above:
# This is a comment.
# Example using an item
item.item_name.name=Item name
# "item" refers to what type of object this is
# "item_name" is the registry name/unlocalized name of your item. IMPORTANT: This does not apply to any creative mode inventory tabs that you may have set up for your mod.
# "Item name" is the name of your item that players will see in-game. You can put anything after the = sign.
# Example items
item.diamond_ingot.name=Diamond ingot
item.demonstration.name=Anything can go here
# Creative mode inventory tab
itemGroup.creativemodemodtab=Creative Mode Mod Tab
# "Creative Mode Mod Tab" is the name of the creative mode tab that you see in-game.
Making your mod's creative tab
Once you have your creative tab png file (tab_<modid_goes_here>.png) put it in this directory in your mod project folder: "src/main/resources/assets/minecraft/textures/gui/container/creative_inventory"
Final result: "src/main/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_<modid_goes_here>.png"
See the "Language Files" section for how to give your creative mode inventory tab a proper name.
Modding tips
How to have your mod send a message in chat: "playerIn.sendMessage(new TextComponentString("Insert text here"));"
Example usage:
. . .
@Override
public ItemStack methodName(. . ., EntityPlayer playerIn, . . .)
{
. . .
playerIn.sendMessage(new TextComponentString("Insert text here"));
. . .
}
. . .
If a mod is open source you can look at its code to see how it works and apply that knowledge to your mod.
How to load changes to your mod without restarting the client in IntelliJ IDEA (also known as Hotswapping):
Setup: In IntelliJ IDEA, go to Settings -> Keymap -> Search for "Compile and Reload Modified Files" -> Set up your desired keybind.
Loading code changes (CURRENTLY ONLY LOADS CHANGES MADE WITHIN JAVA METHOD BODIES):
1. Run your mod in Debug Mode using IntelliJ IDEA.
2. Make any changes to the code only if the changes are made inside of a method.
3. Once you make any changes to the code, you will see a small popup button on the top right side of your code in IntelliJ IDEA that says "Code changed: (bug icon with refresh icon)". You can either:
- Click on this button to load your new changes.
- Use the keybind you set up earlier to load your new changes.
4. Your changes are now applied to the currently running Minecraft client.
There are other IntelliJ IDEA plugins you can use to broaden what can be changed while the client is running (such as HotSwapAgent and HotSwapHelper) but tutorials on how to use those are a W.I.P.
Troubleshooting
Some older 1.12.2 Forge modding tutorials have a method called "setTranslationKey". In newer versions of the Forge MDK for 1.12.2, using this method name may cause errors. To fix these errors, replace "setTranslationKey" with "setUnlocalizedName".
Miscellaneous information
How to clear Gradle cache for IntelliJ IDEA: https://stackoverflow.com/questions/17561826/how-to-clean-project-cache-in-intellij-idea-like-eclipses-clean
- For Windows users, Gradle cache is stored here: "C:\Users\<username>\.gradle"
- You may want to do this if you run into issues that are caused by Gradle cache.
DELETE THIS SECTION ONCE THIS WIKI IS FINISHED
https://docs.fabricmc.net/develop/items/first-item
https://wiki.fabricmc.net/tutorial:shield
https://wiki.fabricmc.net/tutorial:terms
https://www.mcjty.eu/docs/intro