[solved] how to spawn node with custom description?

User avatar
bosapara
Member
 
Posts: 515
Joined: Fri Apr 07, 2017 08:49
GitHub: bosapara

[solved] how to spawn node with custom description?

by bosapara » Mon Sep 09, 2019 08:55

How to spawn node with custom description with "minetest.add_item"? (not from player inventory)

And save that description after place/dig this node

Image
Last edited by bosapara on Tue Sep 10, 2019 06:20, edited 1 time in total.
 

User avatar
Krock
Developer
 
Posts: 4346
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

Re: how to spawn node with custom description?

by Krock » Mon Sep 09, 2019 18:32

Something like this?
Code: Select all
local stack = ItemStack("my:item")
local meta = stack:get_meta()
meta:set_string("description", "foo bar baz")
local obj = minetest.add_item(pos, stack)
.. maybe do something with 'obj'

untested.
>> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

User avatar
bosapara
Member
 
Posts: 515
Joined: Fri Apr 07, 2017 08:49
GitHub: bosapara

Re: how to spawn node with custom description?

by bosapara » Mon Sep 09, 2019 19:15

Krock wrote:Something like this?


Yeah, like this, thanx you.

Image

P.S. Need for update of heads mod
 


Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 2 guests