Page 1 of 1
How to set nodes as indestructible?

Posted:
Wed Dec 02, 2015 16:37
by Kpenguin
Hello,
I'm working on a relatively small map. I want to create an indestructible barrier around the edges of the map so that you can't fall out of the world accidentally. How do I do this? I have the worldedit mod installed to create the barrier, but I need to know how to make it indestructible.
Thanks!
Kpenguin
Re: How to set nodes as indestructible?

Posted:
Wed Dec 02, 2015 17:04
by Ferk
I think something like this should be enough:
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("mymod:reinforced_wall", {
description = "Reinforced Wall",
tiles = {"mymod_wall.png"},
groups = {immortal=1},
on_blast = function() end,
})
Re: How to set nodes as indestructible?

Posted:
Wed Dec 02, 2015 17:19
by Kpenguin
What do I do with this code?
Re: How to set nodes as indestructible?

Posted:
Thu Dec 03, 2015 03:03
by Worldblender
Ferk wrote: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("mymod:reinforced_wall", {
description = "Reinforced Wall",
tiles = {"mymod_wall.png"},
groups = {immortal=1},
on_blast = function() end,
})
Use this code as part of a mod you create and make the custom block type be indestructible, using "immortal=1".
Re: How to set nodes as indestructible?

Posted:
Thu Dec 03, 2015 03:17
by kaeza
The proper way is not defining groups at all, or define a non-standard group that can only be destroyed by special (mod-provided) tools. `immortal` group is not really special for nodes (it does make entities immortal though), but it falls into the second option.
See also
maptools.
Re: How to set nodes as indestructible?

Posted:
Thu Dec 03, 2015 08:35
by TenPlus1
I tend to use the {unbreakable = 1} group to stop dungeon masters in mobs redo from destroying blocks, and it is also used in lucky blocks so that those same blocks do not blow up.
Also in tnt mod they add this code to node registry to stop blasts destroying nodes as well:
on_blast = function(pos, intensity)
end,
Re: How to set nodes as indestructible?

Posted:
Sun Oct 23, 2016 17:12
by Big3Force
Hey TEN... i still cant get in Xanadu... also .. im trying to make unbreakable blocks..
any suggestions?
Re: How to set nodes as indestructible?

Posted:
Sat Oct 29, 2016 21:37
by Wuzzy
It turns out, making a node indestructible is trickier than you might think. There is not a single setting which makes a node indestructible.
Luckily, this is a problem I have already solved in practice. I use it for my mod “bedrock2”.
Here's a node definition template you can (and should) use:
http://dev.minetest.net/Mod_interoperab ... ible_nodes