Page 1 of 1

ABM question.

PostPosted: Thu Jan 05, 2012 22:28
by Gatharoth
Alright, so I'm working on a mod/extension for a mod. Now if I register a ABM, will that apply to all future blocks of the same node?

(example)

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
minetest.register_abm({
    nodenames = {"somemod:somenode"},
    interval = 1,
    chance = 1,
    action = function(pos, node, active_object_count, active_object_count_wider)
                    minetest.env:remove_node(pos)
})


Will this abm be applied to future nodes of the "somenode"? Or does it affect only nodes currently placed?

PostPosted: Thu Jan 05, 2012 23:53
by kahrl
It will affect all nodes of that type. It is irrelevant when they were placed or generated.

PostPosted: Fri Jan 06, 2012 03:36
by Gatharoth
Damns. Well, that ruins some plans for code. Mmm... I guess I could do a work-around using time-of-day, but that could screw things up. Hmmm.... oh wells, thanks :)