NBT Tag Data Not Preserved
patrick-layden opened this issue ยท 3 comments
When interacting with Hyperconomy (buying/selling), any items in your inventory with UNBREAKABLE attribute gets wiped; effectively breaking the item.
I've tested this with 2 unrelated (to themselves, and to hyperconomy) plugins. It also isn't related to any specific plugin, just any item with new attribute data on it.
Here is a way to replicate what i am talking about:
Give this item to yourself.
/give @p diamond_sword 1 0 {AttributeModifiers:[{AttributeName:"generic.attackDamage",Name:"generic.attackDamage",Amount:7,Operation:0,UUIDMost:60910,UUIDLeast:439450}],HideFlags:6,Unbreakable:1}
Then interact with a shop (buy/sell something). The NBT tag data will be removed from the item.
Does this happen ONLY with "Unbreakable"? I'm asking because I use SlimeFun and though there aren't unbreakables, there's a LOT of custom items that I hope won't be affected by this...
It depends on what you mean by custom. The only reason the unbreakable flag isn't working is because it's not in the Bukkit API. To support it I have to directly work with NBT tags or require Spigot. The same is true for mob eggs. If I have time I'll add some code to work directly with NBT since it seems the Spigot/Bukkit API isn't keeping up with new features.
You can test to see if it will work by adding a SlimeFun item to HyperConomy with /ai [name] while holding the item. If it adds successfully that pretty much means it's working, but you can try buying it too. If it says the item is already in the database that means it's not working. You can view all the data HyperConomy sees attached to an item by holding it and using the "/ii pd" command. If there is any difference in the data between items HyperConomy sees it as a different item. The only functional NBT tags that aren't currently working that I'm aware of are unbreakable and the entity tags for spawn eggs.