Adding Recipes - TeamAOF/Artis GitHub Wiki
There are two primary ways of adding recipes: through recipe JSONs and through LibCD tweakers. Each work similar to vanilla crafting table recipes, but with key differences to account for the catalyst slot.
About Catalysts
Catalysts are placed in a special slot of an Artis table, right below the arrow in the gui. These can be used to give an additional cost to the recipe outside the actual pattern. This cost can be in a number of a certain item, durability from a certain tool, or something else entirely. Catalysts are made up of both an ingredient and a number of the cost to be extracted. This cost can be extracted in various ways. For a cost of 5:
- if the item is a basic item, the table will consume 5 of that item.
- if the item has durability, the table will consume 5 durability from that item.
- mods may define their own behavior for costs, so a battery catalyst may consume 5 energy from that battery
JSON
The type
field in a recipe JSON will be the ID of the table immediately appended with _shaped
or _shapeless
, depending on which type of recipe you would like to create. Patterns and keys are set up as normal, but patterns have width and height limits based on the dimensions of the table instead of the standard 3x3.
The key difference in an Artis recipe is the existence of the catalyst
and cost
fields. The catalyst
field takes a standard ingredient, and cost
takes a number. These are used for the catalyst and its cost as described above.
KubeJS Support
As of 1.4.3, KubeJS support is now available for creating recipes. In order to create a new recipes, make a new .js
script in the kubejs/data/modpack/kubejs/
folder. In there, you need to listen to the recipes
event.
events.listen('recipes', function (event) {
// Register recipes here
})
Inside of there, you can then register your recipes. In order to do this, you need to call event.recipes.modid.tablename_shaped
or event.recipes.modid.tablename_shapeless
for shaped and shapeless recipes respectively. From there, you then make the recipe like these examples:
events.listen('recipes', function (event) {
event.recipes.minecraft.fletching_table_shaped(item.of('minecraft:arrow', 8), [
'F',
'S',
'f'
], {
F: 'minecraft:flint',
S: 'minecraft:stick',
f: 'minecraft:feather'
}, item.of("minecraft:string"), 1) // Last two parameters are catalyst and catalyst cost respectively.
event.recipes.kubejs.skibby_shapeless(item.of('minecraft:ender_eye', 1), ['minecraft:ender_eye']) // Modid is kubejs for every non-existing table created with KubeJS.
})
Sample Code
This sample code will be for a table registered as artis:test_table
.
At file data/artis/recipes/crafting_test.json
:
{
"type": "artis:test_table_shaped",
"pattern": [
"####",
"####"
],
"key": {
"#": {
"item": "minecraft:iron_ingot"
}
},
"result": {
"item": "minecraft:iron_block",
"count": 2
},
"catalyst": {
"item": "minecraft:diamond_pickaxe"
},
"cost": 10
}