MCreator's Code Editor for Minecraft Mods

Code editor - IDE

When you open the code of a file, you will see something like this. Now let's see the usage of everything.

First look

1. A first thing you can now see is a new tab named "Code" between "File" and "Workspace". If you click on it, you will be able to see a few actions you can do. You can search and replace something in the code, save, load, and reformat the code. To execute these actions, you can use the shortcuts displayed on the right.

2. A second thing you can see on the page is the list at the right, showing all methods and sections in the file. You can use them to go directly to a part of the code, by clicking on a line.

3. The last thing you can have in the editor, is the list at the left of the picture. To see this list, you need to click on an arrow at the left of "WORKSPACE". This list shows you all files inside your workspace. The Source folder is the folder containing all packages and .java files of your mod. The Resources folder is the folder containing all asset and data files like textures, structures, and JSON files. The Sounds, Structures, and Models folders contain the custom sounds, structures, and models, you have imported. Finally, you have your Minecraft folder, and the external libraries.

Locking Minecraft mod files

Each time you will save the code in the code editor, you will have the following window. If you lock the code of the element, you won't be able to use the editor. You will always be inside the code editor, until you unlock the code.

Locking the code

However, if you keep the code unlocked, the next time you will save your mod element in the normal editor, your code will be removed. So, you will have to re-write your code.

Tools of the code editor

In this section, we'll go over the tools you can use with shortcut

  • Find (Crtl+ F) - opens up a search tool that searches through the code.
  • Replace (Ctrl + R) - opens up a search tool that searches for the first string through the code and replaces it with the second one.
  • Undo (Ctrl + Z) - undoes your last action.
  • Redo (Crtl +Y) - redoes your last undone action.
  • Reformat code only (Crtl + MAJ + W) - fixes tabulators and organizes class imports.
  • Reformat code and imports (Ctrl + W) - adds missing class imports and sorts them alphabetically.
  • Save (Ctrl + S) - saves changes.
  • Save and build (Ctrl + S, then Crtl + B) - saves changes and rebuilds the entire mod code.


Donate to MCreator

By donating to developers you can speed up development, as with more resources, we can dedicate more time to MCreator. It is a free project made by developers working on it in their free time.