Overview#
Mantle Mod is a foundational library mod developed by the SlimeKnights team. While it primarily serves as a backend requirement for massive mods like Tinkers' Construct, Natura, Inspirations, and Ceramics, it also introduces several standalone utility features that enhance the vanilla Minecraft experience. Its primary purpose is to centralize shared code, such as descriptive in-game book APIs, common inventory logic, and advanced JSON parsing utilities, ensuring compatibility and stability across the SlimeKnights modding suite.
In modern versions (1.19.2 and 1.20.1), Mantle has evolved into a powerful tool for modpack creators and developers, offering extensive command-line tools for debugging tags, recipes, and loot tables, as well as a robust system for data-driven item and block creation.
Gameplay Mechanics#
Mantle adds several subtle but impactful mechanics to the game that are often utilized by its dependent mods.
Health Overlay
One of Mantle's most recognizable features is the Colored Heart Overlay. In vanilla Minecraft, gaining extra health (via potions or equipment) results in multiple rows of hearts stacking vertically, which can obscure the screen. Mantle replaces this with a color-coded system where hearts change color to represent additional health layers:
- Red Hearts: Standard 10 hearts (20 HP).
- Orange/Yellow/Green/Blue Hearts: Represent subsequent layers of health. Each color indicates a full extra bar of health has been added.
Soulbound Items
Mantle introduces the mantle:soulbound item tag. Any item added to this tag via a data pack will be automatically kept in the player's inventory upon death, rather than dropping on the ground. This logic is natively supported by Tinkers' Construct and can be utilized by other mods using Mantle's event bus.
In-World Fluid Gauges
In version 1.20.1, Mantle adds a dynamic tooltip system for fluids. By adding blocks to specific tags, players can see fluid contents just by looking at them:
mantle:gauges/attached: Blocks in this tag show a tooltip of the fluid contents in the tank directly behind them.mantle:gauges/tank: Blocks in this tag show their own internal fluid contents as a tooltip.mantle:hides_gauge_amount: Blocks with this tag will only show the fluid name, hiding the specific millibucket (mB) amount.
Blocks and Items#
While Mantle is a library, it provides the logic and base templates for several iconic blocks and items.
Crafting Station
The Crafting Station is a specialized version of the vanilla Crafting Table. Its primary advantage is its Persistent Inventory: items placed in the crafting grid remain there even after the player closes the interface.
- Inventory Linking: If a chest or other inventory block is placed adjacent to the Crafting Station, the player can access that chest's contents directly from the crafting UI via side tabs.
- Compatibility: It supports complex recipes that require player access or specialized data, which vanilla crafting tables often struggle to handle.
In-Game Manuals (Books)
Mantle provides the API for the high-quality, illustrative books found in SlimeKnights mods (e.g., Materials and You). These books support:
- Rich text formatting and images.
- Dynamic recipe displays.
- Advancement-locked sections.
- Searchable indexes.
Commands#
Mantle includes a suite of powerful commands primarily used for debugging and modpack development. All commands are prefixed with /mantle.
| Command | Description |
|---|---|
/mantle tags <type> <id> |
Lists all tags associated with a specific item, block, fluid, or entity. |
/mantle dump_tag <type> <name> |
Dumps the contents of a specific tag to the game log or a JSON file. |
/mantle dump_loot_modifiers |
Exports all active global loot modifiers to the mantle_data_dump folder. |
/mantle view_recipe <id> |
Displays the raw JSON structure of a specific recipe. |
/mantle harvest_tiers |
Prints the current Forge harvest tier registry (e.g., Wood, Stone, Iron, Diamond). |
/mantle hunger <value> |
Sets or adds to the player's current hunger level (useful for testing). |
/mantle remove recipes <id> |
Generates a JSON snippet to disable a specific recipe via data pack. |
/mantle sources <path> |
Identifies which mod or data pack is providing a specific resource file. |
Data Pack and Resource Pack Integration#
Mantle significantly expands the capabilities of standard Minecraft data packs and resource packs.
Loot Injectors
Mantle's Loot Injector system allows modders to add items to existing loot tables (like dungeon chests or mob drops) without overwriting the entire table. This prevents conflicts between multiple mods trying to modify the same loot source.
Fluid Transfer System
Mantle provides a JSON-based system to define how items interact with fluids. This allows modpack makers to make any item (like a custom bottle or bucket) hold fluids without writing Java code. It supports:
- Fluid Overrides: Forcing an item to behave as a fluid container.
- Fluid Tooltips: Customizing how fluid amounts (mB vs. Buckets) appear in item descriptions.
JSON Things (1.18+)
Mantle supports "Thing Packs," which allow for the creation of entirely new blocks and items using only JSON files. This is highly utilized in "Low Code" modding environments to add decorative blocks or simple tools without a full development workspace.
Resource Colors
Mantle includes a resource color system that allows data packs to define specific text colors for materials and items in tooltips, ensuring visual consistency across different mods' UIs.
Technical JSON Formats#
For developers and advanced users, Mantle introduces several custom JSON types used in recipes and predicates:
- Ingredients: Enhanced version of vanilla ingredients that can list multiple matching entries and NBT data.
- Predicates: Logic gates for JSON (e.g.,
mantle:has_effect,mantle:sprinting,mantle:blocking) used to determine if a condition is met on an entity or block. - Fluid Textures: A standardized format for defining fluid still and flowing textures, including color tinting and luminosity.
- Station Slot Layouts: JSON files that define the arrangement of slots in the Tinker Station or Anvil, used for in-game documentation.