Recipe Components - SlimeKnights/Mantle GitHub Wiki

This page describes additional common JSON recipe features that Mantle supports.

Table of Contents

ResourceLocation

String representing the registry name of an object in the game. Format is always <domain>:<name>, where <domain> typically represents a mod or datapack ID, and <name> is the specific name for this object. Valid characters are any lowercase letter, any number, -, _, and /. A single : is allowed between the domain and name.

Ingredient

Vanilla recipe input. Can be either an item stack or a tag, or additional custom types added by mods. Mantle adds a few custom ingredient types that work in any recipes with ingredient support.

Fluid Container

Ingredient that matches a fluid container containing exactly a specified fluid amount. This ingredient also requires that emptying the container is the same as the result of ItemStack::getContainerItem as there is no API in Forge for an ingredient to specify what it does when drained.

Keys

  • type (string): Always mantle:fluid_container
  • fluid (FluidIngredient): Fluid to match. Must be an exact match
  • display (Ingredient): Ingredient to display items in recipe views such as JEI. Typically a good idea to find a container which holds the desired amount of fluid.

Intersection

Ingredient that matches anything matched by all the contained ingredients.

Keys

  • type (string): Always mantle:intersection
  • ingredients (array): List of Ingredients. For a result to match, it must match all contained ingredients

Without

Ingredient that matches anything in the first ingredient that is not in the second.

Keys

  • type (string): Always mantle:without
  • base (Ingredient): The main ingredient to match. Anything matching this ingredient but not matching without is valid.
  • without (Ingredient): Ingredient to exclude.

A fluid recipe input. The input can be either an object, or an array of fluid ingredient objects.

Keys

  • name (string): The fluid's registry name. Cannot be used alongside tag
  • tag (string): Fluid tag to match. Cannot be used alongside name
  • amount (integer): The fluid amount in millibuckets.

Examples

Matches 144mb of molten gold from Tinkers' Construct:

"fluid": {
  "name": "tconstruct:molten_gold",
  "amount": 144
}

Matches 1000mb of water from Minecraft or 500mb of any fluid tagged as steam:

"fluid": [
  {
    "name": "minecraft:water",
    "amount": 1000
  },
  {
    "tag": "forge:steam",
    "amount": 500
  }
]

An entity. Used for entity melting. The input can be either an object, or an array of entity ingredient objects.

Keys

Any of these three keys can be set, but no more than one.

  • type: Registry name of the entity type.
  • types: An array of entity type registry names.
  • tag: Entity type tag.

Example

Matches the creeper entity

"entity": {
  "type": "minecraft:creeper"
}

Matches any entity tagged as skeletons or the skeleton horse:

"entity": [
  {
    "tag": "minecraft:skeletons"
  },
  {
    "type": "minecraft:skeleton_horse"
  }
]

Matches villagers or wandering traders:

"entity": {
  "types": [
    "minecraft:villager",
    "minecraft:wandering_trader"
  ]
}

Similar to Ingredient, but needs at least amount_needed of the ingredient to be present.

Keys

  • ingredient (Ingredient): Optional, if missing, the whole object is considered an ingredient. Determines the matched ingredient
  • amount_needed (integer): Defaults to 1. The amount of ingredient needed for the recipe.

Examples

Matches a single iron reinforcement from Tinkers' Construct:

{
  "item": "tconstruct:iron_reinforcement"
}

Matches 9 or more cobalt nuggets from Tinkers' Construct:

{
  "ingredient": {
    "item": "tconstruct:cobalt_nugget"
  },
  "amount_needed": 9
}

Used for recipe outputs to allow crafting a result from a tag, used for better mod support.

Keys

  • item: Item registry name. Used for a strict item output. Cannot be used alongside tag
  • tag: Forge tag. Result will be the highest priority item in the tag, as determined by Mantle's config. Cannot be used alongside item
  • count: Integer. Defaults to 1. The item count.
  • nbt: NBT for the item. Only available if item is set

Example

Return the highest priority invar ingot:

"result": {
  "tag": "forge:ingots/invar"
}

Return the Tinkers' Construct copper ingot:

"result": {
  "item": "tconstruct:copper_ingot"
}

FluidStack

Similar to FluidIngredient, but cannot take a tag (the fluid must be exact). Not added by Mantle, but Mantle adds serializing and deserializing support in RecipeHelper.

Example

"result": {
  "fluid": "tconstruct:molten_electrum",
  "amount": 288
}
⚠️ **GitHub.com Fallback** ⚠️