Skip to content
Moth edited this page Aug 9, 2026 · 2 revisions

Butterfly API

Butterfly API is a developer library for Fabric mods running on Minecraft 1.21.11.

It provides reusable helpers for common modding tasks such as registering content, creating creative tabs, registering client-side features, working with plush blocks, rendering custom outlines, and performing common math operations.

The goal of Butterfly API is to reduce repeated setup code while still allowing mods to use normal Minecraft and Fabric systems.

Requirements

Butterfly API 1.21.11 requires:

  • Minecraft 1.21.11
  • Java 21
  • Fabric Loader
  • Fabric API
  • Butterfly API

Main Features

Registration Helpers

Butterfly API provides shortcuts for registering common Minecraft content including:

  • Items
  • Blocks
  • Block items
  • Sounds
  • Entities
  • Block entities
  • Screen handlers
  • Status effects
  • Potions
  • Recipe serializers
  • Recipe types
  • Particles

Most registration helpers are available through ModContext.

See Registration.

Mod Context

ModContext provides a central helper object for your mod.

It handles commonly repeated tasks such as:

  • Creating namespaced identifiers
  • Creating registry keys
  • Creating item and block settings
  • Accessing registration helpers
  • Accessing creative tab helpers
  • Accessing client registration helpers
  • Accessing your mod logger

See Mod Context.

Creative Tabs

Butterfly API includes an expanded creative tab system that can create both simple tabs and more customized tabs.

Custom tabs can include:

  • Categories
  • Category ordering
  • Custom colors
  • Custom backgrounds
  • Custom slot styling
  • Search-only entries

See Creative Tabs.

Plush API

The Plush API provides a reusable system for registering interactive plush blocks.

A registered plush can include:

  • A block
  • A matching item
  • A plush block entity
  • Custom interaction behavior
  • Custom sounds
  • Squishing behavior
  • Custom resource files

See Plush API.

Outline API

Butterfly API can render customizable outlines around entities and block entities.

Outlines can be controlled from either the server or the local client and support settings such as:

  • Color
  • Thickness
  • Inside, outside, or centered placement
  • Visibility through walls
  • Black borders
  • Model-layer matching
  • Distance-consistent thickness

See Outline API.

Math Utilities

Butterfly API contains several small utility classes for frequently used calculations.

These include helpers for:

  • Angles
  • Vectors
  • Bounding boxes
  • Motion
  • Sampling points
  • Scalar values

See Math Utilities.

Client Registration

Client-only helpers are available for registering features such as:

  • Block render layers
  • Entity renderers
  • Block entity renderers
  • Screens
  • Model layers
  • Particle factories

See Client Registration.

Bootstrap Helpers

Bootstrap and RunOnce provide simple ways to make initialization code run only once.

See Bootstrap Helpers.

Getting Started

If you are adding Butterfly API to a mod for the first time, start with:

  1. Installation
  2. Quick Start
  3. Mod Context
  4. Registration

After that, use the sidebar to find the specific API feature you need.


This documentation is for Butterfly API on Minecraft 1.21.11.

Clone this wiki locally