Enchanter (Ender IO)
Description
Convert an input itemstack, player xp, and either a written book and lapis or a custom alternative into an enchanted book.
Identifier
Refer to this via any of the following:
mods.enderio.enchanter/* Used as page default */
mods.enderio.Enchanter
mods.eio.enchanter
mods.eio.Enchanter
Adding Recipes
Adds recipes in the format
enchantment
,input
:groovymods.enderio.enchanter.add(Enchantment, IIngredient)
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.enderio.enchanter.recipeBuilder()
IIngredient
. Sets the item used in the book slot. Requires not null. (Defaultitem('minecraft:writable_book')
).groovycustomBook(IIngredient)
IIngredient
. Sets the key item to create the enchantment. Requires not null.groovyinput(IIngredient)
IIngredient
. Sets the item used in the lapis slot. Requires not null. (Defaultore('gemLapis')
).groovycustomLapis(IIngredient)
int
. Sets the amount of the input item used to create a single level of enchantment. Requires greater than 0. (Default0
).groovyamountPerLevel(int)
Enchantment
. Sets the enchantment applied to the output book. Requires not null.groovyenchantment(Enchantment)
double
. Sets the experience cost multiplier per enchantment level created. (Default1
).groovyxpCostMultiplier(double)
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
orcrazypants.enderio.base.recipe.enchanter.EnchanterRecipe
).groovyregister()
Example
mods.enderio.enchanter.recipeBuilder()
.enchantment(enchantment('minecraft:unbreaking'))
.input(item('minecraft:diamond'))
.register()
mods.enderio.enchanter.recipeBuilder()
.enchantment(enchantment('minecraft:sharpness'))
.input(item('minecraft:clay'))
.amountPerLevel(3)
.xpCostMultiplier(2)
.customBook(item('minecraft:book'))
.customLapis(item('minecraft:diamond'))
.register()
Removing Recipes
Removes entries by enchantment:
groovymods.enderio.enchanter.remove(Enchantment)
Removes all registered recipes:
groovymods.enderio.enchanter.removeAll()
Example
mods.enderio.enchanter.remove(enchantment('minecraft:mending'))
mods.enderio.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.enderio.enchanter.streamRecipes()