-1

I'm having an issue with minecraft commands. I'm creating an RPG style adventure map that revolves around conquering dungeons, selling items for "Gold Coins" and using those coins to purchase higher tier gear. Items like "Shoddy Leather Jacket" (leather chestplate) with the lore "Lv.1" Simple right?

My issue is creating villagers that you can trade in Gold coins for gear. Here is my command:

/summon Villager ~1 ~ ~ 
{Profession:3,
CustomName:"Lv.1 Gear Merchant",
CustomNameVisible:1,
Career:1,
CareerLevel:42,
CanPickUpLoot:0,
PersistenceRequired:1,
NoAI:1,
Invulnerable:1,
Offers:{Recipes:[{buy:{id:"gold_nugget",display:{Name:"Gold Coin",Lore:["$1",Count:32}]},
maxUses:9999999,
sell:{id:"leather_chestplate",display:{Name:"Shoddy Leather Jacket",Lore:["Lv.1",Count:1}]},
rewardExp:false},
{buy:{id:"gold_nugget",display:{Name:"Gold Coin",Lore:["$1",Count:24}]},
maxUses:9999999,
sell:{id:"leather_helmet",display:{Name:"Shoddy Leather Hat",Lore:["Lv.1",Count:1}]},
rewardExp:false},
{buy:{id:"gold_nugget",display:{Name:"Gold Coin",Lore:["$1",Count:28}]},
maxUses:9999999,
sell:{id:"leather_leggings",display:{Name:"Shoddy Leather Greaves",Lore:["Lv.1",Count:1}]},
rewardExp:false},
{buy:{id:"gold_nugget",display:{Name:"Gold Coin",Lore:["$1",Count:20}]},
maxUses:9999999,
sell:{id:"leather_boots",display:{Name:"Shoddy Leather Boots",Lore:["Lv.1",Count:1}]},
rewardExp:false}]}}

The issue I'm having is that no items are showing up where it usually states the trades.

There's a blank spot in the UI where the offered trades should be

Anyways, I am pretty sure I have some silly syntax error somewhere but any help is much appreciated. Thanks.

  • Please format your command to be human readable. – Jerry Aug 30 '17 at 21:57
  • it looks like you close a curly bracket BEFORE you close your square brackets: Lore:["$1",Count:32}] This occurs multiple times – Diriector_Doc Aug 30 '17 at 22:28
  • EDIT: it didn't change anything, I already had fixed the square brackets before (Oops) Im still getting the issue – Nekromanser Aug 31 '17 at 1:16
  • You made that mistake nearly every time, look it over again. – Diriector_Doc Aug 31 '17 at 4:13
1

Your command looks a little chaotic like this, so I can't quite tell which part causes the items not to display, but I understand what you try to achieve, so I made you a command that summons a villager with 1 custom trade. The first trade in your command to be exact. It looks like this:

/summon villager ~ ~1 ~ 
{
    CustomName:"Lv.1 Gear Merchant",
    CustomNameVisible:1b,
    NoAI:1b,
    Invulnerable:1b,
    Offers:
    {
        Recipes:
        [
            {
                buy:{id:"minecraft:gold_nugget",tag:{display:{Name:"Gold Coin",Lore:["$1"]}},Count:32},
                sell:{id:"minecraft:leather_chestplate",tag:{display:{Name:"Shoddy Leather Jacket",Lore:["Lv.1"]}},Count:1},
                maxUses:9999999
            }
        ]
    }
}

I tested this and all the trades are visible in the trade menu.

I would like to address some things as well:
- A villager is a passive mob and doesn't need the PersistenceRequired tag.
- Please build your command in steps/iterations. First try to summon a villager. Then try to give him one special trade, without any fancy items. Let him trade a brown mushroom for a red mushroom for example. Then try to do something fancy with the item. Then try to give the villager more trades. After each change, be sure to test your command, so you know that everything works up to that point.

The trades were probably invisible because the Count tag was in the wrong place in your command. You basically asked for 0 items and wanted 0 items in return. 0 items are displayed as nothing. The lore and the custom name wouldn't have been visible if your command worked, because the display tag has to be inside a tag tag.

You can use the command that I provided and I'm sure you can figure out how to add more trades to the villager. It's just a matter of copying and pasting. Make sure that you remove all the white-space characters(tabs and new-lines) inside the NBT data before pasting this command, otherwise it doesn't work.

EDIT: Leaving the maxUses out causes the trade to lock itself every now and then, which is probably not desirable. I removed that suggestion.

  • Thank you so much, this completely fixes my problem. Thank you for taking time out of your day to help a random stranger with his stupid ideas. It really shows how good people are in this world. I'm usually used to (in most forums at least) people being unimaginably negative. Thanks, again for the third time in this comment. – Nekromanser Aug 31 '17 at 21:11
  • also just another stupid question from a nub, what exactly does the "tag" mean before the display NBT Data tag. Moreover, What exactly does it do/Purpose of being there? EDIT: Also how did you do that thing where you wrote the command? I'm a newbie at stackexchange formatting and such. – Nekromanser Aug 31 '17 at 21:32
  • @Nekromanser There is no such thing as a dumb question. I cannot tell you what the tag tag means. The purpose is probably to bundle certain arguments together that are stored inside the entity together. Every entity probably has a tag object in the code, therefore it is easier to bundle those arguments together. The code block can be made by pressing enter twice and then for each row of code you insert 4 spaces first. The layout is just a matter of indenting whenever you go into a deeper scope(=you open a set of brackets). – D-Inventor Sep 1 '17 at 5:02
0

You certainly do have several syntax errors and omissions. Several of the mistakes are the same. (I am guessing you used copy/paste which created multiples) Lets look at those.

Here is a single buy portion of your code:

buy:{id:"gold_nugget",display:{Name:"Gold Coin",Lore:["$1",Count:32}]}

The ,Count:32} is on the inside of Lore:[...] and also the inside of display:{...}. Lets put that in it's correct place inside buy:{...}. That gives us:

buy:{id:"gold_nugget",display:{Name:"Gold Coin",Lore:["$1"]},Count:32}

Next, the display:{...} portion needs to be inside tag:{...} which gives us:

buy:{id:"gold_nugget",tag:{display:{Name:"Gold Coin",Lore:["$1"]}},Count:32}

Fix these issues with every instance of buy:{...} and sell:{...} and you get:

summon Villager ~1 ~ ~ {Profession:3,CustomName:"Lv.1 Gear Merchant",CustomNameVisible:1,Career:1,CareerLevel:42,CanPickUpLoot:0,PersistenceRequired:1,NoAI:1,Invulnerable:1,Offers:{Recipes:[{buy:{id:"gold_nugget",tag:{display:{Name:"Gold Coin",Lore:["$1"]}},Count:32},maxUses:9999999,sell:{id:"leather_chestplate",tag:{display:{Name:"Shoddy Leather Jacket",Lore:["Lv.1"]}},Count:1},rewardExp:false},{buy:{id:"gold_nugget",tag:{display:{Name:"Gold Coin",Lore:["$1"]}},Count:24},maxUses:9999999,sell:{id:"leather_helmet",tag:{display:{Name:"Shoddy Leather Hat",Lore:["Lv.1"]}},Count:1},rewardExp:false},{buy:{id:"gold_nugget",tag:{display:{Name:"Gold Coin",Lore:["$1"]}},Count:28},maxUses:9999999,sell:{id:"leather_leggings",tag:{display:{Name:"Shoddy Leather Greaves",Lore:["Lv.1"]}},Count:1},rewardExp:false},{buy:{id:"gold_nugget",tag:{display:{Name:"Gold Coin",Lore:["$1"]}},Count:20},maxUses:9999999,sell:{id:"leather_boots",tag:{display:{Name:"Shoddy Leather Boots",Lore:["Lv.1"]}},Count:1},rewardExp:false}]}}

Which gives us this guy:

Merchant Trade

Also, just to note, when working with large commands like this, I highly recommend this JSON viewer, as it has the ability to format which makes it much easier to understand and see mistakes.

0

You should try mcstacker.bimbimma.com - its a website that allows you to type in what you want to happen or select what you want to give or what it can place on etc. You can summon any entity and choose what is it wearing and so on.

In this instance you could use it to build a 'summon' command for a villager then have a custom trade for it.

It is a very handy tool for making maps, as I am making a huge map revolved around command blocks and this is very helpful.

  • What does that website have to do with trading with a villager? Is it a mod? – Robotnik Dec 4 '17 at 1:10
  • 1
    no it is a websight to type in what you want to happen or select what you want to give what it can place on ect. summon any entity what is it wearing ect. all in a single command – xXSPENCERXx Dec 4 '17 at 3:26
  • also, if you could please leave an answer on the latest question i have for when you finish this map i am looking forward to it : ) – xXSPENCERXx Dec 4 '17 at 3:27
  • Thanks for getting back, I have incorporated your description into your answer for you :) It's helpful to provide as much detail as possible. Unfortunately I can't help much with your question, but good luck! – Robotnik Dec 4 '17 at 3:34
  • Sorry i meant to say just comment on my latest post when you are done making the map and just mention your map, its name, and what websight to download it on – xXSPENCERXx Dec 7 '17 at 1:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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