First off you need to take a look at your register with minetest. Do you want the roll to act like a node where it is placeable like dirt or stone or do you want it to be treated much like placing a tool on the ground where it becomes an entity. Either one can be crafted by recipes but each has there own events that fires by minetest. I am not sure if on_place_on_ground is a registered event since I don't have the lua api with me since I am in class right now.
Moving into the code, with a event function you don't need to name it anything.
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
trigger event = function(pos, node)
is acceptable.
To add a node to minetest
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
You have the correct function and node declaration just change the pos declaration.
Now how to actually accomplish what you want it to do. I would use a while loop to check if the node below is air and if it is then place a chain.
Pseudocode:
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
incremented y value outside while loop
while(node below is air) then
add chain
end