Balm Mod — Guide
Mod Integrations and Utilities
Beyond core Minecraft mechanics, Balm includes built-in support for popular third-party mods and common utility functions.
Third-Party Mod Support
Balm provides unified APIs for integrating with widely used utility mods: * Recipe Viewers: Define recipe displays and transfer handlers for JEI (Just Enough Items), REI (Roughly Enough Items), and EMI through a single builder API. * Information HUDs: A common block info API allows mod content to display correctly in HUD mods like Jade, WTHIT, and TheOneProbe. * Accessory Mods: Check for items equipped in accessory slots (such as Curios or Trinkets) using a single unified call.
Internal Utilities
- Containers, Fluids, and Energy: Includes pre-built classes to define fluid tanks, energy storage, and item containers on block entities.
- Quick Move Stack: A declarative system for specifying how items should behave when shift-clicked within a custom menu, eliminating the need for complex manual slot math.
- Progress Renderers: Provides segmented progress bar renderers for GUI screens, simplifying the creation of custom machine interfaces.
- Platform Proxies: An extensibility feature that allows developers to write loader-specific code for an interface without the complexity of service loaders or annotation-heavy systems.
Core Developer Mechanics
Balm provides several abstraction layers that handle the differences between mod loaders automatically. These systems allow developers to interact with Minecraft's core systems through a unified interface.
Registries
Balm utilizes builder-style helpers to register game content. This system removes the need for developers to manage the specific lifecycles or registry events of individual mod loaders. Supported registry types include:
* Blocks and Items: Simplified registration with automatic BlockItem generation.
* Entities: Unified entity type registration.
* Menu Types and Screens: Streamlined UI registration.
* Recipe Types: Support for custom crafting and processing recipes.
Event System
Balm provides a comprehensive mapping for the most frequently used Minecraft events. It hooks into the native events of the active mod loader (Forge, Fabric, or NeoForge) to ensure maximum compatibility and performance while maintaining a single common API for the developer.
Networking and Packets
Networking is handled through a single-call registration system. This allows mods to: * Register custom packets for client-server communication. * Open menus with additional data seamlessly. * Implement network versioning to ensure client and server protocols are synchronized.
Data Attachments and Capabilities
Balm abstracts complex loader-specific concepts like Forge's Capabilities or Fabric's Data Attachments into a unified API. This allows developers to attach custom data to entities, block entities, and item stacks in a way that works across all supported platforms.