Mods/Creating mods/Recompiling and reobfuscating

From Minecraft Wiki
Jump to: navigation, search
The contents of this page are not supported by Mojang AB, the Minecraft Wiki, or the Minecraft Forums.
Caution is advised when performing tasks utilizing system functions, such as the use of command line utilities. Please follow these instructions carefully, or your system may be damaged.

Once you have completed your mod, you need to turn it into .class files so that players can install your mod and play it. To do this, you must recompile the code, and then reobfuscate it. This process is very simple, yet is different based on your operating system. Instructions will be provided to Windows, Mac, and Linux users.

  1. To begin, you will first need to close Eclipse if you have it open. Then, direct yourself to your mod's MCP files. The folder should contain several other folders, such as "jars", "src", and several others. Stay in this folder.

Windows[edit]

Windows Open "recompile.bat". The process may take a few minutes, or may complete much quicker. Wait for the window to say "Press any key to continue..." and then close the window. Do not close the window before this message appears, even if it seems to be done.

MacOS & Linux[edit]

macOS Open Terminal. Type cd . Include the space! Now drag your mod's folder into Terminal and press Enter. Then type, bash recompile.sh. The process may take a few minutes, or may complete much quicker. Wait for the window to say "Press any key to continue..." and then close the window. Do not close the window before this message appears, even if it seems to be done.

Linux
Linux NOTE: There are two ways to open the files on Linux. The easier method is described here. Right-click on "recompile.sh". Click on "Properties". Click on the "Permissions" tab. Tick the "Allow executing file as program" checkbox. Click "Close". Then, open "recompile.sh" like any other file. A Terminal window should appear. The process may take a few minutes, or may complete much quicker. Wait for the window to say "Press any key to continue..." and then close the window. Do not close the window before this message appears, even if it seems to be done.

  1. Once you have finished recompiling your mod, you will need to reobfuscate. Follow the instructions above for your system, yet instead of opening "recompile.bat"/"recompile.sh", open "reobfuscate.bat"/"reobfuscate.sh".
  2. Once reobfuscation is completed, open the "reobf" folder located in your mod's folder. Open the "minecraft" folder. All .class files you edited and/or created should be there. To play your mod, you will need to install it. Your mod also requires installing ModLoader, so install that first, and then your mod. Instructions can be found here.