Copy Minecraft NBT tags from another command?

ma
8

I use the MCStacker (https://mcstacker.net/) page to create my commands.

There you can copy the NBT tags below if you want to spawn a villager.

How can I e.g. Use the NBT tags from the following / give command to have a villager sell this item? In other words: What do I have to copy / delete from the / give command in order to insert it in the 2nd command on MCStacker?

give @p minecraft: diamond_helmet {display: {Name: '{"text": "Ritter-Topf", "color": "red", "bold": true, "italic": true}', Lore: [' {"text": "Extra life to protect yours", "color": "gold", "italic": true} ']}, RepairCost: 40, Enchantments: [{id: "minecraft: protection", lvl: 4s}, {id: "minecraft: respiration", lvl: 1s}, {id: "minecraft: unbreaking", lvl: 6s}], AttributeModifiers: [{AttributeName: "generic.maxHealth", Name: "generic.maxHealth ", Amount: 0.3, Operation: 1, UUIDLeast: -314183, UUIDMost: -7103705, Slot:" head "}]} 1

The command that doesn't work:

/ summon villager ~ ~ ~ {CustomName: '{"text": "Super Spezial Schmied", "color": "aqua", "bold": true}', VillagerData: {level: 99, profession: "minecraft: weaponsmith "}, Offers: {Recipes: [{buy: {id:" minecraft: netherite_helmet ", Count: 1b}, buyB: {id:" minecraft: enchanted_golden_apple ", Count: 1b}, sell: {id:" minecraft: netherite_helmet ", Count: 1b, tag: {{display: {Name: '{" text ":" Ritter-Topf "," color ":" red "," bold ": true," italic ": true}', Lore: ['{"text": "Extra life to protect yours", "color": "gold", "italic": true}']}, RepairCost: 40, Enchantments: [{id: "minecraft: protection ", lvl: 4s}, {id:" minecraft: respiration ", lvl: 1s}, {id:" minecraft: unbreaking ", lvl: 6s}], AttributeModifiers: [{AttributeName:" generic.maxHealth ", Name: "generic.maxHealth", Amount: 0.3, Operation: 1, UUIDLeast: -314183, UUIDMost: -7103705, Slot: "head"}]}}}}]}}

Po

Actually everything because MCStacker does not have this function. What you mean is "CustomTags". This is just to give the villager tags so that you can e.g. Only mobs with the specific tag can teleport.

So you have to set all trades at / summon as they should be. This is what the command looks like:

/ summon villager ~ ~ ~ {VillagerData: {level: 99, profession: "minecraft: toolsmith"}, Offers: {Recipes: [{buy: {id: "minecraft: netherite_helmet", Count: 1b}, buyB: {id: "minecraft: enchanted_golden_apple", Count: 1b}, sell: {id: "minecraft: netherite_helmet", Count: 1b, tag: {display: {Name: '{"text": "Ritter-Topf", "color": "red", "bold": true, "italic": true} ', Lore: [' {"text": "Extra life to protect yours", "color": "gold", "italic": true } ']}, RepairCost: 40, Enchantments: [{id: "minecraft: protection", lvl: 4s}, {id: "minecraft: respiration", lvl: 1s}, {id: "minecraft: unbreaking", lvl: 6s}], AttributeModifiers: [{AttributeName: "generic.max_health", Name: "generic.max_health", Amount: 0.3, Operation: 0, UUID: [I; 1514579534,2122860946, -1562386159, -1626916749]}] }}}]}}

ma

Ah now understand what the field is for, thank you!

But you can't easily change the / give command by hand in order to attach it to the trades?

Because there are a lot of items that I had already created with / give (wasn't actually intended for trading), and creating all of them again via MCStacker would take forever: /

Po

I checked again. You only need to select the item you want to sell and you can insert the NBT data into CustomTags.

You have to delete the square brackets at the end of the NBT data.

ma

In this example, the command is no longer recognized:

summon villager ~ ~ ~ {VillagerData: {level: 99, profession: "minecraft: armorer"}, Offers: {Recipes: [{buy: {id: "minecraft: diamond", Count: 1b}, sell: {id: "minecraft: golden_sword", Count: 1b, tag: {{display: {Name: '{"text": "Geschwinde Klinge", "color": "yellow", "bold": true, "italic": true} ', Lore: [' {"text": "No cooling,", "color": "gold", "italic": true} ',' {"text": "click as in 1.8", "color": "gold", "italic": true} ']}, HideFlags: 8, RepairCost: 40, Enchantments: [{id: "minecraft: sharpness", lvl: 10s}, {id: "minecraft: fire_aspect", lvl: 2s}, {id: "minecraft: unbreaking", lvl: 8s}], AttributeModifiers: [{AttributeName: "generic.attackSpeed", Name: "generic.attackSpeed", Amount: 2, Operation: 1, UUIDLeast: - 8581578, UUIDMost: 3417805, Slot: "mainhand"}}}}}]}}

Po

After tag: a curly bracket must be removed, UUIDLeast: -8581578, UUIDMost: 3417805, Slot: "mainhand" must be replaced by UUID: [I; 1514579534,2122860946, -1562386159, -1626916749 and at the end the brackets must look like this: ]}]}}}]}}

ma

Thank you so much!

I'm a little closer to the whole thing, but the biggest problem is that I don't know how to transfer this to the other items, as they all look different.

Po

As stupid as it sounds: With MCStacker it doesn't take too long to fill in the few things (name, lorry, enchantments, attributes). There's no easier / faster way.

ma

Well, then I have to add everything again.