Animal Harvest (Roots 3)
Description
Animal Harvest is a ritual that drops items from nearby mob's based on that mobs loottable without harming the mob. Only applies to allowed mobs.
Identifier
Refer to this via any of the following:
mods.roots.animal_harvest/* Used as page default */
mods.roots.animalharvest
mods.roots.animalHarvest
mods.roots.AnimalHarvest
Adding Recipes
Recipe Builder
Just like other recipe types, the Animal Harvest also uses a recipe builder.
Don't know what a builder is? Check the builder info page out.
mods.roots.animal_harvest.recipeBuilder()
ResourceLocation
. Sets the Resource Location of the recipe.groovyname(String) name(ResourceLocation)
Class<? extends EntityLivingBase>
. Sets the target entity. Requires not null.groovyentity(EntityEntry)
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
orepicsquid.roots.recipe.AnimalHarvestRecipe
).groovyregister()
Example
mods.roots.animal_harvest.recipeBuilder()
.name('wither_skeleton_harvest')
.entity(entity('minecraft:wither_skeleton'))
.register()
mods.roots.animal_harvest.recipeBuilder()
.entity(entity('minecraft:enderman'))
.register()
Removing Recipes
Removes any Animal Harvest recipe with the given entity:
groovymods.roots.animal_harvest.removeByEntity(EntityEntry)
Removes the Animal Harvest recipe with the given name:
groovymods.roots.animal_harvest.removeByName(ResourceLocation)
Removes all registered recipes:
groovymods.roots.animal_harvest.removeAll()
Example
mods.roots.animal_harvest.removeByEntity(entity('minecraft:pig'))
mods.roots.animal_harvest.removeByName(resource('roots:chicken'))
mods.roots.animal_harvest.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.roots.animal_harvest.streamRecipes()