mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-10-31 15:35:21 +01:00 
			
		
		
		
	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"
This commit is contained in:
		| @@ -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"}, | ||||
|                 }, | ||||
|             }, | ||||
|         }, | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user