Making a node give you a different block when broken?

Post Reply
robbieradiant
New member
Posts: 3
Joined: Thu Aug 11, 2022 16:36
GitHub: connorhedgehog
IRC: connorhedgehog
In-game: connorhedgehog
Contact:

Making a node give you a different block when broken?

by robbieradiant » Post

title explains it all, how exactly do i do this? minetest game lets you put drop: whatever when registering the node, but it seems to be exclusive since that doesn't work in my own game. how do i implement this? im extremely curious

User avatar
Desour
Member
Posts: 1472
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: Making a node give you a different block when broken?

by Desour » Post

Just set the drop field in the node def accordingly... :P
https://github.com/minetest/minetest/bl ... 8244-L8297
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

robbieradiant
New member
Posts: 3
Joined: Thu Aug 11, 2022 16:36
GitHub: connorhedgehog
IRC: connorhedgehog
In-game: connorhedgehog
Contact:

Re: Making a node give you a different block when broken?

by robbieradiant » Post

DS-minetest wrote:
Fri Sep 09, 2022 17:28
Just set the drop field in the node def accordingly... :P
https://github.com/minetest/minetest/bl ... 8244-L8297
turns out i just made a few typos, thank you!

User avatar
j0j0n4th4n
Member
Posts: 250
Joined: Tue Jan 26, 2021 06:45

Re: Making a node give you a different block when broken?

by j0j0n4th4n » Post

I have a similar question, if a node has two drops is it possible for the two to be exclusive from one another like a XOR ?
cdb_894a100ddd76

User avatar
Desour
Member
Posts: 1472
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: Making a node give you a different block when broken?

by Desour » Post

j0j0n4th4n wrote:
Wed Sep 28, 2022 23:36
I have a similar question, if a node has two drops is it possible for the two to be exclusive from one another like a XOR ?
I haven't used the advanced drop thing myself yet, but it should be something like this:

Code: Select all

drop = {
max_items = 1, -- only drop one of the lists
items = {
{rarity = 2, items = {"mymod:myitem1"}}, -- chance 1/2: drop this
{rarity = 1, items = {"mymod:myitem2"}}, -- otherwise: drop this
},
}
Imo it would be much easier if one could just specify a function. I guess we have this complex drop thing just because of historic reasons.
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Bla and 12 guests