Changes

→‎Manifest: split into subsections
Line 5: Line 5:  
==Manifest==
 
==Manifest==
 
Each SMAPI mod has a <tt>manifest.json</tt> file with metadata about it. The mod can read its own metadata using <tt>this.ModManifest</tt>, and read metadata for loaded mods using the [[#Mod registry|mod registry]].
 
Each SMAPI mod has a <tt>manifest.json</tt> file with metadata about it. The mod can read its own metadata using <tt>this.ModManifest</tt>, and read metadata for loaded mods using the [[#Mod registry|mod registry]].
 +
 +
===Basic fields===
 +
All mods should specify the following fields.
    
{| class="wikitable"
 
{| class="wikitable"
Line 46: Line 49:  
| <tt>EntryDll</tt>
 
| <tt>EntryDll</tt>
 
| The name of the mod's compiled DLL in the mod folder. Example: <source lang="javascript">"EntryDll": "LookupAnything.dll"</source>
 
| The name of the mod's compiled DLL in the mod folder. Example: <source lang="javascript">"EntryDll": "LookupAnything.dll"</source>
|-
+
|}
!colspan="2"| Optional fields
+
 
|-
+
===Minimum SMAPI version===
! field
+
The <tt>MinimumApiVersion</tt> fields sets the minimum SMAPI version needed to use this mod. If a player tries to use the mod with an older SMAPI version, they'll see a friendly message saying they need to update SMAPI. This also serves as a proxy for the minimum game version, since SMAPI itself enforces a minimum game version. Example: <source lang="javascript">"MinimumApiVersion": "1.10"</source>
! description
+
 
|-
+
===Dependencies===
| <tt>MinimumApiVersion</tt>
+
The <tt>Dependencies</tt> field specifies other mods required to use this mod. If a player tries to use the mod and the listed mods aren't installed, they'll see a friendly message saying they need to install those. Example:
| The minimum SMAPI version needed to use this mod. If a player tries to use the mod with an older SMAPI version, they'll see a friendly message saying they need to update SMAPI. This also serves as a proxy for the minimum game version, since SMAPI itself enforces a minimum game version. Example: <source lang="javascript">"MinimumApiVersion": "1.10"</source>
  −
|-
  −
| <tt>Dependencies</tt>
  −
| The other mods required to use this mod. If a player tries to use the mod and the listed mods aren't installed, they'll see a friendly message saying they need to install those. Example:
   
<source lang="javascript">
 
<source lang="javascript">
 
"Dependencies": [
 
"Dependencies": [
Line 79: Line 78:  
</source>
 
</source>
 
}}
 
}}
|-
+
 
| ''anything else''
+
===Anything else===
| Any other fields will be stored in the <tt>IManifest.ExtraFields</tt> dictionary, which is available through the [[#Mod registry|mod registry]]. Extra fields are ignored by SMAPI, but may be useful for extended metadata intended for other mods.
+
Any other fields will be stored in the <tt>IManifest.ExtraFields</tt> dictionary, which is available through the [[#Mod registry|mod registry]]. Extra fields are ignored by SMAPI, but may be useful for extended metadata intended for other mods.
|}
      
==Events==
 
==Events==
translators
8,447

edits