Rituals (Bewitchment)
Description
Converts up to 10 input ingredients into a ritual. The ritual can output up to 5 items, can require specific small, medium, and large circle sizes, can require a specific type for each circle, can require a specific entity nearby as a sacrifice, can set the time the ritual takes, and can set the Magic Power consumed to start and run the ritual.
Note
Due to the complexity of custom rituals, only the basic item output rituals can be constructed with the Recipe Builder. To create your own custom rituals, extend the class com.bewitchment.api.registry.Ritual
and add it via mods.bewitchment.ritual.add(Ritual)
.
Identifier
Refer to this via any of the following:
mods.bewitchment.ritual/* Used as page default */
mods.bewitchment.Ritual
Adding Recipes
Adds the recipe:
groovymods.bewitchment.ritual.add(Ritual)
Recipe Builder
Just like other recipe types, the Rituals also uses a recipe builder.
Don't know what a builder is? Check the builder info page out.
Recipe Builder
Create the Recipe Builder.
groovymods.bewitchment.ritual.recipeBuilder()
ResourceLocation
. Sets the Resource Location of the recipe.groovyname(String) name(ResourceLocation)
IngredientList<IIngredient>
. Sets the item inputs of the recipe. Requires greater than or equal to 1 and less than or equal to 10.groovyinput(IIngredient) input(IIngredient...) input(Collection<IIngredient>)
ItemStackList
. Sets the item outputs of the recipe. Requires greater than or equal to 0 and less than or equal to 5.groovyoutput(ItemStack) output(ItemStack...) output(Collection<ItemStack>)
int
. Sets the type of chalk used for the big circle. (Default0
).groovybig(int)
int
. Sets the time in ticks the ritual takes to complete. Requires greater than 0. (Default0
).groovytime(int)
int
. Sets the type of chalk used for the small circle. Requires greater than 0. (Default0
).groovysmall(int)
int
. Sets the type of chalk used for the medium circle. (Default0
).groovymedium(int)
Predicate<EntityLivingBase>
. Sets what entities are valid sacrifices, if any.groovysacrifice(EntityEntry) sacrifice(Predicate<EntityLivingBase>)
int
. Sets the Magic Power consumed every tick. Requires greater than 0. (Default0
).groovyrunningPower(int)
int
. Sets the starting Magic Power consumed by the ritual. Requires greater than 0. (Default0
).groovystartingPower(int)
boolean
. Sets if the ritual can be activated via a Waystone instead of immediately. (Defaulttrue
).groovycanBePerformedRemotely(boolean)
First validates the builder, returning
null
and outputting errors to the log file if the validation failed, then registers the builder and returns the registered object. (returnsnull
orcom.bewitchment.api.registry.Ritual
).groovyregister()
Removing Recipes
Removes the recipe with the given Resource Location:
groovymods.bewitchment.ritual.remove(ResourceLocation)
Removes the recipe with the given String as its Resource Location:
groovymods.bewitchment.ritual.remove(String)
Removes the recipe:
groovymods.bewitchment.ritual.remove(Ritual)
Removes all recipes that match the given input:
groovymods.bewitchment.ritual.removeByInput(IIngredient)
Removes all recipes that match the given output:
groovymods.bewitchment.ritual.removeByOutput(IIngredient)
Removes all registered recipes:
groovymods.bewitchment.ritual.removeAll()
Example
mods.bewitchment.ritual.removeByInput(item('minecraft:poisonous_potato'))
mods.bewitchment.ritual.removeByOutput(item('bewitchment:purifying_earth'))
mods.bewitchment.ritual.removeAll()
Getting the value of recipes
Iterates through every entry in the registry, with the ability to call remove on any element to remove it:
groovymods.bewitchment.ritual.streamRecipes()