Pacifist (Roots 3)
Description
Pacifist is a list of entities which killing will give the player the advancement 'Untrue Pacifist'.
Identifier
Refer to this via any of the following:
mods.roots.pacifist/* Used as page default */
mods.roots.PacifistAdding Entries
Recipe Builder
Just like other recipe types, the Pacifist also uses a recipe builder.
Don't know what a builder is? Check the builder info page out.
Recipe Builder
Create the Recipe Builder.
groovymods.roots.pacifist.recipeBuilder()
ResourceLocation. Sets the Resource Location of the recipe.groovyname(String) name(ResourceLocation)Class<? extends Entity>. Sets the target entity. Requires not null.groovyentity(EntityEntry)
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.recipe.PacifistEntry).groovyregister()
Example
mods.roots.pacifist.recipeBuilder()
.name('wither_skeleton_pacifist')
.entity(entity('minecraft:wither_skeleton'))
.register()Removing Entries
Removes the Pacifist entry with the given Entity class:
groovymods.roots.pacifist.removeByClass(Class<? extends Entity>)Removes the Pacifist entry for the given Entity:
groovymods.roots.pacifist.removeByEntity(EntityEntry)Removes the Pacifist entry with the given name:
groovymods.roots.pacifist.removeByName(ResourceLocation)Removes all registered recipes:
groovymods.roots.pacifist.removeAll()
Example
mods.roots.pacifist.removeByEntity(entity('minecraft:cow'))
mods.roots.pacifist.removeByName(resource('minecraft:chicken'))
mods.roots.pacifist.removeAll()Getting the value of entries
Iterates through every entry in the registry, with the ability to call remove on any element to remove it:
groovymods.roots.pacifist.streamRecipes()
