Animator (The Betweenlands)
Description
Converts an input item, Life amount from Life Crystals, and Fuel from Sulfur into an output itemstack, summoning an entity, a random item from a loottable, or summoning an entity and outputting an itemstack.
Identifier
Refer to this via any of the following:
mods.betweenlands.animator
mods.betweenlands.Animator
mods.thebetweenlands.animator/* Used as page default */
mods.thebetweenlands.Animator
Adding Recipes
Add the given recipe to the recipe list:
groovymods.thebetweenlands.animator.add(IAnimatorRecipe)
Recipe Builder
Just like other recipe types, the Animator also uses a recipe builder.
Don't know what a builder is? Check the builder info page out.
mods.thebetweenlands.animator.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 fuel consumed. Requires greater than or equal to 0. (Default0
).groovyfuel(int)
int
. Sets the life consumed from the life crystal. Requires greater than or equal to 0. (Default0
).groovylife(int)
Class<? extends Entity>
. Sets the entity being spawned.groovyentity(EntityEntry) entity(Class<? extends Entity>)
ResourceLocation
. Sets the entity to render, typically the same as the entity to be spawned.groovyrender(ResourceLocation)
ResourceLocation
. Sets the LootTable used to generate outputs.groovylootTable(ResourceLocation)
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
orthebetweenlands.api.recipes.IAnimatorRecipe
).groovyregister()
Example
mods.thebetweenlands.animator.recipeBuilder()
.input(item('minecraft:clay'))
.output(item('minecraft:diamond'))
.life(1)
.fuel(1)
.register()
mods.thebetweenlands.animator.recipeBuilder()
.input(item('minecraft:gold_ingot'))
.lootTable(resource('minecraft:entities/zombie'))
.life(5)
.fuel(1)
.register()
mods.thebetweenlands.animator.recipeBuilder()
.input(item('minecraft:gold_block'))
.entity(entity('minecraft:zombie').getEntityClass())
.life(1)
.fuel(5)
.register()
mods.thebetweenlands.animator.recipeBuilder()
.input(item('minecraft:diamond'))
.entity(entity('minecraft:enderman'))
.output(item('minecraft:clay'))
.life(3)
.fuel(10)
.register()
Removing Recipes
Removes the given recipe from the recipe list:
groovymods.thebetweenlands.animator.remove(IAnimatorRecipe)
Removes all entries that match the given entity:
groovymods.thebetweenlands.animator.removeByEntity(Class<? extends Entity>)
Removes all entries that match the given entity:
groovymods.thebetweenlands.animator.removeByEntity(EntityEntry)
Removes all recipes that match the given input:
groovymods.thebetweenlands.animator.removeByInput(IIngredient)
Removes all entries that output the given Loot Table:
groovymods.thebetweenlands.animator.removeByLootTable(ResourceLocation)
Removes all recipes that match the given output:
groovymods.thebetweenlands.animator.removeByOutput(IIngredient)
Removes all registered recipes:
groovymods.thebetweenlands.animator.removeAll()
Example
mods.thebetweenlands.animator.removeByEntity(entity('thebetweenlands:sporeling'))
mods.thebetweenlands.animator.removeByInput(item('thebetweenlands:bone_leggings'))
mods.thebetweenlands.animator.removeByLootTable(resource('thebetweenlands:animator/scroll'))
mods.thebetweenlands.animator.removeByOutput(item('thebetweenlands:items_misc:46'))
mods.thebetweenlands.animator.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.thebetweenlands.animator.streamRecipes()