SirLeezus/OneStopShop

Ability to just copy all NBT tags of an item

Opened this issue · 1 comments

First of all: Thank you so much for creating this plugin. It makes life so much easier!

But while this plugin is very good already, i would love to be able to add something like --all-nbt to the /shop add command to be able to just copy all NBT data to the item in the shop. Would something like this be possible?

At the moment i try to solve this issue using the command feature like so:

command: "give %player% diamond_sword 1 0 {Enchantments: [{id: \"minecraft:fire_aspect\", lvl: 1s}], Damage: 0, HideFlags: 2, itemsadder: {max_custom_durability: 850, namespace: \"itemsadder\", id: \"firesword_sword\", fake_durability: 1561.0d, custom_durability: 850}, display: {Name: '{\"extra\":[{\"bold\":false,\"italic\":false,\"underlined\":false,\"strikethrough\":false,\"obfuscated\":false,\"color\":\"white\",\"text\":\"Fire Sword\"}],\"text\":\"\"}', Lore: ['{\"text\":\"\"}', '{\"extra\":[{\"bold\":false,\"italic\":false,\"underlined\":false,\"strikethrough\":false,\"obfuscated\":false,\"color\":\"gray\",\"text\":\"When in main hand:\"}],\"text\":\"\"}', '{\"extra\":[{\"text\":\" \"},{\"bold\":false,\"italic\":false,\"underlined\":false,\"strikethrough\":false,\"obfuscated\":false,\"color\":\"dark_green\",\"text\":\"1.6 Attack Speed\"}],\"text\":\"\"}', '{\"extra\":[{\"text\":\" \"},{\"bold\":false,\"italic\":false,\"underlined\":false,\"strikethrough\":false,\"obfuscated\":false,\"color\":\"dark_green\",\"text\":\"10 Attack Damage\"}],\"text\":\"\"}', '{\"extra\":[{\"bold\":false,\"italic\":false,\"underlined\":false,\"strikethrough\":false,\"obfuscated\":false,\"color\":\"gray\",\"text\":\"Durability: 850 / 850\"}],\"text\":\"\"}']}, CustomModelData: 11, AttributeModifiers: [{Name: \"itemsadder\", AttributeName: \"minecraft:generic.attack_damage\", Operation: 0, UUID: [I; -1983268089, 283854976, -2014129721, -1858253093], Slot: \"mainhand\", Amount: 9.0d}]}"

This is for one of the Items Adder default weapons. I get the NBT tags by calling /data get entity @p SelectedItem, copying
the tags section out of the logs, escaping ever " and constructing a give command with it.
Not the most efficient way 😅