A mod template for LunarCore with Fabric Loader.
- Source code injection with Mixin (and MixinExtras)
- Run/Debug your mod with a single task
Requires JDK 17
- Click on the to create a new repo starting from this template.
- Clone your repo and open it in your IDE (IntelliJ IDEA with Minecraft Dev plugin is recommended).
- Run the gradle task named
runServer
to generate server files torun
dir. (You can stop the task after LunarCore has been started.) - Put LunarCore resources into the
run
dir. - Just write some code.
- Run
runServer
to test your mod.
You can just run the server in run
dir by java @args.txt
but with this steps you can run the server without setting up development environment.
Requires JDK 17
- Create a empty folder.
- Put LunarCore.jar, GameProvider.jar and libraries for it. (GameProvider.jar and its libraries can be downloaded from uploaded artifacts on LunarCoreGameProvider GitHub Actions.)
- Put resources for LunarCore into the same dir.
- Run
java @args.txt
.
Fabric Loader is a lightweight mod loader usually used for Minecraft which provide much useful features for creating mods. Fabric Loader recognizes a jar in the mods
folder with a fabric.mod.json as a mod and loads it at startup.
References
Mixin is a framework for Java which makes it easy to inject/hook into the runtime classloading with ASM. Mixin's config is usually named *.mixins.json
(examplemod.mixins.json for this template) and specified by fabric.mod.json with Fabric Loader.
MixinExtras is a plugin of Mixin which provides many useful injectors, and got bundled in Fabric Loader 0.15 or later.
References