If you have some code inside your ABM that actually does something, for example adding a new node somewhere, like this:
minetest.env:add_node(pos, {name = "widgets:fooblock"})
...then you would wrap it in a simple check routine, so your ABM might look something like this:
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 = { list of nodenames to operate on },
...
... other ABM settings here...
...
action = function(pos, node, active_object_count, active_object_count_wider)
if pos.y < 14 then
minetest.env:add_node(pos, {name = "widgets:fooblock"})
end
end
})
The idea is to check the Y position of the node the ABM is about to operate on before you actually DO anything to that node. If Y < 14 then do whatever you were gonna do, otherwise do nothing.