minetest.get_all_craft_recipes

From Minetest Developer Wiki
Jump to: navigation, search

Contents

Syntax

minetest.get_all_craft_recipes(query_item)

Description

Returns indexed table with all registered recipes for query item (node) or nil if no recipe was found
recipe entry table:

{

method = 'normal' or 'cooking' or 'fuel'
width = 0-3, 0 means shapeless recipe
items = indexed [1-9] table with recipe items
output = string with item name and quantity

}

Example query for default:gold_ingot will return table:

{
	1={type = "cooking", width = 3, output = "default:gold_ingot", items = {1 = "default:gold_lump"}},
	2={type = "normal", width = 1, output = "default:gold_ingot 9", items = {1 = "default:goldblock"}}
}

Example

print(dump(minetest.get_all_craft_recipes('default:torch')))
-- {[1] = {["items"] = {[1] = "default:coal_lump", [2] = "default:stick"}, ["type"] = "normal", ["output"] = "default:torch 4", ["width"] = 1}}

See Also

minetest.get_craft_result(...)
minetest.get_craft_recipe(...)
minetest.register_craft(...)


This article is incomplete.


Personal tools
Namespaces

Variants
Actions
Navigation
API
Toolbox