Adding the Dependency
Once you've added your GeckoLib version reference, and the maven repository, you can add the dependency.
Adding the dependency
- gradle.properties
- libs.versions.toml
- Find the
dependenciesblock in yourbuild.gradlefile. If one doesn't exist, create it. - Inside the
dependenciesblock, add the below dependency line:
- Groovy
- Kotlin
implementation "software.bernie.geckolib:geckolib-neoforge-${minecraftVersion}:${geckolibVersion}"
implementation("software.bernie.geckolib:geckolib-neoforge-${minecraftVersion}:${geckolibVersion}")
- Open your
libs.versions.tomlfile (located in thegradledirectory at the root of your project) - Add a new line in the
[libraries]section with the following content:
geckolib = { group = "software.bernie.geckolib", name = "geckolib-neoforge-1.21.11", version.ref = "geckolib" }
info
Make sure you change 1.21.11 to your intended Minecraft version
- In your
build.gradlefile, locate thedependenciesblock. If one doesn't exist, create it. - Inside the
dependenciesblock, add the below dependency line:
- Groovy
- Kotlin
implementation libs.geckolib
implementation(libs.geckolib)
Optional: Interface Injections
GeckoLib provides compile-time interface injections for users of ModDevGradle
If you are using ModDevGradle, it's recommended that you also add the below injection data to your dependencies block:
- gradle.properties
- libs.versions.toml
- Groovy
- Kotlin
interfaceInjectionData "software.bernie.geckolib:geckolib-neoforge-${minecraftVersion}:${geckolibVersion}"
interfaceInjectionData("software.bernie.geckolib:geckolib-neoforge-${minecraftVersion}:${geckolibVersion}")
- Groovy
- Kotlin
interfaceInjectionData libs.geckolib
interfaceInjectionData(libs.geckolib)
Finally
Once you're done, refresh Gradle by opening the Gradle tool window and clicking the refresh button.

And you should be good to go!