Skip to content

Installation

Moth edited this page Aug 9, 2026 · 1 revision

Installation

Butterfly API is a Fabric developer library for Minecraft 1.21.11.

Requirements

Your development environment should use:

  • Minecraft 1.21.11
  • Java 21 or newer
  • Fabric Loader 0.18.1 or newer
  • Fabric API 0.141.5+1.21.11 or newer

Add Butterfly API

Add the Modrinth Maven repository to your build.gradle:

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

Then add Butterfly API to your dependencies:

dependencies {
    modImplementation "maven.modrinth:butterfly-api:<version>"
}

Replace <version> with the Butterfly API version you want to use.

Add the Mod Dependency

Butterfly API's mod ID is:

butterfly_api

Add it to the depends section of your fabric.mod.json:

{
  "depends": {
    "butterfly_api": ">=<version>"
  }
}

Replace <version> with the minimum Butterfly API version your mod requires.

Using a Local Build

If you are developing Butterfly API locally, you can publish it to your local Maven repository.

From the Butterfly API project:

.\gradlew.bat publishToMavenLocal

Then add mavenLocal() to your mod:

repositories {
    mavenLocal()
}

And use the local dependency:

dependencies {
    modImplementation "moth.butterflyapi:butterfly-api:<version>"
}

Next

Once Butterfly API is installed, continue to Quick Start to create your first ModContext and register content.

Clone this wiki locally