Crafting Table
Adding Recipes
There are 6 similar methods to add shaped and shapeless recipes.
Adds a shaped recipe in the format
output
,input
. (Name is generated). The input is an up to 3x3 matrix of ingredients.groovycrafting.addShaped(ItemStack, List<List<IIngredient>>)
Adds a shaped recipe in the format
name
,output
,input
groovycrafting.addShaped(String, ItemStack, List<List<IIngredient>>)
Adds a shaped recipe in the format
name
,output
,input
groovycrafting.addShaped(ResourceLocation, ItemStack, List<List<IIngredient>>)
Adds a shapeless recipe in the format
output
,input
(Name is generated). The input is a list of up to 9 ingredients.groovycrafting.addShapeless(ItemStack, List<IIngredient>)
Adds a shapeless recipe in the format
name
,output
,input
groovycrafting.addShapeless(String, ItemStack, List<IIngredient>)
Adds a shapeless recipe in the format
name
,output
,input
groovycrafting.addShapeless(ResourceLocation, ItemStack, List<IIngredient>)
Example
crafting.addShaped(item('minecraft:nether_star'), [
[item('minecraft:clay_ball'), item('minecraft:gold_block'), item('minecraft:clay_ball')],
[item('minecraft:gold_block'), item('minecraft:diamond_block'), item('minecraft:gold_block')],
[item('minecraft:clay_ball'), item('minecraft:gold_block'), item('minecraft:clay_ball')]
])
crafting.addShaped('custom_diamond', [
[item('minecraft:clay_ball'), item('minecraft:gold_ingot')],
[item('minecraft:gold_ingot'), item('minecraft:clay_ball')]
])
crafting.addShapeless('custom_netherstar', [item('minecraft:diamond'), item('minecraft:emerald'), item('minecraft:lapis')])
Replace recipes
There are 6 similar methods that can replace existing recipes with a new one. All of these methods have the same syntax as the addition methods, just with a different method name.
Tip
You can view recipe names in JEI/HEI by hovering over the output with F3+h
mode enabled.
Adds a shaped recipe in the format
output
,input
and removes any existing recipe that matches the output (Name is generated). The input is an up to 3x3 matrix of ingredients.groovycrafting.replaceShaped(ItemStack, List<List<IIngredient>>)
Adds a shaped recipe in the format
name
,output
,input
and removes any existing recipe that matches the name.groovycrafting.replaceShaped(String, ItemStack, List<List<IIngredient>>)
Adds a shaped recipe in the format
name
,output
,input
and removes any existing recipe that matches the name.groovycrafting.replaceShaped(ResourceLocation, ItemStack, List<List<IIngredient>>)
Adds a shapeless recipe in the format
output
,input
and removes any existing recipe that matches the output (Name is generated). The input is a list of up to 9 ingredients.groovycrafting.replaceShapeless(ItemStack, List<IIngredient>)
Adds a shapeless recipe in the format
name
,output
,input
and removes any existing recipe that matches the name.groovycrafting.replaceShapeless(String, ItemStack, List<IIngredient>)
Adds a shapeless recipe in the format
name
,output
,input
and removes any existing recipe that matches the name.groovycrafting.replaceShapeless(ResourceLocation, ItemStack, List<IIngredient>)
Removing Recipes
Tip
You can view recipe names in JEI/HEI by hovering over the output with F3+h
mode enabled.
Removes recipes in the format
mod:name
.groovycrafting.remove(String)
Removes recipes in the format
name
.groovycrafting.remove(ResourceLocation)
Removes recipes in the format
output
. Any recipe that matches the output will be removed.groovycrafting.removeByOutput(IIngredient)
Removes recipes in the format
output
,doLogFailure
. Any recipe that matches the output will be removed. IfdoLogFailure
is true, errors will not be logged. Only use this method if you know what you are doing.groovycrafting.removeByOutput(IIngredient, boolean)
Removes recipes in the format
input
. Any recipe that matches any of its inputs with the given input gets removedgroovycrafting.removeByInput(IIngredient)
Removes recipes in the format
input
,doLogFailure
. Any recipe that matches any of its inputs with the given input gets removed. IfdoLogFailure
is true, errors will not be logged. Only use this method if you know what you are doing.groovycrafting.removeByInput(IIngredient, boolean)
Removes all existing crafting recipes.
groovycrafting.removeAll()
Example
crafting.remove('minecraft:tnt')
crafting.removeByOutput(item('minecraft:tnt'))
Getting the value of recipes
Iterates through every entry in the registry, with the ability to call remove on any element to remove it:
groovycrafting.streamRecipes()