#is there a way to save all items in a player's inventory with dynamic properties?
1 messages · Page 1 of 1 (latest)
accualy im pretty sure its possible
maybe not with dynamic properties cus idk how that works
but you could with tags atlest
or maybe entity properties
Only the basic item data
Like enchantments, durability, name, lore, etc
There is no way to get the "data" value you use for commands
like durability?
Data value only affects tool durability in commands
But for other items, it represents variations
does scripts not check that?
Like sand and red sand
You can copy the ItemStack instance and it will keep all the data, but there is no way to save it in a db
doesnt lore help with that?
Lore is only the text you see below the name
Lets go from the start, you can get the item, get the components, enchantments, nametag, lore, amount
But not the data value
If you want to keep the item completely the same, you need to save it in another container so you can just transfer them again later
That container can be a chest or a entity with the inventory component
and you cannot tranfer objects to dynamic properties / or entity properties
You can if you stringify an object with that obtained data
But as I said, there is no way to get the "data value"
So lets say you have different anvils in your inventory
A normal one and broken one
In the script there is no way to differentiate one and another
You would have to serialize all the available item data first