minetest.register_abm({
nodenames = {"default:cobble"},
interval = 10,
chance = 1,
action = function(pos)
minetest.add_node(pos, {name="default:stonebrick"})
end,
})
Pitriss wrote:try to write simple mod with abm which change all loaded cobble to stone bricks and walk through whole map.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 = {"default:cobble"},
interval = 10,
chance = 1,
action = function(pos)
minetest.add_node(pos, {name="default:stonebrick"})
end,
})
as decribed here. This should turn all default:cobble loaded into default:stonebrick every 10s.
rubenwardy wrote:Pitriss wrote:try to write simple mod with abm which change all loaded cobble to stone bricks and walk through whole map.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 = {"default:cobble"},
interval = 10,
chance = 1,
action = function(pos)
minetest.add_node(pos, {name="default:stonebrick"})
end,
})
as decribed here. This should turn all default:cobble loaded into default:stonebrick every 10s.
Maybe minetest.set_node, as iirc, add_node requires the position to be air.
minetest.register_alias("default:cobble", "default:stonebrick")MasterGollum wrote:I decided to use the Pitriss's function. It worked fine, but the stairs, they lost the direction :P I fixed it transfering the param2 value to the new nodes. I prefer not to use an aliass because I wanted to leave the default behaviour, so once I changed all I will remove the abm. Luckily I had not used WorldEdit or I would have done a mess with all the stairs :P
This is why mod creators need to provide abms to replace current blocks with the new version of the block. I had this problem with the quartz mod pillars, which I created an abm for.MasterGollum wrote:I decided to use the Pitriss's function. It worked fine, but the stairs, they lost the direction :P I fixed it transfering the param2 value to the new nodes. I prefer not to use an aliass because I wanted to leave the default behaviour, so once I changed all I will remove the abm. Luckily I had not used WorldEdit or I would have done a mess with all the stairs :P
Users browsing this forum: No registered users and 7 guests