summaryrefslogtreecommitdiff
path: root/doc/lua_api.txt
diff options
context:
space:
mode:
authorDiego Martínez <lkaezadl3@yahoo.com>2014-10-02 13:30:32 -0300
committerShadowNinja <shadowninja@minetest.net>2014-10-02 16:49:33 -0400
commit5baf379f40537060a1d5111905c7702d4563ee5c (patch)
treea433143e648beba60cb5974f08630f7a3567cfef /doc/lua_api.txt
parentf48f6869303ab331600efaf9ec5796c238180106 (diff)
downloadminetest-5baf379f40537060a1d5111905c7702d4563ee5c.tar.gz
minetest-5baf379f40537060a1d5111905c7702d4563ee5c.tar.bz2
minetest-5baf379f40537060a1d5111905c7702d4563ee5c.zip
Add better documentation for alternate drop definition to lua_api.txt.
Diffstat (limited to 'doc/lua_api.txt')
-rw-r--r--doc/lua_api.txt12
1 files changed, 11 insertions, 1 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 4c3a9d074..4db0dc40f 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -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
@@ -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