How to set nodes as indestructible?

User avatar
Kpenguin
Member
 
Posts: 212
Joined: Fri Jul 24, 2015 16:19
IRC: Kpenguin
In-game: Kpenguin

How to set nodes as indestructible?

by Kpenguin » Wed Dec 02, 2015 16:37

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
supertuxkart.net

"Profanity is one language all computer users know" - Murphy's 50th Law of Computers
Players will always find the hidden flaw in your master plan; If there's no hidden flaw, it's against the rules; If it isn't against the rules, one player will convince the others it is. - Murphy's 2nd Law of Gaming

All things are possible except skiing through a revolving door.
 

User avatar
Ferk
Member
 
Posts: 330
Joined: Tue Aug 18, 2015 17:18
GitHub: Ferk

Re: How to set nodes as indestructible?

by Ferk » Wed Dec 02, 2015 17:04

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,
})
{ ☠ Dungeontest ☠ , ᗧ••myarcade•• }
 

User avatar
Kpenguin
Member
 
Posts: 212
Joined: Fri Jul 24, 2015 16:19
IRC: Kpenguin
In-game: Kpenguin

Re: How to set nodes as indestructible?

by Kpenguin » Wed Dec 02, 2015 17:19

What do I do with this code?
supertuxkart.net

"Profanity is one language all computer users know" - Murphy's 50th Law of Computers
Players will always find the hidden flaw in your master plan; If there's no hidden flaw, it's against the rules; If it isn't against the rules, one player will convince the others it is. - Murphy's 2nd Law of Gaming

All things are possible except skiing through a revolving door.
 

User avatar
Worldblender
Member
 
Posts: 44
Joined: Tue Jun 30, 2015 22:12
In-game: Worldblender

Re: How to set nodes as indestructible?

by Worldblender » Thu Dec 03, 2015 03:03

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".
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: How to set nodes as indestructible?

by kaeza » Thu Dec 03, 2015 03:17

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.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
TenPlus1
Member
 
Posts: 1874
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: How to set nodes as indestructible?

by TenPlus1 » Thu Dec 03, 2015 08:35

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,
 

Big3Force
Member
 
Posts: 34
Joined: Tue Aug 26, 2014 04:50
In-game: Big3Force

Re: How to set nodes as indestructible?

by Big3Force » Sun Oct 23, 2016 17:12

Hey TEN... i still cant get in Xanadu... also .. im trying to make unbreakable blocks..
any suggestions?
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: How to set nodes as indestructible?

by Wuzzy » Sat Oct 29, 2016 21:37

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
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 6 guests

cron