Read the documentation below to know how to initialize your mod from this template. It's fast as you just have to search and replace text.
Don't lose time setting up your project, everything is ready is this template, including:
Versions:
1.20.1
8.1.1
1.9.10
More details in Versions.ktIt should work with other IDE, it only depends on gradle, I did not test it
Load gradle project, it may crash because of SDK errors, in that case:
{license}
: The mod license. Example: GNU-LGPL-3.0
{githubUser}
: The user that owns the github repo. Example: lilmods
{githubRepo}
: The name of the github repo. Example: kotlin-minecraft-mod-template
{author}
: The author of the mod. It will be in the mod description (forge & fabric)modid
(and not modId
!!!): The mod id. Has to be unique across mc mods. Make sure to also rename modid.mixins.jsoncom.example.modid
: The mod package. Has to be unique across mc mods to prevent conflits on runtime. Make sure to also rename filenames.ModName
: The mod name. Make sure to also rename filenames.ModDescription
: The mod descriptionNow you can reload gradle project. You should be able to build and run clients. If it's not the case, you renamed something wrong. You can see an example here: https://github.com/lilmods/aim-assistance/commit/44743e66f04cde44ad8ccb9490b680069f874c1d.
If the build below says "passing" and it does not work in your environment, it means that you did something wrong because the CI built the project properly.
If you have an issue, it could be because of:
./gradlew --stop
Files > Invalidate caches & restart
~/.gradle/caches
(you will need to re-download everything)All the versions of libraries are stored in Versions.kt. The file is documented for you to know how to bump versions.
Put a tag on any branch following this format:
1.0.0-MC1.19.x-fabric
1.0.0-MC1.19.x-forge
The CD workflows are defined in .github/workflows folder. The release will then be "deployed" on github. In the releases tab, you will see your new version with a changelog that contains everything you did put on CHANGELOG-forge.md (for forge) and CHANGELOG-fabric.md (for fabric).
You can see example of releases published from this repo here https://github.com/lilmods/kotlin-minecraft-mod-template/releases
If you have common code between forge and fabric, you can put it in the common
module (you can rename it if you want).
The code will then be packaged in the .jar
produced by fabric and forge.
It forced you to follow some conventions. In the root build.gradle.kts, ktlint
is imported. You
can remove it if you want, in that case, you have to remove the step in the CI workflows
.github/workflows. There is an IntelliJ plugin to help you. You also can customize the ktlint
configuration by looking on their official documentation.
Everytime the CI runs and succeed, produced artefacts are stored in the workflow run summary. For example, as you can see in https://github.com/lilmods/kotlin-minecraft-mod-template/actions/runs/5111050925, there is an "Artifacts" block. You can click on it to download the produced .jar files.
This project uses Kotlin. However, mixins does not work with Kotlin for now, so it's written in Java. There are some
examples. The template uses modmenu
& cloth-config
to manage the mod settings. Everything is ready.
Run client: execute runClient
gradle task.
The template uses cloth-config
to manage the mod settings. Everything is ready.
Run client: execute runClient
gradle task
You can delete everything in the readme from this line, you are ready to go, have fun :)