I suggest to add something to the node definition so the mod makers could choose to make a different node appear after it has been dug.
For example, you could turn a stone block into a stone block with cracks. Or you could turn an “underwater torch” into water (because air wouldn't be so great). There are a couple of other use cases for this.
Node drops should be unaffected by this; they still would have to be defined seperately.
If unspecified, it should default to air, so if you dig a block, it turns into air, which is the current behaviour.
I know, I know, all this could theoretically be done by using callbacks.
But by extending the node definition, client-side prediction could be made, too. AFAIK this would not be possible with using callbacks only. It also would be easier and faster to write in Lua.
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_node("example:example", {
name = "some example node",
replace_node = "example:example2",
})
So example:example becomes example:example2 after digging.
I am not sure if the name “replace_node” fits best, suggest a better one if you know one.