Skip to main content

Spirit Crafting Recipes

The Spirit Crafting Table reuses the vanilla crafting table layout but accepts only two recipe types registered by the mod, mxt:spirit_shaped and mxt:spirit_shapeless. On top of the usual ingredients, each recipe declares an aura cost.

File Location

Spirit crafting recipes are ordinary recipe files, so they go in data/<namespace>/recipe/ within your data pack.

The filename corresponds to its ID. For example, data/example/recipe/spirit_iron_ingot.json has the ID example:spirit_iron_ingot.

The recipe type is written in the file itself: "type": "mxt:spirit_shaped" or "type": "mxt:spirit_shapeless".

Shaped Recipes

A shaped recipe has the following fields.

FieldTypeDefaultDescription
patternString[]requiredOne to three rows, each one to three characters.
keyMap<String, Ingredient>requiredMaps every symbol used in the pattern to its ingredient. Each key must be a single non-space character.
resultItemStackTemplaterequiredThe item produced, written in the vanilla item stack template shape.
auraMap<Resource, NumberProvider>requiredThe aura cost of one craft, per resource. It must not be empty.

The pattern is matched against the 3x3 grid at every possible offset, and slots the pattern leaves out have to be empty.

Shapeless Recipes

A shapeless recipe has the following fields.

FieldTypeDefaultDescription
ingredientsIngredient[]requiredOne to nine ingredients, matched in any order.
resultItemStackTemplaterequiredThe item produced, written in the vanilla item stack template shape.
auraMap<Resource, NumberProvider>requiredThe aura cost of one craft, per resource. It must not be empty.

The ingredients have to match the non-empty slots of the grid exactly, so a shapeless recipe may not leave unrelated items in the grid.

Behaviour

Shaped recipes are checked before shapeless ones, so a shapeless recipe is only used when no shaped recipe matches.

The aura a recipe declares is an amount per resource, given as a number provider; the value is evaluated when the recipe matches and rounded up. While a matching recipe is present the table accepts that recipe's aura and keeps it for that recipe only, so changing the grid or the matched recipe discards what it had stored. The cost is deducted when the result is taken out, and the input items stay in the grid.

Example

A shaped recipe:

{
"type": "mxt:spirit_shaped",
"pattern": [
"FF",
"FF"
],
"key": {
"F": "minecraft:fire_charge"
},
"result": {
"id": "minecraft:magma_block"
},
"aura": {
"mxt:common": 20
}
}

A shapeless recipe, listing one ingredient per item:

{
"type": "mxt:spirit_shapeless",
"ingredients": [
"minecraft:blaze_powder",
"minecraft:prismarine_shard"
],
"result": {
"id": "minecraft:sea_lantern"
},
"aura": {
"mxt:common": 8
}
}

The aura a recipe spends belongs to a resource defined by Resource, and because these are ordinary recipes they are reloaded with the rest of your datapack.