Skip to content

Commit

Permalink
Add better documentation for alternate drop definition to lua_api.txt.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaeza authored and ShadowNinja committed Oct 2, 2014
1 parent f48f686 commit 5baf379
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion doc/lua_api.txt
Expand Up @@ -2423,7 +2423,6 @@ Node definition (register_node)
diggable = true, -- If false, can never be dug
climbable = false, -- If true, can be climbed on (ladder)
buildable_to = false, -- If true, placed nodes can replace this node
drop = "", -- alternatively drop = { max_items = ..., items = { ... } }
liquidtype = "none", -- "none"/"source"/"flowing"
liquid_alternative_flowing = "", -- Flowing version of source liquid
liquid_alternative_source = "", -- Source version of flowing liquid
Expand All @@ -2446,6 +2445,17 @@ Node definition (register_node)
dug = <SimpleSoundSpec>,
place = <SimpleSoundSpec>,
},
drop = "", -- Name of dropped node when dug. Default is the node itself.
-- Alternatively:
drop = {
max_items = 1, -- Maximum number of items to drop.
items = { -- Choose max_items randomly from this list.
{
items = {"foo:bar", "baz:frob"}, -- Choose one item randomly from this list.
rarity = 1, -- Probability of getting is 1 / rarity.
},
},
},

on_construct = func(pos),
^ Node constructor; always called after adding node
Expand Down

0 comments on commit 5baf379

Please sign in to comment.