From 149d8fc8d6d92e8e0d6908125ad8d3179695b1ea Mon Sep 17 00:00:00 2001 From: Treer Date: Sat, 28 Aug 2021 04:23:20 +1000 Subject: 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" --- doc/lua_api.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'doc') 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"}, + }, }, }, -- cgit v1.2.3