Spells (Roots 3)
Description
Controls the recipe for the given spell, the sound, all properties, the base cost, and each modifier's cost.
Warning
This compat is not fully documented. Some or all of its features are not present on the wiki. View the source code to gain an accurate understanding of the compat.
Identifier
Refer to this via any of the following:
mods.roots.spells/* Used as page default */
mods.roots.SpellsAdding Recipes
Recipe Builder
Just like other recipe types, the Spells also uses a recipe builder.
Don't know what a builder is? Check the builder info page out.
mods.roots.spells.costBuilder()
List<IModifierCost>. Sets a list of all cost types used to construct a complex Cost object.groovycost(CostType) cost(CostType, double) cost(CostType, Herb, double) cost(CostType, double, IModifierCore) cost(CostType, IModifierCore, double)First validates the builder, returning
nulland outputting errors to the log file if the validation failed, then registers the builder and returns the registered object. (returnsnullorjava.util.Map<epicsquid.roots.modifiers.CostType, epicsquid.roots.modifiers.IModifierCost>).groovyregister()
Example
mods.roots.spells.costBuilder()
.register()
mods.roots.spells.costBuilder()
.cost(cost('additional_cost'), herb('dewgonia'), 0.25)
.register()
mods.roots.spells.costBuilder()
.cost(cost('additional_cost'), herb('spirit_herb'), 0.1)
.cost(cost('all_cost_multiplier'), null, -0.125)
.register()mods.roots.spells.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 5.groovyinput(IIngredient) input(IIngredient...) input(Collection<IIngredient>)SpellBase. Sets the spell being modified. Requires not null.groovyspell(SpellBase)First validates the builder, returning
nulland outputting errors to the log file if the validation failed, then registers the builder and returns the registered object. (returnsnullorepicsquid.roots.spell.SpellBase$SpellRecipe).groovyregister()
Example
mods.roots.spells.recipeBuilder()
.spell(spell('spell_fey_light'))
.input(item('minecraft:clay'), item('minecraft:diamond'), item('minecraft:gold_ingot'))
.register()