# Installation

> Add the Settings Saver API to your Gradle build as a compile-only dependency, and learn why it must never be bundled in your mod's jar.

URL: https://xichil.dev/docs/settings-saver/v1/getting-started/installation/ · Updated: 2026-11-16 · Applies to: Fabric, Quilt, Legacy Fabric, Forge, NeoForge, MC 1.7.10 - 26.3

By the end of this page your mod compiles against the Settings Saver API. Nothing changes for players
who don't have Settings Saver.

## Prerequisites

- A mod project that builds with Gradle.
- Java 8 or newer as the compile target. The API is compiled for Java 8, so code that uses it runs on
  every Minecraft version from 1.7.10 to 26.3.

## Steps

### 1. Add the repository and the API

The API jar is `dev.xichil.settingssaver:settingssaver-api` on `https://maven.xichil.dev`. Add it as
`compileOnly`:

```kotlin title="build.gradle.kts"
repositories {
    maven("https://maven.xichil.dev")
}

dependencies {
    // Settings Saver's own jar ships these classes. Never bundle, shade or jar-in-jar them.
    compileOnly("dev.xichil.settingssaver:settingssaver-api:1.0.0")
}
```

```groovy title="build.gradle"
repositories {
    maven { url 'https://maven.xichil.dev' }
}

dependencies {
    compileOnly 'dev.xichil.settingssaver:settingssaver-api:1.0.0'
}
```

> **Warning:** Don't bundle, shade or jar-in-jar the API. Settings Saver's mod jar already contains these classes. A
> second copy in your jar would split them in two, and your registration would not reach Settings Saver.

The API has no dependencies and contains no Minecraft or loader classes, so it compiles in any source
set, including code shared between loaders (see
[Build one integration for every loader](https://xichil.dev/docs/settings-saver/v1/guides/multiversion-mod/index.md)).

### 2. Leave your mod metadata alone

You don't have to declare Settings Saver in `fabric.mod.json`, `mods.toml`, `neoforge.mods.toml` or
`mcmod.info`. Settings Saver finds your integration through a service file in your jar
([step 3 of the next page](https://xichil.dev/docs/settings-saver/v1/getting-started/first-integration/index.md#3-list-the-class-in-a-service-file)), which works without
any loader metadata and without load-order rules.

Don't declare it as a required dependency: your mod should keep working without it.

### 3. Optional: use the API in tests

The API is plain Java, so your formats, fixes and mergers can be tested in JUnit without Minecraft. Add
the same artifact to the test class path:

```kotlin title="build.gradle.kts"
dependencies {
    testImplementation("dev.xichil.settingssaver:settingssaver-api:1.0.0")
}
```

See [Test your integration without Minecraft](https://xichil.dev/docs/settings-saver/v1/guides/testing/index.md).

## Check it worked

Add an import of `dev.xichil.settingssaver.api.v1.ModSettings` to any class and build. If it compiles,
the dependency resolves. Remove the import again: only your plugin class should reference the API.

## Next steps

- [Your first integration](https://xichil.dev/docs/settings-saver/v1/getting-started/first-integration/index.md): write the plugin class and the service file.
- [An optional dependency](https://xichil.dev/docs/settings-saver/v1/concepts/optional-dependency/index.md): why your mod can't crash when Settings
  Saver is missing.
