-
Notifications
You must be signed in to change notification settings - Fork 0
Home
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 registration, blocks, items, creative tabs, plush blocks, custom outlines, client registration, math, and initialization.
The goal of Butterfly API is to reduce repeated setup code while still working with normal Minecraft and Fabric systems.
ModContext is the central helper used throughout Butterfly API.
It provides:
- Namespaced identifiers
- Block and item registry keys
- Keyed block and item settings
- Registration helpers
- Creative tab helpers
- Client registration helpers
- Logging
See Mod Context.
Butterfly API provides shortcuts for registering common content, including:
- Items
- Blocks
- Sounds
- Entities
- Block entities
- Screen handlers
- Status effects
- Potions
- Recipe serializers
- Recipe types
- Particles
Enchantments and painting variants are data-driven in Minecraft 1.21.11.
See Registration.
Butterfly API includes helpers for several item-related systems that are awkward to handle manually in Minecraft 1.21.11.
These include:
- Displayed attack speed modifiers
- Separate GUI and held item models
- Custom item progress bars
- Multi-row progress bars
- Layered progress bars
See Items.
Butterfly API provides a block builder for blocks that need custom settings or block items.
It also includes a multiblock system with:
- Built-in multiblock shapes
- Automatic part placement
- Horizontal facing
- Part coordinates
- Automatic cleanup when structures are broken
- Protection against duplicate drops
- Lower-level placement helpers for custom implementations
Butterfly API can create both simple creative tabs and styled categorized tabs.
Custom tabs can include:
- Categories
- Category ordering
- Custom backgrounds
- Slot colors
- Category colors
- Text colors
- Search-only entries
See Creative Tabs.
Butterfly plushes are reusable vanilla block-model plush blocks.
They support:
- A placed block
- A matching block item
- A shared plush block entity type
- Honk sounds
- Squish state
- Custom interaction behavior
- Normal block-model lighting
- Cutout textures
See Plush API.
Butterfly API can render customizable outlines around entities and block entities.
Outlines support features such as:
- Custom RGB colors
- Adjustable thickness
- Inside, outside, or centered placement
- Visibility through walls
- Optional black borders
- Model-layer matching
- Distance-consistent thickness
- Server-synced outlines
- Viewer-specific outlines
- Client-only outlines
See Outline API.
Butterfly API provides shortcuts for registering common client-side features such as:
- Block render layers
- Entity renderers
- Block entity renderers
- Screens
- Model layers
- Particle factories
See Client Registration.
Butterfly API contains reusable helpers for:
- Angles
- Vectors
- Bounding boxes
- Motion
- Sampling
- Scalar values
See Math Utilities.
Bootstrap and RunOnce help prevent initialization code from accidentally running more than once.
See Bootstrap Helpers.
If you are using Butterfly API for the first time, start with:
After that, use the sidebar to find the specific system you need.
This wiki documents Butterfly API for Minecraft 1.21.11.