cItem: Store custom data
#6
Have something like that in mind. Easy to access and easy to add / get keys and values.

-- firework item
local item = cItem(E_ITEM_FIREWORK_ROCKET, 1)
item.m_ItemMeta["Explosions"] = {}
item.m_ItemMeta["Explosions"][1] = {}
item.m_ItemMeta["Explosions"][1]["Flicker"] = 1 -- Twinkle effect
item.m_ItemMeta["Explosions"][1]["Type"] = 2 -- Star-shaped

item.m_ItemMeta["Explosions"][2] = {}
item.m_ItemMeta["Explosions"][2]["Trail"] = 1  -- Trail effect
item.m_ItemMeta["Explosions"][2]["Type"] = 3 -- Creeper-shaped
item.m_ItemMeta["Fireworks"]["Flight"] = 60 -- 3s flight time, until it explodes


-- written book
local item = cItem(E_ITEM_WRITTEN_BOOK, 1)
item.m_ItemMeta["author"] = "author name"
item.m_ItemMeta["title"] = "A book"
item.m_ItemMeta["pages"][1] = "page 1"
item.m_ItemMeta["pages"][2] = "page 2"
item.m_ItemMeta["pages"][3] = "page 3"

I added additional nbt tags in a written book and the client had no problems with the book, it only shows the tags that are shown and maybe it only reads the keys and values that are required.

Currently we have no way to manipulate nbt tags from plugin side. I see that cItem has m_ItemColor and m_FireworkItem, both doesn't work and are not exported to lua.
Reply
Thanks given by:


Messages In This Thread
cItem: Store custom data - by xoft - 11-27-2016, 06:19 AM
RE: Storing custom data in cItem - by xoft - 11-27-2016, 08:13 AM
RE: cItem: Store custom data - by NiLSPACE - 11-27-2016, 08:38 AM
RE: cItem: Store custom data - by xoft - 11-28-2016, 08:04 AM
RE: cItem: Store custom data - by Seadragon91 - 03-23-2017, 08:50 PM
RE: cItem: Store custom data - by NiLSPACE - 03-24-2017, 01:25 AM
RE: cItem: Store custom data - by Seadragon91 - 03-24-2017, 01:29 AM
RE: cItem: Store custom data - by xoft - 03-25-2017, 12:00 AM
RE: cItem: Store custom data - by NiLSPACE - 03-25-2017, 12:07 AM
RE: cItem: Store custom data - by Seadragon91 - 03-25-2017, 12:07 AM
RE: cItem: Store custom data - by xoft - 03-27-2017, 05:13 PM
RE: cItem: Store custom data - by NiLSPACE - 03-28-2017, 05:09 PM
RE: cItem: Store custom data - by xoft - 03-28-2017, 05:11 PM
RE: cItem: Store custom data - by Seadragon91 - 05-22-2017, 02:54 AM
RE: cItem: Store custom data - by coding.solo - 08-27-2017, 02:31 AM
RE: cItem: Store custom data - by peterbell10 - 09-19-2017, 02:04 AM
RE: cItem: Store custom data - by xoft - 09-19-2017, 06:18 PM
RE: cItem: Store custom data - by peterbell10 - 09-20-2017, 01:31 AM
RE: cItem: Store custom data - by xoft - 09-20-2017, 02:30 AM
RE: cItem: Store custom data - by peterbell10 - 09-20-2017, 02:44 AM



Users browsing this thread: 2 Guest(s)