From 75f757ed2b5d0f313dcf2347794ae59a24940d7a Mon Sep 17 00:00:00 2001 From: Desour Date: Sun, 20 Apr 2025 23:22:33 +0200 Subject: [PATCH] Improve crafting doc --- doc/lua_api.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/doc/lua_api.md b/doc/lua_api.md index 3c12a33b4..e316c3d4b 100644 --- a/doc/lua_api.md +++ b/doc/lua_api.md @@ -10466,6 +10466,16 @@ table format. The accepted parameters are listed below. Recipe input items can either be specified by item name (item count = 1) or by group (see "Groups in crafting recipes" for details). +Only the item name (and groups) matter for matching a recipe, i.e. meta and count +are ignored. + +If multiple recipes match the input of a craft grid, one of them is chosen by the +following priority rules: + +* Shaped recipes are preferred over shapeless recipes, which in turn are preferred + over tool repair. +* Otherwise, recipes without groups are preferred over recipes with groups. +* Otherwise, earlier registered recipes are preferred. The following sections describe the types and syntaxes of recipes. @@ -10485,6 +10495,10 @@ For example, for a 3x3 recipe, the `recipes` table must have In order to craft the recipe, the players' crafting grid must have equal or larger dimensions (both width and height). +Empty slots outside of the recipe's extents are ignored, e.g. a 3x3 +recipe where only the bottom right 2x2 slots are filled is the same +as the corresponding 2x2 recipe without the empty slots. + Parameters: * `type = "shaped"`: (optional) specifies recipe type as shaped