Skip to content

Installation (Geckolib4)

Tslat edited this page Aug 27, 2024 · 26 revisions

GeckoLib is lightweight and easy to install - requiring only a few things to insert into your build.gradle file.

Templates

GeckoLib4.5+ (1.20.6+)

Add the following repository to your build.gradle file

// This is the repositories block in your build.gradle. NOT the one in publishing, or in buildscript. If it does not exist already, create it.
repositories {
	maven {
		name = 'GeckoLib'
		url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/'
		content {
			includeGroup("software.bernie.geckolib")
		}
	}
}

Then add GeckoLib to your dependencies in your build.gradle

Fabric
dependencies {
	modImplementation "software.bernie.geckolib:geckolib-fabric-${minecraft_version}:${geckolib_version}"
}
Forge
dependencies {
	implementation fg.deobf("software.bernie.geckolib:geckolib-forge-${minecraft_version}:${geckolib_version}")
}

Then add the mixins plugin to your project's pluginManagement repositories section in your settings.gradle file

pluginManagement {
        repositories {
                maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
        }
}

And apply the mixins plugin in your build.gradle file

plugins {
        id 'org.spongepowered.mixin' version '0.7.+'
}
NeoForge
dependencies {
	implementation "software.bernie.geckolib:geckolib-neoforge-${minecraft_version}:${geckolib_version}"
}

Don't forget to add the geckolib_version property to your gradle.properties:

geckolib_version=??? Replace this with the current latest version of GeckoLib from Curseforge for your Minecraft version

Then refresh gradle and you should be good to go!

GeckoLib4->4.4 (1.19.3->1.20.4)
Fabric

Add the following to your build.gradle file, then refresh gradle for your project

// This is the repositories block in your build.gradle. NOT the one in publishing, or in buildscript. If it does not exist already, create it.
maven {
        name = 'GeckoLib'
        url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/'
        content {
                includeGroupByRegex("software\\.bernie.*")
                includeGroup("com.eliotlash.mclib")
        }
}

dependencies {
        modImplementation("software.bernie.geckolib:geckolib-fabric-${minecraft_version}:${geckolib_version}")
        implementation("com.eliotlash.mclib:mclib:20")
}

Don't forget to add the geckolib_version property to your gradle.properties:

geckolib_version=??? Replace this with the current latest version of GeckoLib from Curseforge for your Minecraft version
Forge

Add the following to your build.gradle file

// This is the repositories block in your build.gradle. NOT the one in publishing, or in buildscript. If it does not exist already, create it.
maven {
        name = 'GeckoLib'
        url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/'
        content {
                includeGroupByRegex("software\\.bernie.*")
                includeGroup("com.eliotlash.mclib")
        }
}

dependencies {
        implementation fg.deobf("software.bernie.geckolib:geckolib-forge-${minecraft_version}:${geckolib_version}")
        implementation("com.eliotlash.mclib:mclib:20")
}

Don't forget to add the geckolib_version property to your gradle.properties:

geckolib_version=??? Replace this with the current latest version of GeckoLib from Curseforge for your Minecraft version

Then add the mixins plugin to your project's buildscript repositories (either in the top of your build.gradle, or in settings.gradle file)

buildscript {
        repositories {
                maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
        }
}

And apply the mixins plugin in your build.gradle file

plugins {
        id 'org.spongepowered.mixin' version '0.7.+'
}

Then refresh your gradle project, and regenerate your run configs

Other Versions

GeckoLib is also available on numerous versions other than the above templated options. To utilise these, simply follow the usual mod dependency instructions for your given modloader, using the latest GeckoLib version for the Minecraft version.

The dependency block below can be used in all cases irrespective of version:

// This is the repositories block in your build.gradle. NOT the one in publishing, or in buildscript. If it does not exist already, create it.
maven {
        name = 'GeckoLib'
        url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/'
        content {
                includeGroupByRegex("software\\.bernie.*")
                includeGroup("com.eliotlash.mclib")
        }
}

Multiloader:

GeckoLib4.5+

As of GeckoLib 4.5, GeckoLib is fully multiloader compatible. You can utilise the common package as normal with the various platform packages available as is normal for multiloader projects.

100% of GeckoLib's functionality is in common, so there is no limitations on platform-specific functionality.

GeckoLib4.4 and below

For GeckoLib4.4 and below, GeckoLib does not explicitly support a multiloader setup, as it does not have a common sources to publish. To use GeckoLib in a multiloader environment, simply add GeckoLib's Forge or Fabric sources as your dependency in common

You will likely need to do some platform-specific handling for things like items and armour.

Installing the Blockbench Plugin

If you have not yet installed the Blockbench plugin for Geckolib, follow the steps outlined here

Table of Contents

Geckolib 3
Geckolib 4

Hosted By: Cloudsmith

Package repository hosting is graciously provided by Cloudsmith.

Cloudsmith is the only fully hosted, cloud-native, universal package management solution that enables your organization to create, store and share packages in any format, to any place, with total confidence.

Clone this wiki locally