Sure, when using minetest.remove_node, you can destroy everything. What I am talking about is creating a block which should be indestructible in normal gameplay.
A good start might be to add this code into the node definition:
Code: Select all
groups = { immortal = 1 },
However, the real problem comes when your node has to interact with other mods. I noticed that many mods are way too trigger happy when it comes to destroying nodes. As soon they destroy nodes, they completely ignore even the most basic properties.
All TNT and similar mods I know mercilessly destroy any node the TNT can reach. Including the TNT mod from minetest_game. The mods do not check if the node is part of the immortal group, so they destroy “indestructible” nodes.
This is not a problem unique to TNT mods, it affects all mods which blindly call minetest.remove_node or minetest.set_node on unknown nodes.
More mod makers need to be aware of this.
So here is my suggestion to mod makers:
Please be very cautios when calling minetest.remove_node / minetest.set_node on unknown nodes. You always have the risk of destroying a node which is not supposed to be destroyed.
First check if the node is in the immortal group. Only then proceed with deleting or replacing.
There is one exception to this rule: When you're debugging and testing. There is a mod which adds an admin stick, which removes EVERYTHING it touches. This is legitimate, as it is specifically designed to get rid of otherwise indestructible nodes and it is not designed for normal gameplay.
So, my fellow modders, what do you think? Do you agree with me? Would you change your modding style accordingly? Or do you have a different opinion?