Enchanter (Aether Legacy)
Description
Enchanting is a mechanic used to create new items, as well as repair tools, armor, and weapons, using the Altar block.
Identifier
Refer to this via any of the following:
mods.aether_legacy.enchanter/* Used as page default */
mods.aether_legacy.Enchanter
mods.aether.enchanter
mods.aether.Enchanter
Adding Recipes
Adds an Enchanting recipe in the format
input
,output
,time
.:groovymods.aether_legacy.enchanter.add(ItemStack, ItemStack, int)
Recipe Builder
Just like other recipe types, the Enchanter also uses a recipe builder.
Don't know what a builder is? Check the builder info page out.
mods.aether_legacy.enchanter.recipeBuilder()
IngredientList<IIngredient>
. Sets the item inputs of the recipe. Requires exactly 1.groovyinput(IIngredient) input(IIngredient...) input(Collection<IIngredient>)
ItemStackList
. Sets the item outputs of the recipe. Requires exactly 1.groovyoutput(ItemStack) output(ItemStack...) output(Collection<ItemStack>)
int
. Sets the time the recipe takes to complete. Requires greater than or equal to 0. (Default0
).groovytime(int)
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.gildedgames.the_aether.api.enchantments.AetherEnchantment
).groovyregister()
Example
mods.aether_legacy.enchanter.recipeBuilder()
.input(item('minecraft:clay'))
.output(item('minecraft:diamond'))
.time(200)
.register()
Removing Recipes
Removes all recipes that match the given output:
groovymods.aether_legacy.enchanter.removeByOutput(IIngredient)
Removes all registered recipes:
groovymods.aether_legacy.enchanter.removeAll()
Example
mods.aether_legacy.enchanter.removeByOutput(item('aether_legacy:enchanted_gravitite'))
mods.aether_legacy.enchanter.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.aether_legacy.enchanter.streamRecipes()