@@ -6155,17 +6155,44 @@ Used by `minetest.register_node`.
6155
6155
},
6156
6156
6157
6157
drop = "",
6158
- -- Name of dropped node when dug. Default is the node itself.
6159
- -- Alternatively:
6158
+ -- Name of dropped item when dug.
6159
+ -- Default dropped item is the node itself.
6160
+ -- Using a table allows multiple items, drop chances and tool filtering:
6160
6161
drop = {
6161
- -- Maximum number of items to drop
6162
6162
max_items = 1,
6163
- -- Choose max_items randomly from this list
6163
+ -- Maximum number of item lists to drop.
6164
+ -- The entries in 'items' are processed in order. For each:
6165
+ -- Tool filtering is applied, chance of drop is applied, if both are
6166
+ -- successful the entire item list is dropped.
6167
+ -- Entry processing continues until the number of dropped item lists
6168
+ -- equals 'max_items'.
6169
+ -- Therefore, entries should progress from low to high drop chance.
6164
6170
items = {
6171
+ -- Entry examples.
6165
6172
{
6166
- items = {"foo:bar", "baz:frob"}, -- Items to drop
6167
- rarity = 1, -- Probability of dropping is 1 / rarity
6168
- inherit_color = true, -- Inherit palette color from the node
6173
+ -- 1 in 1000 chance of dropping a diamond.
6174
+ -- Default rarity is '1'.
6175
+ rarity = 1000,
6176
+ items = {"default:diamond"},
6177
+ },
6178
+ {
6179
+ -- Only drop if using a tool whose name is identical to one
6180
+ -- of these.
6181
+ tools = {"default:shovel_mese", "default:shovel_diamond"},
6182
+ rarity = 5,
6183
+ items = {"default:dirt"},
6184
+ -- Whether all items in the dropped item list inherit the
6185
+ -- hardware coloring palette color from the dug node.
6186
+ -- Default is 'false'.
6187
+ inherit_color = true,
6188
+ },
6189
+ {
6190
+ -- Only drop if using a tool whose name contains
6191
+ -- "default:shovel_".
6192
+ tools = {"~default:shovel_"},
6193
+ rarity = 2,
6194
+ -- The item list dropped.
6195
+ items = {"default:sand", "default:desert_sand"},
6169
6196
},
6170
6197
},
6171
6198
},
0 commit comments