What occurs before? on_place or on_construct?

Post Reply
User avatar
runs
Member
Posts: 2955
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

What occurs before? on_place or on_construct?

by runs » Post

To a node with those 2 functions, what is executed before?

on_place is only for players?

I guess that the first one is on_place. If this is the case could I stop the node construction on the code?

Thanx.
⛏️ KeKo Site | 👕 ShopZ | ☕ Ko-fi

User avatar
Krock
Developer
Posts: 4625
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: What occurs before? on_place or on_construct?

by Krock » Post

1) Player rightclicks
2) "on_place" is called
3) The "on_place" function calls "minetest.item_place_node" (by default)
4) "minetest.item_place_node" calls "minetest.set_node"
5) "minetest.set_node" calls "on_destruct" (old node) and "on_construct" (new node)
6) "minetest.item_place_node" calls "after_place_node"
7) "minetest.item_place_node" runs the "minetest.register_on_placenode" callbacks

Relevant: item_place_node
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
runs
Member
Posts: 2955
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: What occurs before? on_place or on_construct?

by runs » Post

Krock wrote:1) Player rightclicks
2) "on_place" is called
3) The "on_place" function calls "minetest.item_place_node" (by default)
4) "minetest.item_place_node" calls "minetest.set_node"
5) "minetest.set_node" calls "on_destruct" (old node) and "on_construct" (new node)
6) "minetest.item_place_node" calls "after_place_node"
7) "minetest.item_place_node" runs the "minetest.register_on_placenode" callbacks

Relevant: item_place_node
Thanks, very explicative ;-)
⛏️ KeKo Site | 👕 ShopZ | ☕ Ko-fi

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests