Modify node definition after registration

codexp
New member
 
Posts: 9
Joined: Sun Jan 21, 2018 11:42

Modify node definition after registration

by codexp » Mon Oct 08, 2018 22:21

kaeza wrote:
Code: Select all
minetest.registered_nodes["default:chest"].blahblah = blahblahblah;



this does not work in 0.4.17 (any changes are dropped immediately somehow)
 

User avatar
12Me21
Member
 
Posts: 873
Joined: Tue Mar 05, 2013 00:36
Location: (Ignore all of my posts before 2018)
GitHub: 12Me21

Re: Modify node definition after registration

by 12Me21 » Mon Oct 08, 2018 23:19

Use `minetest.override_item`:
Code: Select all
minetest.override_item("default:chest",{
  blahblah = blahblahblah,
})
 

User avatar
GreenDimond
Member
 
Posts: 1272
Joined: Wed Oct 28, 2015 01:26
Location: SCP-3008
GitHub: GreenXenith
IRC: GreenDimond
In-game: GreenDimond

Re: Modify node definition after registration

by GreenDimond » Tue Oct 09, 2018 00:13

12Me21 wrote:Use `minetest.override_item`:
Code: Select all
minetest.override_item("default:chest",{
  blahblah = blahblahblah,
})

Note, this only works on startup - you can't change the node defs during runtime.
Y▹uTube | Mods | Patre●n | Twitter | Minetest Discord | GreenDimond#3232

Hey, you. You're finally awake.
You were trying to view their profile, right? Found the rest of their signature, same as us, and that guest over there.
 


Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 6 guests