Modinfo: Difference between revisions

From Vintage Story Wiki
1,512 bytes added ,  1 month ago
m
Updated navbox to new content navbox.
m (Updated navbox to new content navbox.)
 
(16 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== Overview ==
<languages/><translate>
<!--T:1-->
{{GameVersion|1.19}}
 
== Overview == <!--T:2-->
Every mod needs some basic information to be recognized as a mod. This can either happen by putting this info into the assembly (not recommended anymore) or by using the modinfo.json. The modinfo.json sits at the root of your mod directory and looks for example like this:
Every mod needs some basic information to be recognized as a mod. This can either happen by putting this info into the assembly (not recommended anymore) or by using the modinfo.json. The modinfo.json sits at the root of your mod directory and looks for example like this:
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
{
{
   "type": "code",
   "type": "code",
   "modid": "myCoolMod",
   "modid": "mycoolmod",
   "name": "My cool Mod (very cool)",
   "name": "My Cool Mod (very cool)",
   "author": "SakuraSpiritKid69",
   "authors": ["SakuraSpiritKid69"],
   "description": "Mod that is so cool it freezes you.",
   "description": "Mod that is so cool it freezes you.",
   "version": "1.2.3",
   "version": "1.2.3",
   "dependencies": {
   "dependencies": {
     "game": "",
     "game": "1.14.10",
   }
   }
}
}
</syntaxhighlight>
</syntaxhighlight>


== Reference ==
== Reference == <!--T:3-->
The following properties and values are supported, '''bold''' values are required.
The following properties and values are supported. '''Bold''' values are required. Properties are not case sensitive and may appear in any order.


<!--T:4-->
{| class="wikitable"
{| class="wikitable"
! Property !! Example !! Description
! Property !! Example !! Description
|-
|-
| '''type''' || "type": "code" || The type of this mod. Can be "Theme", "Content" or "Code"
| '''type''' || <code>"type": "code"</code> || The type of this mod. Can be "Theme", "Content" or "Code"
|-
| '''name''' || <code>"name": "My cool Mod"</code> || The name of this mod.
|-
|-
| '''name''' || "name": "My cool Mod" || The name of this mod.
| modid || <code>"modid": "mycoolmod"</code> || The mod id (domain) of this mod. <br> Must only contain lowercase letters and numbers. No special chars, whitespaces, uppercase letters, etc. allowed. <br> If it is not supplied it will be generated from the name, but it is recommended that you choose the id yourself because it will be used as a domain for your mod.
|-
|-
| modid || "modid": "myCoolMod" || The mod id (domain) of this mod. <br> Must only contain lowercase letters and numbers. No special chars, whitespaces, uppercase letters, etc. allowed. <br> If it is not supplied it will be generated from the name, but it is recommended that you choose the id yourself because it will be used as a domain for your mod.
| version || <code>"version": "1.2.3"</code> || Version of this mod (used for dependency resolution)
|-
|-
| version || "version": "1.2.3" || Version of this mod (used for dependency resolution)
| networkVersion|| <code>"networkVersion" : "1.2.3"</code> || The network version of this mod. <br> Change this number when a user that has an older version of your mod should not be allowed to connected to server with a newer version. <br> Default value is the version.
|-
|-
| networkVersion|| "networkVersion" : "1.2.3" || The network version of this mod. <br> Change this number when a user that has an older version of your mod should not be allowed to connected to server with a newer version. <br> Default value is the version.
| textureSize || <code>"textureSize" : 32</code> || If the mod is a texture pack that changes topsoil grass textures, define the texture size here. Default value = 32
|-
|-
| textureSize || "textureSize" : 32 || If the mod is a texture pack that changes topsoil grass textures, define the texture size here. Default value = 32
| description || <code>"description": "Mod that is so cool it freezes you."</code> || A short description of what this mod does.
|-
|-
| description || "description": "Mod that is so cool it freezes you." || A short description of what this mod does.
| website || <code>"website": "<nowiki>https://wiki.vintagestory.at</nowiki>"</code> || Location of the website or project site of this mod.
|-
|-
| website || "website": "https://wiki.vintagestory.at" || Location of the website or project site of this mod.
| authors || <code>"authors": ["SakuraSpiritKid69"]</code> || Names of people working on this mod. Must be formatted as an array, even if there is only one author.
|-
|-
| authors ||"authors": ["SakuraSpiritKid69"] || Names of people working on this mod.
| contributors || <code>"contributors": ["noone"]</code> || Names of people contributing to this mod.
|-
|-
| contributors || "authors": ["noone"] || Names of people contributing to this mod.
| side || <code>"side" : "Universal"</code> || Which side(s) this mod runs on. Can be "Server", "Client" or "Universal". Default value = "Universal"
|-
|-
| side || "side" : "Universal" || Which side(s) this mod runs on. Can be "Server", "Client" or "Universal". Default value = "Universal"
| requiredOnClient|| <code>"requiredOnClient": true</code> ||If set to false and the mod is universal, clients don't need the mod to join. Default value = True
|-
|-
| requiredOnClient|| "requiredOnClient" = True ||If set to false and the mod is universal, clients don't need the mod to join. Default value = True
| requiredOnServer|| <code>"requiredOnServer": true</code> ||If set to false and the mod is universal, the mod is not disabled if it's not present on the server. Default value = True
|-
|-
| dependencies || "dependencies": { "game": "1.12.14", "survival": "1.12.14"} ||  List of mods (and versions) this mod depends on.
| dependencies || <code>"dependencies": { "game": "1.12.14", "survival": "1.12.14"}</code> ||  List of mods (and versions) this mod depends on.<br><br>The game uses [https://semver.org/ SemVer] to compare, so for example "1.15.0" > "1.15.0-rc.3" > "1.15.0-rc.2" > "1.15.0-pre.1". You can set the value to an empty string or an asterisk ("game": "*") to allow compatibility with all versions.<br><br>Although the game follows the general logic of SemVer, it does not fully implement it. So for <prerelease> you can only use rc > pre > dev and <metadata> is not supported.
|}
|}
=== Technical Note === <!--T:5-->
The <code>modinfo.json</code> properties correspond directly to the fields and properties on the [https://apidocs.vintagestory.at/api/Vintagestory.API.Common.ModInfo.html ModInfo] API class (and are loaded into that class internally using <code>JsonConvert.DeserializeObject</code>). Check the available fields in the api documentation to see a full up to date list of all possible properties.
<!--T:6-->
{{Navbox/contentmodding}}
</translate>
Confirmedusers
538

edits