MCreator is an excellent tool for modding Minecraft without deep programming knowledge, but for developers who want to dive into custom code and advanced features, IntelliJ IDEA can be a powerful integrated development environment (IDE) to work on MCreator workspaces. This guide will walk you through setting up your MCreator workspace in IntelliJ IDEA, streamlining your workflow, and maximizing productivity.
Gradle project
Every workspace that you create with MCreator is at the same time also a Gradle project, meaning it can be opened with any IDE that supports Gradle. MCreator maintains a compatible file structure so both external IDEs and MCreator can be used at the same time.
Import the project into IntelliJ IDEA
To start working with the MCreator workspace, you'll need to import the generated Gradle project into IntelliJ.
- Open IntelliJ IDEA.
- Import Project:
- On the welcome screen, click on Open
- Navigate to your MCreator workspace folder and select it
- Gradle Sync: Once the project is imported, IntelliJ will automatically detect the
build.gradle
file and start syncing your project dependencies. This may take some time depending on your system and internet speed.
Working with MCreator Code in IntelliJ
Once your project is set up, you can start working on the codebase directly from IntelliJ.
- Exploring the Code:
- The code generated by MCreator is located under the
src
directory. - Explore your mod elements (blocks, items, events, etc.), and you can now write custom code or modify the auto-generated code from MCreator (if you do so, make sure to lock the code of the mod elements that you are changing).
- The code generated by MCreator is located under the
- Writing Custom Code:
- IntelliJ provides powerful tools for code completion, refactoring, and debugging. You can use this to improve or customize your mod beyond the options available in MCreator.
- Make sure to test any code changes by running the Minecraft client or server from the configurations you set up.
You can build and export the project from either MCreator or IntelliJ IDEA.
Autogenerated code
If you want to modify the code generated by MCreator, make sure to lock the code of the mod elements that you modify. Otherwise, MCreator will override your changes.
If you want to modify the base mod files that reference all mod elements of a certain type or main mod file, make sure to do so in the user code blocks that are marked with starting and ending comments in the code.
If you want to add custom Java files to the project, make sure to do them outside the mod package specified in Workspace settings in MCreator, as otherwise MCreator may delete them during workspace code regeneration.