With version 1.5.3, there will be a few changes made to how mods are loaded, aiming at improving modding for the future, especially inter-mod dependencies. As a result, mods might be incompatible with previous versions.
TL;DR: Update example with CarryCapacity.
- Added
modid
property, which is optional. If not specified, will use the name as mod ID, except lowercased and stripped of special characters. SoMy Cool Mod!
becomesmycoolmod
. version
now expects a proper SemVer version string and will complain with a warning if it finds you were naughty. This is important as it will help dependency checking.author
string has been replaced withauthors
string array.contributors
string array has been added which works the same asauthors
.gameversions
was replaced bydependencies
, which allows you to specify multiple"<modid>": "<version>"
entries, allowing for multiple dependencies. Similar withversion
, this expects a single, minimum SemVer version string. You can use an empty string to mean "any version".
{
"type": "code",
"name": "CarryCapacity",
"modid": "carrycapacity",
"version": "0.3.0",
"description" : "Adds the capability to carry various things",
"website": "https://github.com/copygirl/CarryCapacity",
"authors": [ "copygirl" ],
"dependencies": {
"game": "1.5.3"
}
}
There has been some confusion regarding what clarifies as a "Mod". Previously,
ModBase
contained some methods that made it seem like it was the main entry
for a mod, when in reality you could have multiple ModBase
instances per mod.
The official survival and creative content mods made use of this.
As such, ModBase
has been replaced with ModSystem
. A code mod may ship with
just one, or multiple of these "systems". If you want, use these to separate
different logical parts of your mod that could function on their own.
-
GetModInfo
,GetModID
andGetModDependencies
were removed. -
ModInfoAttribute
andModDependencyAttribute
have been added. They're attributes that can be applied to the mod's assembly. The dependency attribute can be applied multiple times. Just add something similar to the following to one of your source files.Using these attributes is optional, and if a
modinfo.json
is found alongside the mod, that will be used instead. It's mostly meant for single-file.cs
and.dll
code mods.
[assembly: ModInfo( "CarryCapacity", "carrycapacity",
Description = "Adds the capability to carry various things",
Website = "https://github.com/copygirl/CarryCapacity",
Authors = new []{ "copygirl" })]
[assembly: ModDependency( "game", "1.5.3" )]