Version 1.0.0
[minetest_cups.git] / API.md
blob44b446afac8b4486d3427eb5b5b2d57b0f62b009
1 # API documentation for Cups mod
2 This mod provides a simple API for adding more cups.
4 ## `cups.register_cup(subname, description, tiles, craftitem, craft_count, extra_groups, extra_sounds)`
5 Adds a new cup with itemstring `cups:cup_<subname>` and optionally a crafting recipe for this cup.
7 If `craftitem` is non-`nil`, the recipe follows this template:
9     C.C
10     .C.
11     .C.
13     C = `craftitem`
14     . = nothing
16 Yields `craft_count` cups.
18 ### Parameters
19 * `subname`: Part of the name which will be used to create the cup's itemstring
20 * `description`: In-game description/tooltip of the cup
21 * `tiles`: Textures
22 * `craftitem`: The item source to be used in the crafting recipe. If `nil`, no crafting recipe will be generated
23 * `craft_count`: How many cups will be crafted at once (only has an effect if `craftitem ~= nil`)
24 * `extra_groups`: Table of additional groups to assign to this item (optional)
25 * `extra_sounds`: Table of additional sounds (`SimpleSoundSpec`) to assign to this item (optional)
27 ### Returns
28 Always `nil`.