This README will present the repository and how to use it.
This is an empty example mod to begin your own mod for Minecraft Java Edition using Minecraft Forge.
Java basic knowledge might help understanding and developing.
This project uses Gradle as its build automation tool, but no prior knowledge is required.
Before modding, make sure to setup your environment and personalize your proyect.
- Download Java Development Kit (JDK).
- Download an IDE: Visual Studio Code (or Eclipse or IntelliJ).
- Open the project from your IDE and download Java and Gradle extensions.
- Run
init
.
-
Replace this README by your own.
-
Modify
build.gradle
:-
Replace
version
,group
andarchivesBaseName
:version = '1.17.1-0.0.0' // recommended: 'minecraft_version-mod_version' group = 'net.yourname.modid' // recommended: 'net.yourname.modid' archivesBaseName = 'modid' // your modid
-
Replace
'examplemod'
by your'modid'
everywhere in the file. -
Run
genVSCodeRuns
(orgenEclipseRuns
orgenIntellijRuns
).
-
-
Modify
ExampleMod.java
:-
Refactor
ExampleMod
by yourModName
(or Rename ensuring file name changes too). -
Replace package by the
group
variable onbuild.gradle
, then moveModName.java
to the corresponding folder. Erase the empty foldercom.example.examplemod
. -
Replace your
modid
:public static final String MOD_ID = "modid";
-
-
Modify
mods.toml
:modId="modid"
.version="0.0.0"
.displayName="Mod Name"
.- Replace
credits
,authors
anddescription
. - Replace your
"modid"
on dependencies.
To declare a new release of your mod:
- Update your mod version in
build.gradle
andmods.toml
. - Run
genVSCodeRuns
(orgenEclipseRuns
orgenIntellijRuns
).
- Run
runClient
.
Minecraft is now running with your mod.
init
Gradle Task should be always run when opening your IDE to generate other Gradle Tasks.genVSCodeRuns
(orgenEclipseRuns
orgenIntellijRuns
) Gradle Task should be always run after modifyingbuild.gradle
to load changes.- Those tasks might be run by default by your IDE based on your configurations and extensions.