-
Notifications
You must be signed in to change notification settings - Fork 4
For Developers
Whether you'd like to join our little coven of developers or simply make your nature alternatives compatible with our rituals, this is the place for you!
There are multiple ways to manipulate how other blocks interact with Witchery
In Witchery, the core of any medium to large-scale Witch-like activities is the Altar. The Altar draws power from the surrounding flora within its range (16-32 in base Witchery). The values for power and its limits are established via a data-driven structure.
This is an example file in data/example/nature/new_dirt.json
{
"block": "example:new_dirt",
"power": 1,
"limit": 80
}This file enables example:new_dirt to be picked up by an Altar a maximum of 80 times and provides 1 base altar power per instance.
So, 80 example:new_dirt would provide 80 base altar power to an Altar.
This also works for tags. However, tags are searched through AFTER blocks, so any block that has its own unique JSON file will not fall under your tag
This is an example file in data/example/nature/tag/mod_flowers.json
{
"tag": "example:mod_flowers",
"power": 3,
"limit": 80
}This file enables any example:mod_flowers block to provide an Altar 3 base power, up to 80 total example:mod_flowers blocks. Yes, the other thing about using tags is that the limit is shared between all blocks under the provided tag.
Additionally, these are just guidelines, you don't need to follow any particular folder structure past nature, that includes the JSON files as, due to how I made the parser, this is entirely possible.
This file is data/example/nature/i/dont/follow/guidelines.json
[
{
"block": "example:new_dirt",
"limit": 80,
"power": 1
},
{
"power": 1,
"tag": "example:mod_flowers",
"limit": 80
}
]The biggest aspect of Witchery are its Rituals. Rituals consist of a, at max, 15 x 15 area where you can sacrificed items (or entities) to get some result, whether that be an imbued item or opening the Gates to Hell.
That being said, adding new rituals is relatively easy even if the current JSONs are a bit complicated looking!
Here is an example from the actual mod of a Ritual that teleports the caster to the position bound to a waystone!
data/witchery/recipe/ritual/air_from_waystone.json
{
"type": "witchery:ritual",
"altarPower": 0, //If the ritual ticks, this will be drained every tick, otherwise this is a flat cost
"blockMapping": { //This is for the pattern
"G": "witchery:golden_chalk",
"R": "witchery:otherwhere_chalk"
},
"celestialConditions": [ //Supports day, night, full_moon, new_moon
"day"
],
"commands": [
{
"type": "end", //start, tick or end. tick gets executed every tick the ritual is active
"command": "tp {owner} {waystonePos}"
}
],
"floatingItemOutput": false, //true if you want the output items to float mid-air
"inputEntities": [],
"inputItems": [
{
"id": "witchery:waystone"
}
],
"isInfinite": false, //when true, this will tick until altar power is depleted or interrupted by player
"outputEntities": [
"minecraft:chicken"
],
"outputItems": [],
"pattern": [ //Pattern of the ritual circle, the middle will always have to be a G and can be of any size, this is a 7x7
"__RRR__",
"_R___R_",
"R_____R",
"R__G__R",
"R_____R",
"_R___R_",
"__RRR__"
],
"ritual": {
"id": "witchery:empty" //Standard ritual with basic handling, this is where code defined rituals are used
},
"ticks": 20 //tick until the ritual end
}Ritual recipes supports various placeholders when executing commands:
{owner} - the Player who activates the ritual
{waystonePos} - the global position of a waystone used in the recipe
{taglockEntity} - a taglocks bound entity
{taglockPlayer} - a taglocks bound player
{taglockPlayerOrEntity} - either a player or an entity, with priority for player
{time} - time of day
{chalkPos} - position of the golden ritual chalk
I'll make a detailed walk-through later
The Cauldron is a block used for two different recipe types. The one we cover here is purely crafting recipes, so if you want to brew potions, go here.
Now that I've disclosed that, lets got on shall we? I will explain the unusual fields at the bottom. Here is an example from within the mod itself.
data/witchery/recipe/cauldron_crafting/golden_chalk_from_mandrake_root_and_gold_nugget_and_ritual_chalk.json
{
"type": "witchery:cauldron_crafting",
"altarPower": 100,
"inputItems": [
{
"color": 123456,
"itemStack": {
"count": 1,
"id": "witchery:mandrake_root"
},
"order": 0
},
{
"color": 654321,
"itemStack": {
"count": 1,
"id": "minecraft:gold_nugget"
},
"order": 1
},
{
"color": 321654,
"itemStack": {
"count": 1,
"id": "witchery:ritual_chalk"
},
"order": 2
}
],
"outputItems": [
{
"count": 1,
"id": "witchery:golden_chalk"
}
]
}So, lets go over the fields.
-
altarPower- the amount of Altar Power your recipe needs from a nearby Altar. Its our power system in a sense. -
inputItems- The input for your recipe.-
color- the color the cauldron's water turns when throwing in this ingredient -
order- the order to check ingredients in
-
If you've done recipes before, the other fields should be very familiar.
The Cauldron is a block used for two different recipe types. The one we cover here is purely brewing recipes, so if you want to craft, go here.
Now that that is out of the way, we can go on to dissect a recipe from the mod itself.
data/witchery/recipe/cauldron_brewing/honey_bottle_from_apple_and_sugar.json
{
"type": "witchery:cauldron_brewing",
"altarPower": 100,
"inputItems": [
{
"color": 10257594,
"itemStack": {
"count": 1,
"id": "minecraft:apple"
},
"order": 0
},
{
"color": 16755227,
"itemStack": {
"count": 1,
"id": "minecraft:sugar"
},
"order": 1
}
],
"outputItem": {
"count": 1,
"id": "minecraft:honey_bottle"
}
}So, lets go over the unusual fields.
-
altarPower- the amount of Altar Power your recipe needs from a nearby Altar. Its our power system in a sense. -
inputItems- The input for your recipe.-
color- the color the cauldron's water turns when throwing in this ingredient -
order- the order to check ingredients in
-
Everything else should look familiar to those who have made recipes before.
The primary physical resource of Witchery is the quintessential Jar. These Jars can store fumes used in other recipes but how does one get these fumes? Well, the way to get most basic fumes is via a Witches Oven. This section will discuss creating new recipes for the Witches Oven.
Here is an example from the mod itself
Path: data/witchery/recipes/oven/wood_ash.json
{
"type": "witchery:oven_cooking",
"cookingTime": 85,
"experience": 0.5,
"extraIngredient": {
"item": "witchery:jar"
},
"extraOutput": {
"id": "witchery:foul_fume"
},
"extraOutputChance": 0.5,
"ingredient": {
"tag": "minecraft:logs"
},
"result": {
"id": "witchery:wood_ash"
}
}So, here is a breakdown of the... unusual bits of the recipe
-
extraIngredient- This is essentially the Jar. If you don't wanna add anything else to put here, just let it staywitchery:jar -
extraOutput- This is the collected fume of the recipe, the secondary output essentially. -
extraOutputChance- The chance for a secondary output
I'm sure if you've done recipes before the other fields are pretty recognizable.