minetest.get_craft_recipe

From Minetest Developer Wiki
Jump to: navigation, search

Contents

Syntax

Description

Return the first recipe which output "item", a node or item type such as 'default:torch'.

Returns table, {method =, width =, items =}

  • method'normal' or 'cooking' or 'fuel'
  • width — for example 3
  • items — for example { stack1, stack2, stack3, stack4, stack5, stack6, stack7, stack8, stack9 } or nil if no recipe found

Example

print(dump(minetest.get_craft_recipe('default:torch')))
-- {items = {1 = "default:stick", 0 = "default:coal_lump"}, type = "normal", width = 1}

See Also

minetest.get_craft_result(...)
minetest.get_all_craft_recipes(...)
minetest.register_craft(...)

Personal tools
Namespaces

Variants
Actions
Navigation
API
Toolbox