2 | Setting up the workspace

By far one of the most time consuming parts of this tutorial.

Creating a new Project

Open IntelliJ and click "New Project". Follow the instructions posted below.

Name it as your client name, then click finish.

Setting up our build.gradle

Open the build.gradle inside your project, then paste the build.gradle from here into the one in your project.

You get to decide the following things:

  • Project Name:

    • The name of your client.

  • Group Name:

    • This is a top level layout of your package structure, please read here if you do not understand what it is

Now just replace all the:

GROUP_NAME 's inside the build.gradle with your Group Name you decided earlier.

BASE_NAME 's inside the build.gradle with your Project Name.

PROJECT_NAME 's inside your build.gradle with your Client Name.

This step can be completed very quickly using Intellij's find and replace command.

CMD + R on Mac, CTRL + R on Windows

An example build.gradle is available here.

Quick Gradle Edit

Open the file gradle-wrapper.properties

project
    -> gradle
        -> wrapper
            -> gradle-wrapper.properties <-- Open this file

It should look roughly like this

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

Where the line distribution is, change the distributionUrl so the version is 4.7, like so:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

Then click the Load Gradle Changes button on the top right.

This will take a bit of time, so just wait for it to download and install gradle

Setting up the Basics

Create the file mixins.PROJECT_NAME.json, with the word PROJECT_NAME replaced with the project name that you decided on earlier, in the folder src/main/resources

project
    -> src
        -> main
            -> resources
                -> mixins.PROJECT_NAME.json <-- Create this file

From here on out, you should replace all instances of GROUP_NAME with your group name, and all instances of PROJECT_NAME with your project name.

Inside mixins.PROJECT_NAME.json add the follow json

{
  "required": true,
  "compatibilityLevel": "JAVA_8",
  "verbose": true,
  "package": "GROUP_NAME.PROJECT_NAME.mixins",
  "refmap": "mixins.PROJECT_NAME.refmap.json",
  "mixins": []
}

For example if my GROUP_NAME was me.ddozzi and my PROJECT_NAME was ExampleClient this would be my json:

{
  "required": true,
  "compatibilityLevel": "JAVA_8",
  "verbose": true,
  "package": "me.ddozzi.exampleclient.mixins",
  "refmap": "mixins.exampleclient.refmap.json",
  "mixins": []
}

Final Touches

Creating the Skeleton

In the java folder outlined below, create a folder structure separated by dots, with your project name, and a mixins folder

project
    -> src
        -> java <-- Go here

For example, if my group ID was me.ddozzi, and my project name was ExampleClient, I would create a folder structure like so

project
    -> src
        -> java
            -> me
                -> ddozzi
                    -> ExampleClient
                        -> mixins

Configuring the Project:

Run the Task :setupDecompWorkspace which can be found here:

This proccess will take some time.

Next, run the task :genIntellijRuns, this should be very quick.

Click on the dropdown next to the run icon, and select Edit Configurations

You'll see that Minecraft Client is errored, but that's totally normal. Once you're in the Edit Configurations Menu, change the -cp to PROJECT_NAME.main , click apply, then exit.

Last updated

Was this helpful?