Skip to main content

instanceprefs

pip install instanceprefs

Show the server list and the game options of one launcher instance as text, and copy them into another instance. One command instead of retyping server addresses one at a time, or hand made symlinks.

Python 3.9 or newer. No dependencies.

Built with AI assistance, reviewed and tested by me.

What it does

cd <the folder holding your instance folders>

instanceprefs list .
instanceprefs show Adventure

instanceprefs copy --from Adventure --to Fabric --servers --options

instanceprefs copy --from Adventure --to Fabric --servers --apply

list prints one line per instance, with how many servers and options it holds.

show prints the servers and the options of one instance. Add --json for machine readable output.

copy brings the server list and the game options of one instance into another. Without --apply it writes nothing and only prints what it would do.

What it will not do

  • It never overwrites a server that is already in the target. Servers are matched on their address, so running the same copy twice changes nothing the second time.
  • It never invents an option key the target does not already have. A key from another game version would be dropped on the next launch anyway, so it is reported as skipped instead of written.
  • It only ever writes two files, servers.dat and options.txt, and it reads nothing else except instance.cfg, opened read only to get the display name of an instance. Account files, session files, logs, worlds and mods are never opened at all.
  • It does not sync anything in the background. It runs when you run it.

Before writing, it keeps a copy of the file it is about to change, next to it, named servers.dat.instanceprefs-backup or options.txt.instanceprefs-backup. Writes go through a temporary file and a rename, so a crash in the middle leaves the old file intact.

Options

  • --servers copies the server list.
  • --options copies the game options.
  • --only KEY restricts --options to this key. Repeat it for several keys.
  • --apply actually writes. Without it nothing is written.
  • --json makes show print JSON.

Copying options between two different game versions

--options copies every key the target already has, and that includes the bookkeeping keys the game writes for itself, such as the one holding the file version. Copying those from a newer instance into an older one may tell the game the file is newer than it is. I have not measured what the game does in that case. Between two different game versions, prefer naming the keys you actually want:

instanceprefs copy --from Adventure --to Fabric --options --only fov --only gamma --apply

Where the files are

An instance folder holds instance.cfg and a game folder named .minecraft or minecraft, and the two files live inside that game folder. You can pass either the instance folder or the game folder. The names come from the upstream source file launcher/InstanceCopyPrefs.cpp, which matches [.]?minecraft/. Where the instance folders themselves live depends on your system and your launcher settings, so the examples above start with a cd rather than guessing a path for you.

A server entry may carry an icon. It is copied along with its server, but it is never printed: show only reports whether one is there.

What is not verified

No real instance has been read while building this. The file layout comes from the public source of the launcher, and the tests run on example folders written by the tests themselves. The binary format of servers.dat was not read from any first hand specification, so the reader assumes nothing about the file being compressed: it looks at the first two bytes and writes back in the form it found.

If you run it on a real instance, please say so in an issue, whether it worked or not.

Limits worth knowing

  • Writing options.txt rewrites the whole file from the keys it understands. A line with no : in it, or a blank line, is not kept. The backup next to the file holds the original.
  • Badly encoded text is carried through unchanged rather than repaired.
  • A server entry carrying fields this tool does not know is copied whole, unchanged, but those fields are not printed.
  • The game must be closed while copying, or it may write the old list back when it exits.

Where this came from

The request this answers: https://github.com/PrismLauncher/PrismLauncher/issues/2205

License

MIT. Younes Z.

This project is not affiliated with, endorsed by, or connected to any launcher or game vendor. Names are used only to say which files the tool reads.

Metadata

Release files for instanceprefs 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for instanceprefs 0.1.0
File Size Uploaded Provenance Actions
instanceprefs-0.1.0.tar.gz 15.6 kB Without provenance Details for instanceprefs-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for instanceprefs 0.1.0
File Interpreter ABI Platform Actions
instanceprefs-0.1.0-py3-none-any.whl Python 3 none any Details for instanceprefs-0.1.0-py3-none-any.whl

Total release size: 27.8 kB

Release files / instanceprefs-0.1.0.tar.gz

Download URL instanceprefs-0.1.0.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
62d0be2f068e0d98a800f7a4e3d2f6c74740a1e53e4aeaa89e4007c3db4d46a1
BLAKE2b-256 checksum
How to use checksums
1722810121461833405d0887dab8989f67fdf095a095f76c88d2def4ff7a70ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / instanceprefs-0.1.0-py3-none-any.whl

Download URL instanceprefs-0.1.0-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd7150ba751839e45ca3f758ad62668540834fcc35b7f5574ab91f126d4cdeae
BLAKE2b-256 checksum
How to use checksums
8841e35b8d4f421f8ff49a67e5552a0b5c1fca266d170ee82a8708c8885dffbe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for instanceprefs 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page