Skip to content
Edit this page

Setting-up FramingLib

Adding Via Gradle

Add the Modrinth Maven repository to your build.gradle file:

build.gradle
1
2
3
repositories {
    maven { url = "https://api.modrinth.com/maven" }
}

Then add the library to your dependencies in build.gradle file:

build.gradle
1
2
3
4
5
dependencies {
    // Your other dependencies

    modApi "maven.modrinth:framinglib:MOD_VERSION"
}

⚠️️ Replace MOD_VERSION with your target version
Find valid versions on the FramingLib Modrinth Versions Page

Examples

Fabric Setup

build.gradle

build.gradle
repositories {
    maven { url = "https://api.modrinth.com/maven" }
}

dependencies {
    minecraft "net.minecraft:minecraft:1.16.5"
    mappings loom.officialMojangMappings()
    modImplementation "net.fabricmc:fabric-loader:0.19.3"

    modApi "maven.modrinth:framinglib:1.0.0+1.16.5-Fabric"
}

Also add the library as a dependency in fabric.mod.json:

src/main/resources/fabric.mod.json
{
    ...
    "depends": {
        "fabricloader": ">=0.19.3",
        "minecraft": "~1.16.5",
        "java": ">=8",
        "framinglib": ">=1.0.0"
    },
    ...
}

Forge Setup

build.gradle
repositories {
    maven { url = "https://api.modrinth.com/maven" }
}

dependencies {
    minecraft "net.minecraft:minecraft:1.16.5"
    mappings loom.officialMojangMappings()
    forge "net.minecraftforge:forge:1.16.5-36.2.34"

    modApi "maven.modrinth:framinglib:1.0.0+1.16.5-Forge"
}

Also add the library as a dependency in mods.toml:

src/main/resources/META-INF/mods.toml
1
2
3
4
5
6
7
...
[[dependencies.example_mod]]
modId = "framinglib"
mandatory = true
versionRange = "[1.0.0,)"
ordering = "NONE"
side = "CLIENT"

Tip: Dependency Properties

Simplify version updates by managing the version string inside your gradle.properties file.

Configure Properties

Add this line to your gradle.properties file:

gradle.properties
framinglib_version = 1.0.0+1.16.5

Configure Build Script

Update your build.gradle file to reference the property:

build.gradle
1
2
3
4
5
6
7
8
9
dependencies {
    // Your other dependencies

    // Reads version from gradle.properties
    // For Fabric
    modApi "maven.modrinth:framinglib:${project.framinglib_version}-Fabric"
    // For Forge
    modApi "maven.modrinth:framinglib:${project.framinglib_version}-Forge"
}