🇬🇧 English
🇬🇧 English
Appearance
🇬🇧 English
🇬🇧 English
Appearance
This page is written for version:
1.21.8
The Fabric toolchain lets you access the Minecraft source code by generating it locally, and you can use IntelliJ IDEA to conveniently navigate through it. To generate sources, you need to run the genSources
Gradle task.
This can be done from the Gradle View like above, by running the genSources
task in Tasks > fabric
:
Or you can also run the command from the terminal:
./gradlew genSources
IntelliJ requires one additional step of attaching generated sources to the project.
To do this, open any Minecraft class. You can Ctrl + Click to go to the definition, which opens the class or use "Search everywhere" to open a class.
Lets open MinecraftServer.class
as an example. You should now see a blue banner on the top with a "Choose Sources..." link.
Click on "Choose Sources..." to open a file selector dialog. This dialog will open at the correct location of generated sources by default.
Select the file that ends with -sources
and press Open to confirm the selection.
If the correct file is open, you should now be able to see Javadoc comments as well as have the ability to search for references.