How syncing works

What Settings Saver does with a registered settings file, from the launch restore to key-by-key saving, and where a profile stores your mod's files.

Last updated

On this page

Settings Saver keeps one copy of your mod's settings per profile, outside every game instance, and moves settings between that copy and each instance's file. It works setting by setting, so instances don't overwrite each other.

The pieces#

Term Meaning
Instance One game directory: a modpack, a launcher profile, one Minecraft version.
Store One folder per user, shared by every instance on the computer.
Profile A named set of saved settings in the store. Each instance picks one; default always exists.
Registration Your ModSettings: which files, how to read them, the defaults and the fixes.
Format Reads a file into a flat key -> value map and writes it back.

What happens to a registered file#

            launch                        while playing                    on demand
  profile ----------> instance file    instance file ----------> profile   Save / Load buttons
  (only if the file is missing,        (only the keys that changed,
   or sync is Auto + always apply)      only when sync is Auto)

1. Registration#

Your plugin hands over a ModSettings early in the launch. Settings Saver checks it against the other registrations and, if the profile has your mod turned on, starts syncing its files.

2. Restore at launch#

For each of your files:

With sync Off (the default), this restore happens once per instance, on its first launch with Settings Saver. With Auto, it happens whenever a file is missing at launch.

An empty profile restores nothing, and an instance never fills a profile on its own.

3. Saving changes#

Settings reach the profile in two ways:

Either way, with a key-by-key format only the settings that changed since the last sync are written. The rest of the profile's copy stays as it is. Two instances that changed different settings both keep their change.

A setting that newly appears in your file (your mod added it with its default) only fills a gap in the profile. It never replaces a value that is already saved there.

4. Loading#

Load settings from profile backs up the instance's file, then merges the profile's values over it. Keys the profile excludes, or doesn't have, keep the instance's values.

Key by key, or as a whole#

Everything above works per key, as your format defines keys. With the default WHOLE_FILE format the file has a single key, content, so:

Key-by-key format WHOLE_FILE
A save writes the changed keys the whole file, when anything changed
Two instances change the file both changes kept, per key the newest save wins
A load merges over the instance's file replaces the instance's file
Exclusions per key only the whole file

See Choose a file format.

Off unless chosen#

A registered mod is listed in Settings Saver, but its files are synced for a profile only when:

Turning a mod on or off applies nothing by itself: syncing starts from the instance's current files, and turning it off leaves what the profile has saved.

Where a profile keeps your files#

<store>/
  profiles/
    default/
      profile.properties                 enabled.mymod=, exclude.mymod=, and the same for other mods
      vanilla/options.txt                Minecraft's own settings
      mymod/
        module.txt                       modVersion and dataVersion the settings were saved in
        config/mymod.properties          your file, at its path in the game directory

Several instances at once#

Instances that run at the same time share the store. Every read-modify-write of a profile runs under a lock that works across processes, and files are replaced atomically, so a profile is never half written. Your format, fixes and merger may therefore be called while the profile is locked: keep them quick.