Skip to content
/ ModTemplate Public template

A mod template for LunarCore with FabricLoader.

Notifications You must be signed in to change notification settings

LunarCore-Mods/ModTemplate

Repository files navigation

LunarCoreModTemplate

A mod template for LunarCore with Fabric Loader.

Features

Get Started

Requires JDK 17

  1. Click on the Use this template to create a new repo starting from this template.
  2. Clone your repo and open it in your IDE (IntelliJ IDEA with Minecraft Dev plugin is recommended).
  3. Run the gradle task named runServer to generate server files to run dir. (You can stop the task after LunarCore has been started.)
  4. Put LunarCore resources into the run dir.
  5. Just write some code.
  6. Run runServer to test your mod.

Running in Production Environment

You can just run the server in run dir by java "@args.txt" but with these steps you can run the server without setting up development environment.

Requires Java 17

  1. Setup standard LunarCore by following these steps.
  2. Make sure that LunarCore server starts up properly.
  3. Download build.zip from LunarCoreGameProvider GitHub Actions or directly download here.
  4. Unzip the build.zip and put the files, into your LunarCore folder.
  5. Run java "@args.txt" instead of java -jar LunarCore.jar to launch your server with mods.

What is Fabric Loader?

Fabric Loader is a lightweight mod loader, usually used for Minecraft. Fabric Loader provides much useful features for creating mods. It recognizes a jar in the mods folder with a fabric.mod.json as a mod and loads it at startup.

References

And what is Mixin?

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

About access-widener

access-widener is a tool to widen access modifiers of classes, fields, and methods. You may need to use a private (or protected) class, field, or method from your dependency. In that case, you can use access-widener to access it by modifying the access modifier to public.

This can be done by Mixin, but access-widener is much easier to use and more efficient, and provides more clean code.

Tip

With Minecraft Dev plugin, you can easily get the access widener entry. Write code which accesses to the private declaration. Then, press Alt + Enter and just select Copy AW entry.

References

About

A mod template for LunarCore with FabricLoader.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages