The Best Resource for Minecraft
The Best Resource for Minecraft

Balm Mod Wiki

Balm is a comprehensive library mod and abstraction layer designed by BlayTheNinth to allow developers to create multi-loader Minecraft mods for NeoForge, Fabric, and Forge using a single unified codebase.

5 sections · 634 words

Overview#

Balm is a specialized library mod that serves as a bridge between different Minecraft mod loaders. Its primary purpose is to simplify the development process by providing a common API for essential game mechanics, allowing a single mod's code to function across NeoForge, Fabric, and Forge without requiring platform-specific rewrites.

As a library mod, Balm does not add traditional gameplay content such as new mobs, biomes, or dimensions. Instead, it provides the underlying infrastructure that other mods rely on to function correctly. Players only need to install Balm if it is listed as a dependency for another mod they wish to use.

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.

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.

Commands#

Balm includes several administrative and development commands. These commands generally require operator (OP) permissions to execute.

Command Description
/balm dev Configures the world for a development environment. It sets gamerules (Daylight Cycle, Weather Cycle, Keep Inventory, etc.) and difficulty to standard testing values.
/balm export icons Exports high-quality icons for all registered items and blocks in the current game instance.
/balm export config Exports the current configuration settings for Balm-supported mods.

Configuration#

Balm features a simple, annotation-based configuration system. This system supports:

  • Synced Configs: Automatically synchronizes server-side configuration settings to connected clients.
  • Config Screens: Built-in support for generating in-game configuration menus, allowing players to adjust settings without leaving the game.
  • Validation: Automatic validation of config values to prevent crashes from improper settings.

Configuration files for mods using Balm are typically found in the standard .minecraft/config directory.