aboutsummaryrefslogtreecommitdiff
path: root/doc/lua_api.txt
diff options
context:
space:
mode:
authorTreer <treer.git@gmail.com>2021-08-28 04:23:20 +1000
committerGitHub <noreply@github.com>2021-08-27 20:23:20 +0200
commit149d8fc8d6d92e8e0d6908125ad8d3179695b1ea (patch)
treed396992227fafc136bf9d05c6cb85e9965293ac5 /doc/lua_api.txt
parentd36dca3aba34e989eec6686660c0490548baad67 (diff)
downloadminetest-149d8fc8d6d92e8e0d6908125ad8d3179695b1ea.tar.gz
minetest-149d8fc8d6d92e8e0d6908125ad8d3179695b1ea.tar.bz2
minetest-149d8fc8d6d92e8e0d6908125ad8d3179695b1ea.zip
Add group-based tool filtering for node drops (#10141)
Supports both AND and OR requirements, e.g. * "a tool that's in any of these groups" * "a tool that's in all of these groups"
Diffstat (limited to 'doc/lua_api.txt')
-rw-r--r--doc/lua_api.txt14
1 files changed, 12 insertions, 2 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 327f64b21..e99c1d1e6 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -7798,14 +7798,24 @@ Used by `minetest.register_node`.
inherit_color = true,
},
{
- -- Only drop if using a item whose name contains
+ -- Only drop if using an item whose name contains
-- "default:shovel_" (this item filtering by string matching
- -- is deprecated).
+ -- is deprecated, use tool_groups instead).
tools = {"~default:shovel_"},
rarity = 2,
-- The item list dropped.
items = {"default:sand", "default:desert_sand"},
},
+ {
+ -- Only drop if using an item in the "magicwand" group, or
+ -- an item that is in both the "pickaxe" and the "lucky"
+ -- groups.
+ tool_groups = {
+ "magicwand",
+ {"pickaxe", "lucky"}
+ },
+ items = {"default:coal_lump"},
+ },
},
},