1

I was trying to get an emerald with a custom color added to it and have a villager sell the emerald. I was doing well getting both to spawn but when I tried to combine the two it didn't work. Can you tell me what I have done wrong?

/summon villager ~ ~1 ~ {VillagerData:{profession:farmer,level:2,type:plains},Offers:{Recipes:[{buy:{id:acacia_boat,Count:1},sell:{id:emerald,Count:1,tag:{display:{Name:"\"aqua\"",Lore:["\"TOKENNNN\""]}}},maxUses:9999999},{buy:{id:acacia_boat,Count:1},buyB:{id:acacia_boat,Count:1},sell:{id:emerald,Count:1,tag:{display:{Name:"\"Token\",\" color\":\"aqua\",\"italic\":true},{\"text\":\"ken\",\"color\":\"aqua\",\"italic\":true}]\",},HideFlags:1}\""}}},maxUses:9999999}]}}

And the expanded command:

/summon villager ~ ~1 ~
{ 
   VillagerData:{ profession:farmer, level:2, type:plains },
   Offers:{ 
      Recipes:[ 
         { 
            buy:{ id:acacia_boat, Count:1 },
            sell:{ id:emerald, Count:1,
               tag:{ display:{ Name:"\"aqua\"", Lore:[ "\"TOKENNNN\"" ] } }
            },
            maxUses:9999999
         },
         { 
            buy:{ id:acacia_boat, Count:1 },
            buyB:{ id:acacia_boat, Count:1 },
            sell:{ id:emerald, Count:1,
               tag:{ display:{ Name:"\"Token\",\" color\":\"aqua\",\"italic\":true},{\"text\":\"ken\",\"color\":\"aqua\",\"italic\":true}]\",},HideFlags:1}\"" } }
            },
            maxUses:9999999
         }
      ]
   }
}

To specify the issue, it is only reading the "TOKEN" part of it and not the rest

5
  • 2
    You should try to get each part of the command working individually and only then put it all together. Commented Feb 18, 2020 at 2:40
  • I was able to spawn in the token itself and the villager to sell the emerald i just need it to sell the attributes of the emerald. Commented Feb 18, 2020 at 22:58
  • OK, then try the inner part on its own and then put it into the big command. Commented Feb 18, 2020 at 22:59
  • that is what i did but it broke when i did Commented Feb 19, 2020 at 22:11
  • I see a bunch of spaces that don't belong there, including \" color\", which definitely breaks stuff, non-quoted IDs, NBT matching that is not exact (like Count:1 instead of Count:1b in the buy tag), … What error messages did you get when you tried it? Some of them should be helpful. Commented Feb 19, 2020 at 22:27

2 Answers 2

1

Try this command:

/summon villager ~ ~1 ~ {VillagerData:{profession:farmer,level:2,type:plains},Offers:{Recipes:[{buy:{id:acacia_boat, Count:1b},sell:{id:emerald,Count:1b,tag:{display:{Name:"\"aqua\"",Lore:["\"TOKENNNN\""]}}},maxUses:9999999},{buy:{id:acacia_boat, Count:1b},buyB:{id:acacia_boat, Count:1b},sell:{id:emerald,Count:1b,tag:{display:{Name:"[{\"text\":\"Token\",\"color\":\"aqua\",\"italic\":true},{\"text\":\"ken\",\"color\":\"aqua\",\"italic\":true}]"},HideFlags:1}},maxUses:9999999}]}}

Expanded:

/summon villager ~ ~1 ~
{
  VillagerData: {profession: farmer, level: 2, type: plains},
  Offers: {
    Recipes: [
      {
        buy: {id: acacia_boat, Count: 1b},
        sell: {
          id: emerald,
          Count: 1b,
          tag: {
            display: {
              Name: "\"aqua\"",
              Lore: ["\"TOKENNNN\""]
            }
          }
        },
        maxUses: 9999999
      },
      {
        buy: {id: acacia_boat, Count: 1b},
        buyB: {id:acacia_boat, Count: 1b},
        sell: {
          id: emerald,
          Count: 1b,
          tag: {
            display: {
              Name: "[{\"text\":\"Token\",\"color\":\"aqua\",\"italic\":true},{\"text\":\"ken\",\"color\":\"aqua\",\"italic\":true}]"
            },
            HideFlags: 1
          }
        },
        maxUses: 9999999
      }
    ]
  }
}

The main issue was with your JSON text for the second offer. Yours was (unescaped):

"Token"," color":"aqua","italic":true},{"text":"ken","color":"aqua","italic":true}]",},HideFlags:1}"

Not only did you include the HideFlags NBT tag in the JSON text components, but there are missing brackets and an extra quote and space. The correct JSON is

[
  {
    "text": "Token",
    "color": "aqua",
    "italic": true
  },
  {
    "text": "ken",
    "color": "aqua",
    "italic": true
  }
]

Also, you should always include b or B after a byte tag (like in Count).

0

Use this:

/summon villager ~ ~1 ~ {VillagerData:{profession:farmer,level:2,type:plains},Offers:{Recipes:[{buy:{id:acacia_boat, Count:1b},sell:{id:emerald,Count:1b,tag:{display:{Name:"\"aqua\"",Lore:["\"TOKENNNN\""]}}},maxUses:9999999},{buy:{id:acacia_boat, Count:1b},buyB:{id:acacia_boat, Count:1b},sell:{id:emerald,Count:1b,tag:{display:{Name:"[{\"text\":\"Token\",\"color\":\"aqua\",\"italic\":true},{\"text\":\"ken\",\"color\":\"aqua\",\"italic\":true}]"},HideFlags:1}},maxUses:9999999}]}}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.