-
Notifications
You must be signed in to change notification settings - Fork 5
Recipes
By default, the mod does not provide any recipes. Since Summoning Rituals is made for pack developers, you have to add recipes on your own.
You can do that by using KubeJS or with datapacks because all recipes are JSON-based.
This section explains how to add new recipes with KubeJS. The mod has native integration for it.
In order to create a custom recipe, you have to use the event.recipes.summoningrituals.altar
function inside the recipes
event. It takes a single argument which is the Catalyst which can be any IngredientJS
which means tags are also supported. The maximum amount is 1.
1.18
onEvent('recipes', event => {
// starts the altar recipe builder with an Iron Ingot as Catalyst
event.recipes.summoningrituals.altar("iron_ingot")
// more code
});
1.19
ServerEvents.recipes(event => {
// starts the altar recipe builder with an Iron Ingot as Catalyst
event.recipes.summoningrituals.altar("iron_ingot")
// more code
});
A summoning recipe can have two kinds of outputs: mob outputs and item outputs.
They are not exclusive and a recipe can have both output types.
For a simple item output, you can append one of the following functions to the altar recipe builder:
// adds 3 Gold Ingots as output
.itemOutput('3x gold_ingot')
// adds a single Diamond as output
.itemOutput('diamond')
// adds 2 Stone Swords with specific NBT as output
.itemOutput(Item.of('stone_sword', 2, { foo: 'bar' }))
// omitting the namespace uses minecraft by default, for modded items, use this
.itemOutput('5x quark:limestone')
The functions can be chained to add more outputs to the recipe. In general, they all accept every kind of ItemStackJS
.
In case you want to adjust the offset or the spread for an item output, you need to use the item output builder:
.itemOutput(
SummoningOutput.item(Item.of('stone_sword', 2, { Damage: 5 }))
.offset(5, 2, 3)
.spread(3, 0, 3)
)
There is also a simple form for adding a mob output but since KubeJS has no wrapper for entities, you need to use the mob output builder for more advanced information:
// adds a single Pig as output
.mobOutput('pig')
// adds a single Blizz from Thermal as output
.mobOutput('thermal:blizz')
The mob output builder also supports adjusting the count, the offset, the spread and the NBT:
.mobOutput(
SummoningOutput.mob('blaze')
.count(3)
.offset(5, 2, 3)
.spread(3, 0, 3)
// gives all three blazes 50 health
.data({ Health: 50, Attributes: [{ Name: 'generic.max_health', Base: 50 }] })
)
Inputs refer to items that are placed on the Altar and consumed within the summoning ritual. They can be all kinds of IngredientJS
which means they also support tags.
// adds 64 Stone as input
.input('64x minecraft:stone')
// adds 2 Stone Swords with specific NBT as input
.input(Item.of('stone_sword', 2, { Damage: 5 }).strongNBT())
// adds 10 Amethyst Shards as input
.input(Item.of('amethyst_shard', 10))
// adds a single Glass Block from the glass tag as input
.input(Ingredient.of('#forge:glass'))
// the input function also supports varargs if you prefer that
.input('stone', '2x apple', 'thermal:blizz_powder')
Sacrifices are mobs that are killed upon starting the ritual. You could also call them mob inputs. Sacrifices won't drop any loot when killed and will die instantly. They will only be used for the ritual if they are within the Sacrifice Region.
// adds 3 Pigs as sacrifice
.sacrifice('pig', 3)
// adds a single Sheep as sacrifice
.sacrifice('sheep')
// adds a single Blizz from Thermal as sacrifice
.sacrifice('thermal:blizz')
The region of sacrifices can be altered per recipe as well but it is optional. If not present, the default region (5x3x5) will be used.
// this is the general format
.sacrificeRegion(width, height)
// sets the sacrifice region to 7x3x7 around the altar
.sacrificeRegion(5, 2)
The recipe time defines the number of ticks (20 ticks = 1 second) the ritual requires in order to finish. It's the duration between inserting the Catalyst and the spawning of the outputs.
By default, the recipe time is 100 ticks (5 seconds).
// sets the recipe time to 200 ticks (10 seconds)
.recipeTime(200)
The block below defines the exact block that has to be below the altar in order to start the ritual. It also supports block states so you can also use blocks that have to be rotated in a specific direction or lit furnaces.
By default, it can be any block and it won't be displayed in JEI/REI.
// sets the required block below to Stone
.blockBelow('minecraft:stone')
// sets the required block below to a lit Furnace, unlit won't work
.blockBelow('minecraft:furnace', { lit: true })
This defines whether it has to be day or night in order for the ritual to work. Valid values are day
and night
as strings, case insensitive.
By default, the daytime is set to any
.
.dayTime('day')
// this works too
.dayTime('nIGhT')
The weather condition defines the weather required in order for the ritual to work. Valid values are clear
, rain
and thunder
as strings, case insensitive. clear
refers to sunny aka not raining and not thundering.
By default, the weather is set to any
.
.weather('clear')
.weather('rain')
.weather('thunder')
event.recipes.summoningrituals
.altar(Ingredient.of("#forge:ingots"))
.itemOutput('3x gold_ingot')
.itemOutput('diamond')
.mobOutput('wolf')
.mobOutput(
SummoningOutput.mob('blaze')
.count(5)
.offset(0, 3, 0)
.spread(4, 0, 4)
.data({ Health: 50, Attributes: [{ Name: 'generic.max_health', Base: 50 }] })
)
.input('64x minecraft:stone')
.input('5x prismarine_shard')
.input('10x amethyst_shard')
.input(Ingredient.of('#forge:glass'))
.sacrifice('pig', 3)
.sacrifice('sheep')
.sacrifice('cow')
.sacrificeRegion(3, 3)
.recipeTime(200)
.blockBelow('minecraft:furnace', { lit: true })
.dayTime('day')
.weather('clear');
This section won't explain how to create datapacks or where to store them. Please read the Minecraft wiki to learn how to create them.
The most important thing is that the recipe type needs to be summoningrituals:altar
.
Here is a brief overview of how a recipe could look:
{
"type": "summoningrituals:altar",
"catalyst": { "tag": "forge:ingots" },
"outputs": [
{ "item": "minecraft:gold_ingot", "count": 3 },
{ "item": "minecraft:diamond" },
{ "mob": "minecraft:wolf" },
{
"mob": "minecraft:blaze",
"count": 5,
"data": "{Attributes:[{Base:50.0d,Name:\"generic.max_health\"}],Health:50.0d}",
"offset": { "x": 0, "y": 3, "z": 0 },
"spread": { "x": 4, "y": 0, "z": 4 }
}
],
"inputs": [
{ "ingredient": { "item": "minecraft:stone" }, "count": 64 },
{ "ingredient": { "item": "minecraft:prismarine_shard" }, "count": 5 },
{ "ingredient": { "item": "minecraft:amethyst_shard" }, "count": 10 },
{ "tag": "forge:glass" }
],
"sacrifices": {
"mobs": [{ "mob": "minecraft:pig", "count": 3 }, { "mob": "minecraft:sheep" }, { "mob": "minecraft:cow" }],
"region": { "x": 3, "y": 3, "z": 3 }
},
"recipe_time": 200,
"block_below": { "block": "minecraft:furnace", "properties": { "lit": "true" } },
"day_time": "DAY",
"weather": "CLEAR"
}
This example will result in the following recipe:
The Catalyst can be any Ingredient
which means tags are also supported. The maximum amount is 1.
// any ingot as catalyst
"catalyst": { "tag": "forge:ingots" }
// iron ingot as catalyst
"catalyst": { "item": "minecraft:iron_ingot" }
A summoning recipe can have two kinds of outputs: mob outputs and item outputs.
They are not exclusive and a recipe can have both output types.
Outputs need to be grouped inside a JSON array:
"outputs": [
// your item and mob outputs here
]
For a simple item output, you can use one of the following snippets:
// adds 3 Gold Ingots as output
{ "item": "minecraft:gold_ingot", "count": 3 }
// adds a single Diamond as output
{ "item": "minecraft:diamond" }
In case you want to adjust the offset, the spread or the NBT for an item output in a different way, you can use additional properties:
{
"item": "minecraft:iron_sword",
"count": 8,
"nbt": "{Damage:0}",
"offset": { "x": 0, "y": 3, "z": 0 },
"spread": { "x": 4, "y": 0, "z": 4 }
}
You can simply add a mob as output by using the following snippets:
// adds a single pig as output
{ "mob": "minecraft:pig" }
// adds a single Blizz from Thermal as output
{ "mob": "thermal:blizz" },
If you want to edit the count, the offset, the spread and the NBT:
{
"mob": "minecraft:blaze",
"count": 5,
"data": "{Attributes:[{Base:50.0d,Name:\"generic.max_health\"}],Health:50.0d}",
"offset": { "x": 0, "y": 3, "z": 0 },
"spread": { "x": 4, "y": 0, "z": 4 }
}
Inputs refer to items that are placed on the Altar and consumed within the summoning ritual. They can be Ingredient
s so they also support tags.
Inputs need to be grouped inside a JSON array:
"inputs": [
// your inputs here
]
You can simply add an item input by using the following snippets:
// adds 64 Stone as input
{ "ingredient": { "item": "minecraft:stone" }, "count": 64 }
// adds a single Stone as input
{ "item": "minecraft:stone" }
// adds 10 Amethyst Shards as input
{ "ingredient": { "item": "minecraft:amethyst_shard" }, "count": 10 }
// adds a single Glass Block from the glass tag as input
{ "tag": "forge:glass" }
// adds 10 Glass Blocks from the glass tag as input
{ "ingredient": { "tag": "forge:glass" }, "count": 10 }
Sacrifices are mobs that are killed upon starting the ritual. You could also call them mob inputs. Sacrifices won't drop any loot when killed and will die instantly. They will only be used for the ritual if they are within the Sacrifice Region.
The sacrifices need to be grouped inside a JSON array within a JSON object:
// this JSON object holds all information regarding sacrifices
// optional | if not present, the ritual will not require sacrifices
"sacrifices": {
"mobs": [
// this JSON array holds the sacrifices
]
}
You can simply add a sacrifice by using the following snippets:
// adds 3 Pigs as sacrifice
{ "mob": "minecraft:pig", "count": 3 }
// adds a single Sheep as sacrifice
{ "mob": "minecraft:sheep" }
// adds a single Blizz from Thermal as sacrifice
{ "mob": "thermal:blizz" }
The region of sacrifices can be altered per recipe as well but it is optional. If not present, the default region (5x3x5) will be used.
"sacrifices": {
"mobs": [],
"region": { "x": 3, "y": 3, "z": 3 }
}
The recipe time defines the number of ticks (20 ticks = 1 second) the ritual requires in order to finish. It's the duration between inserting the Catalyst and the spawning of the outputs.
By default, the recipe time is 100 ticks (5 seconds).
// sets the recipe time to 200 ticks (10 seconds)
"recipe_time": 200
The block below defines the exact block that has to be below the altar in order to start the ritual. It also supports block states so you can also use blocks that have to be rotated in a specific direction or lit furnaces.
By default, it can be any block and it won't be displayed in JEI/REI.
// sets the required block below to Stone
"block_below": { "block": "minecraft:stone" }
// sets the required block below to a lit Furnace, unlit won't work
"block_below": { "block": "minecraft:furnace", "properties": { "lit": "true" } }
This defines whether it has to be day or night in order for the ritual to work. Valid values are day
and night
as strings, case insensitive.
By default, the daytime is set to any
.
"day_time": "day"
// this works too
"day_time": "nIGhT"
The weather condition defines the weather required in order for the ritual to work. Valid values are clear
, rain
and thunder
as strings, case insensitive. clear
refers to sunny aka not raining and not thundering.
By default, the weather is set to any
.
"weather": "clear"
"weather": "rain"
"weather": "thunder"