Grow and decay apples.
This commit is contained in:
parent
534d48a0bd
commit
159083227d
1 changed files with 23 additions and 0 deletions
23
abms.lua
23
abms.lua
|
@ -332,6 +332,29 @@ minetest.register_abm({
|
|||
-- creation
|
||||
------------------------------------------------------------
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:leaves"},
|
||||
interval = 10 * fun_caves.time_factor,
|
||||
chance = 100,
|
||||
catch_up = false,
|
||||
action = function(pos, node)
|
||||
pos.y = pos.y - 1
|
||||
local node_below = minetest.get_node_or_nil(pos)
|
||||
if node_below and node_below.name == 'air' then
|
||||
minetest.set_node(pos, {name = 'default:apple'})
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:apple"},
|
||||
interval = 1 * fun_caves.time_factor,
|
||||
chance = 100,
|
||||
action = function(pos, node)
|
||||
minetest.remove_node(pos)
|
||||
end
|
||||
})
|
||||
|
||||
-- Freezing vapor hardens into ice.
|
||||
local ice_node = {name = 'default:ice'}
|
||||
minetest.register_abm({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue