Minetest version 0.4.14
How to reproduce:
write mod
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
heavy_cube={}
minetest.register_node("heavy_cube:cube", {
description = "Heavy cube",
groups = {cracky = 3, falling_node = 1},
is_ground_content = false,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_float("counter", 0)
end
})
minetest.register_abm({
nodenames = {"heavy_cube:cube"},
interval = 5,
chance = 1,
action = function(pos)
local meta = minetest.get_meta(pos)
local cnt = meta:get_float("counter")
minetest.log("action", "Counter: "..cnt)
cnt = cnt + 1
meta:set_float("counter", cnt)
end
})
which gives such log
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
2017-02-14 14:16:10: ACTION[Server]: singleplayer [127.0.0.1] joins game.
2017-02-14 14:16:10: ACTION[Server]: singleplayer joins game. List of players: singleplayer
2017-02-14 14:16:13: ACTION[Server]: Counter: 1
2017-02-14 14:16:14: ACTION[Server]: Counter: 2
2017-02-14 14:16:15: ACTION[Server]: singleplayer punches object 2: LuaEntitySAO at (-0.0727,7.70101,0.8546)
2017-02-14 14:16:19: ACTION[Server]: Counter: 3
2017-02-14 14:16:21: ACTION[Server]: singleplayer digs default:dirt at (0,7,1)
2017-02-14 14:16:21: ACTION[Server]: singleplayer digs default:dirt at (0,7,2)
2017-02-14 14:16:24: ACTION[Server]: Counter: 0
It looks, that minetest simply removes node at the old position an constructs it on the new, without meta info copying