Changes

Jump to navigation Jump to search
+ document basic manifest fields
Line 2: Line 2:     
SMAPI simplifies mod development by providing APIs and events you can use, which are documented below. See [[Modding:Creating a SMAPI mod]] for a guide to creating a new SMAPI mod.
 
SMAPI simplifies mod development by providing APIs and events you can use, which are documented below. See [[Modding:Creating a SMAPI mod]] for a guide to creating a new SMAPI mod.
 +
 +
==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]].
 +
 +
These basic fields describe the mod:
 +
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! description
 +
|-
 +
| <tt>Name</tt>
 +
| The mod name. SMAPI uses this in player messages, logs, and errors. Example: <source lang="javascript">"Name": "Lookup Anything"</source>
 +
|-
 +
| <tt>Author</tt>
 +
| The name of the person who created the mod. Ideally this should include the username used to publish mods. Example: <source lang="javascript">"Author": "Pathoschild"</source>
 +
|-
 +
| <tt>Version</tt>
 +
| The mod's [http://semver.org/ semantic version]. Make sure you update this for each release! (The <tt>Build</tt> field is a semantic version label, like <tt>beta.2</tt> in <tt>1.0-beta.2</tt>.) SMAPI uses this for update checks, mod dependencies, and compatibility blacklists (if the mod breaks in a future version of the game). Example:
 +
<source lang="javascript">
 +
"Version": {
 +
  "MajorVersion": 1,
 +
  "MinorVersion": 0,
 +
  "PatchVersion": 0,
 +
  "Build": "beta.2"
 +
}
 +
</source>
 +
|-
 +
| <tt>Description</tt>
 +
| A short explanation of what your mod does (one or two sentences), shown in the SMAPI log. Example: <source lang="javascript">"Description": "View metadata about anything by pressing a button."</source>
 +
|-
 +
| <tt>UniqueID</tt>
 +
| A unique identifier for your mod. The recommended format is <tt>&lt;your name&gt;.&lt;mod name&gt;</tt>, with no spaces or special characters. SMAPI uses this for update checks, mod dependencies, and compatibility blacklists (if the mod breaks in a future version of the game). When another mod needs to reference this mod, it uses the unique ID. Example: <source lang="javascript">"UniqueID": "Pathoschild.LookupAnything"</source>
 +
|-
 +
| <tt>EntryDll</tt>
 +
| The name of the mod's compiled DLL in the mod folder. Example: <source lang="javascript">"EntryDll": "LookupAnything.dll"</source>
 +
|}
    
==Events==
 
==Events==
translators
8,456

edits

Navigation menu