OUTATED, maybe I will update on one good day
Mossy is a template Fabric mod with some additional tweaks and code templates.
- Multi-version modding by Stonecutter plugin
- Easy player setting (uuid and nickname)
- Mod Menu Integration
- Fast YACL configuration for config screen (WIP)
- Mod Config template
- Versioned AWs and Mixins
- Fast
gradle.properties
, AWs and mixins generation for each version (for 1st point) - Split run folder for
runs/client
andruns/server
- Add support for multi-loaders
Basically, there are two ways:
- You can fork this template mod and make your mod
- You can integrate Mossy build system into your ready-made mod
But we will focus on the second way. In this way you will need to copy files stonecutter.gradle
, settings.gradle
, gradle.properties
, build.gradle
, LICENSE
, Mossy/src/main/resources/fabric.mod.json
and optional .gitignore
.
Then you will need to set up gradle.properties
.
Mod Properties
contains mod infoMain Dependencies
likeBuild Dependencies
, but not versionedBuild Dependencies
contains build properties, usually they versionedMulti-Versions
basically contains only one property, it's amulti_versions
, versions in it should be separated with space ' 'Additional Dependencies
contains additional depends, and you can add it easily:
# If you want to have it versioned, just write:
dep.MOD_ID=[VERSIONED]
# and add this property to every `Mossy/versions/[MINECRAFT VERSION]/gradle.properties`, if it's boring for you, just remove `gradle.properties` and reload gradle, each `gradle.properties` with last versions of depends will be generated.
#
# If you want to have static version, just write:
dep.MOD_ID=MOD_VERSION
#
# READ ME
# MOD_ID should be taken from Modrinth.
# `dep.` part is important.
After you can reload gradle and check all updates.
Also don't forgot to add your dependency in build.gradle
with this value
After reloading gradle, in your resources
folder you will find mixins
and aws
folders. In them, you will find generated mixins and AWs for each minecraft version. What version they are for is indicated in their name.
You might be surprised that all mixins have a .json5
extension instead of .json
. This is needed to support comments which are needed for the Stonecutter plugin. In build all mixins will be converted to .json
by j52j.
To understand how comments work, I recommend to check the Stonecutter docs.
AWs, in turn, have nothing unusual.
In Mossy, fabric.mod.json
has some features you should know, here are the main ones:
// ...
// Other code
"depends": {
"fabricloader": ">=${fabric_loader}",
"minecraft": ">=${minecraft}",
"java": ">=${java}",
"fabric-api": ">=${fabric_api}"
}, // needs because we have multi-versions
"accessWidener": "aws/${minecraft}.accesswidener", // needs to get path to AW for current minecraft version
"mixins": [
"mixins/${minecraft}-${modId}.mixins.json" // needs to get path to mixing config for current minecraft version
]
// Other code
// ...
Mossy/player/player.properties
is just a properties file, which uses to set up minecraft runs config with properties, to set up your nickname and uuid if they are present. If you want to add it, just create player
folder in your project, and file player.properties
with this content:
# Player properties
# If you don't want to change any properties, just remove it
player_nickname=Cool boy
player_uuid=Your UUID here
# After changes, you need to delete "/.idea/runConfigurations" folder and reopen project and reload gradle
At now plugin j52j will convert all .json5
files in Mossy/src/main/resources/
to .json
in build, check this if you wanna to safe some files from converting.
After settings and reloading gradle, you should have gradle tasks in the stonecutter
category, select the one and you will switch the active minecraft version of the game to the selected one.
Refresh active project
will refresh project and update comments.Reset active project
will switch current minecraft version to first of themulti_versions
in maingradle.properties
file.
You can check current minecraft version in stonecutter.gradle
file.
For more info check the Stonecutter docs.
To run current minecraft version with your mod you will need to execute run configuration with the same version, that in stonecutter.gradle
, to switch it, read previous text above.
Also, your game folder is now split to Mossy/runs/client
and Mossy/runs/server
, boop.
To build your mod for each minecraft version which you write in main gradle.properties
, you can just start specified gradle task chiseledBuild
in project
group, after execution you can go to Mossy/versions/[MINECRAFT VERSION]/build/libs/your_builded_mod.jar
.