Skip to content

Pack Compiling for 1.16.5

SnailPerson edited this page Mar 10, 2024 · 3 revisions

This guide will help you correctly compile your pack for version 1.16.5 and higher (since the mod loading system has changed).

Preparation

Before you start compiling the pack, you will first need the IDE, JDK, Git and Official Content Pack. I recommend using IntelliJ IDEA and JDK 8 by Eclipse Temurin. You can get them from the links below:

  • IDE (download the IDE for your OS, and also select Community Edition);
  • JDK 8 (download the JDK for your OS, CPU bit depth, and also choose a JDK distribution, not a JRE);
  • Official Content Pack;
  • Git;

Beginning

After you have installed everything, create any folder for the source codes (for example, the sources folder somewhere on drive C). Next, in this folder, click on the empty space, select Open Git Bash here from the context menu. Wait for the utility to load, and then enter the command in the console line: git clone https://github.com/DonBruce64/MTSOfficialPack. Wait for all files to be downloaded from the repository.

Now, you can finally launch the installed IDE. In the open IDE you will be prompted to create or select a project. You need to select a project. To do this, you simply select the path to your project (most likely, this will be the MTSOfficialPack folder). After you have opened the project, hover over the environment settings button and there click on the Project Structure... button. In the Project tab, you need only 2 fields: SDK and Language level. In the first, select the installed JDK (temurin-1.8), in the second, select number 8 from the list. Next, go to File | Settings | Build, Execution, Deployment | Build Tools | Gradle and make sure that your project's JDK is specified in the Gradle JVM (that is, temurin-1.8). After all these steps, wait until the IDE has completely installed all the necessary files and also configured the environment. You can monitor the process in the Build tab (located in the lower left panel).

In order to start compilation, you need to rename the folder located at the path MTSOfficialPack\src\main\java\PACK_ID. Now go to the ForgePackLoader.java file in the same folder (this is done in the IDE). Replace in lines package PACK_ID; and @Mod("PACK_ID") to your pack ID.

Compiling

To compile, go to the Gradle panel | MTSOfficialPack | Tasks | build | build. The compiled JAR file will be in the MTSOfficialPack\build\libs folder.

On Apple devices you can simply select your assets, META-INF, pack.mcmeta and [packname] files, compress them to a zip, and change .zip to .jar

Final

Open the compiled JAR file and delete the assets folder from there. Next, copy the assets folder from your pack to the JAR file. Go to the META-INF folder and open the mods.toml file. Replace whatever you need, but it is enough to replace only the modId with your pack ID.

After all these actions, your pack is ready to work on 1.16.5.

Clone this wiki locally