Add property to node [Solved]

guideahon
Member
 
Posts: 37
Joined: Mon Jan 26, 2015 12:49
In-game: guideahon

Add property to node [Solved]

by guideahon » Fri Feb 20, 2015 19:50

Hi everyone, im making ores drop xp, to do that, i added the xp=1 group to the node and i added that to my api.lua, with default nodes it works perfect, but for moreores and technic, all i get is making those nodes "unknown", it's strange because with coal, iron, diamond, etc, it works, any idea how can i add the property without touching these mods, only mine?

minetest.register_node(":moreores:mineral_mithril", {
groups = {cracky=3, xp=1},
})
Last edited by guideahon on Fri Feb 20, 2015 21:49, edited 1 time in total.
 

User avatar
rubenwardy
Moderator
 
Posts: 5796
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Add property to node

by rubenwardy » Fri Feb 20, 2015 20:12

You overwrite the whole node, rather than just the group.

Use minetest.override_item()

Code: Select all
minetest.override_item("moreores:mineral_mithril", {
     groups = {cracky=3, xp=1},
})
 

guideahon
Member
 
Posts: 37
Joined: Mon Jan 26, 2015 12:49
In-game: guideahon

Re: Add property to node

by guideahon » Fri Feb 20, 2015 21:49

It works!!! Thx rubernwardy, i'll vote you for president!
 


Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 4 guests