Skip to main content

Prerequisites

Before opening the project, make sure you have the following installed:
  • Oracle JDK 21 — specifically Oracle JDK 21 is required (not OpenJDK)
  • IntelliJ IDEA Community Edition or higher (recommended IDE)
General Mechanics requires Oracle JDK 21 specifically. OpenJDK is not supported.

Required IDE plugins

Install these plugins in IntelliJ IDEA before importing the project:
PluginRequiredLink
Project LombokRequiredplugins.jetbrains.com/plugin/6317-lombok
Minecraft DevelopmentRecommendedplugins.jetbrains.com/plugin/8327-minecraft-development
To install a plugin: open Settings → Plugins, search by name, and click Install.

Setup

1

Install Oracle JDK 21

Download and install Oracle JDK 21 from oracle.com/java/technologies/downloads.Verify the installation:
java -version
The output should show java version "21".
2

Install the Lombok plugin

In IntelliJ IDEA, open Settings → Plugins, search for Lombok, and install the Project Lombok plugin.Restart the IDE when prompted.
3

Enable annotation processing

Lombok requires annotation processing to be enabled. In IntelliJ IDEA:
  1. Open Settings → Build, Execution, Deployment → Compiler → Annotation Processors
  2. Check Enable annotation processing
  3. Click OK
4

Install the Minecraft Development plugin (optional)

In Settings → Plugins, search for Minecraft Development and install it. This plugin provides Minecraft-specific code assistance and inspections.
5

Import the project

Open IntelliJ IDEA and select Open. Navigate to the project root and select the build.gradle file. When prompted, choose Open as Project.Gradle will sync and download all dependencies automatically.
6

Set the Gradle JVM to Java 21

After importing, verify that Gradle is using Java 21:
  1. Open Settings → Build, Execution, Deployment → Build Tools → Gradle
  2. Under Gradle JVM, select your Oracle JDK 21 installation
  3. Click OK and let Gradle re-sync if prompted
7

Run the game from the IDE

After the Gradle sync completes, IntelliJ IDEA will have the following run configurations available:
ConfigurationDescription
runClientLaunches the Minecraft client with the mod loaded
runServerLaunches a headless Minecraft server (--nogui)
runGameTestServerRuns all registered game tests, then exits
runDataRuns data generation, outputting to src/generated/resources/
Select a configuration from the run dropdown in the toolbar and click Run.

Source and Javadoc downloads

The project is configured to automatically download sources and Javadoc jars for all dependencies. This is handled by the idea block in build.gradle:
idea {
    module {
        downloadSources = true
        downloadJavadoc = true
    }
}
This means you can navigate into dependency source code and view Javadoc inline inside IntelliJ IDEA without any additional configuration.

Build docs developers (and LLMs) love