Furnace (Minecraft)
Description
Converts an input item into an output itemstack after a set amount of time, with the ability to give experience and using fuel to run.
Identifier
Refer to this via any of the following:
furnace/* Used as page default */
Furnace
Adding Recipes
Adds a recipe in the format
input
,output
:groovyfurnace.add(IIngredient, ItemStack)
Adds a recipe in the format
input
,output
,experience
:groovyfurnace.add(IIngredient, ItemStack, float)
Example
furnace.add(ore('ingotIron'), item('minecraft:diamond'))
furnace.add(item('minecraft:nether_star'), item('minecraft:clay') * 64, 13)
Recipe Builder
Just like other recipe types, the Furnace also uses a recipe builder.
Don't know what a builder is? Check the builder info page out.
furnace.recipeBuilder()
float
. Sets the experience rewarded for smelting the given input. Requires greater than or equal to 0. (Default0.0f
).groovyexp(float)
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.cleanroommc.groovyscript.compat.vanilla.Furnace$Recipe
).groovyregister()
Example
furnace.recipeBuilder()
.input(ore('ingotGold'))
.output(item('minecraft:nether_star'))
.exp(0.5)
.register()
Removing Recipes
Removes all recipes that match the given input:
groovyfurnace.removeByInput(ItemStack)
Removes all recipes that match the given output:
groovyfurnace.removeByOutput(IIngredient)
Removes all registered recipes:
groovyfurnace.removeAll()
Example
furnace.removeByInput(item('minecraft:clay'))
furnace.removeByOutput(item('minecraft:brick'))
furnace.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:
groovyfurnace.streamRecipes()