Skip to content

Creating your mod.json file

Metious edited this page Jun 27, 2022 · 13 revisions

To support your mod for the QMods system, you need to learn how the mod.json file works.

The mod.json file needs to provide the minimum following information.

{
  "Id": "MyMod",
  "DisplayName": "My Mod",
  "Author": "My Name",
  "Version": "1.0",
  "Enable": true,
  "Game": "Subnautica",
  "AssemblyName": "MyMod.dll"
}

The following are the keys that the mod.json can contain and what they are used for in QModManager:


  • Id: Your unique mod id. Can only contain alphanumeric characters and underscores.
    (required)
    Type: string
    Example: "BestMod"

  • DisplayName: The display name of your mod. Just like the mod id, but it can contain any type of characters.
    (required)
    Type: string
    Example: "Best Mod"

  • Author: Your username. Should be the same across all your mods. Can contain any type of characters.
    (required)
    Type: string
    Example: "Awesome Guy"

  • Version: The mod version. This needs to be updated every time your mod gets updated (please update it).
    (required)
    Type: string
    Example: "1.0.0"

  • Dependencies: Other mods that your mod needs. If a dependency is not found, the mod isn't loaded.
    (optional, defaults to [])
    Type: string[]
    Example: [ "DependencyModID" ]

  • VersionDependencies: Just like Dependencies, but you can specify a version range for the needed mods.
    (optional, default to {})
    Type: Dictionary<string, string>
    Example: { "SMLHelper": "2.0", "AnotherVeryImportantMod": "1.2.3" }
    Note that the version you specify here will be treated as the new "minimum required version".
    If the dependency mod is out of date, QModManager won't load this one.

  • LoadBefore: Specify mods that will be loaded after your mod. If a mod in this list isn't found, it is simply ignored.
    (optional, defaults to [])
    Type: string[]
    Example: [ "AModID", "SomeOtherModID" ]

  • LoadAfter: Specify mods that will be loaded before your mod. If a mod in this list isn't found, it is simply ignored.
    (optional, defaults to [])
    Type: string[]
    Example: [ "AnotherModID" ]

  • Enable: Whether or not to enable the mod.
    (optional, defaults to true)
    Type: bool
    Example: true

  • Game: The game that this mod is for. Can be "Subnautica", "BelowZero", or "Both"
    (optional, defaults to "Subnautica")
    Type: string
    Example: "Subnautica"

  • AssemblyName: The name of the DLL file which contains the mod.
    (required)
    Type: string
    Example: "BestMod.dll"

  • NitroxCompat: Whether or not this mod should be loaded when Nitrox is present.
    (optional, defaults to false)
    Type: boolean
    Example: true
    Note: Nitrox compatibility was added in 4.3

  • EntryMethod: The method which is called to load the mod. The method must be public, static, and have no parameters.
    Type: string
    Example: "BestMod.QMod.Patch"
    Note: This is no longer required.
    See Basic Mod Loading Setup for details on how you can identify your patching method without setting it in the manifest file.

The final result with all of it would look something like this:

{
  "Id": "BestMod",
  "DisplayName": "Best Mod",
  "Author": "Awesome Guy",
  "Version": "1.0.0",
  "Dependencies": [ "DependencyModID" ],
  "VersionDependencies": { 
    "SMLHelper": "2.0", 
    "AnotherVeryImportantMod": "1.2.3" 
  },
  "LoadBefore": [ "AModID", "SomeOtherModID" ],
  "LoadAfter": [ "AnotherModID" ],
  "Enable": true,
  "Game": "Subnautica",
  "AssemblyName": "BestMod.dll",
  "NitroxCompat": true
}

Please note that you need to add commas after each value except the last one. If you get a "mod.json deserialization failed" error, check the mod.json file on an online json validator.


For additional integration with Version Checker and QMod SAM, visit the following: