mojira.dev
MC-41242

Custom Villager trades using command blocks cause bow to break immediately

Using a command block, using this command breaks the enchanted bow traded from the villager as soon as you pull the bow:

/summon Villager ~+1 ~+5 ~ {Profession:5,CustomName:Shop 3,CustomNameVisible:1,Offers:{Recipes:[{maxUses:1,buy:{id:272,count:1,tag:{ench:[{id:16,lvl:3}],display:{Name:"Shank",Lore:["Sharp Enough"]}}},sell:{id:267,count:1,tag:{ench:[{id:16,lvl:3},{id:19,lvl:2}],display:{Name:Knife,Lore:["Sharp"]}}}},{maxUsers:1,buy:{id:261,count:1,tag:{ench:[{id:49,lvl:3},{id:51,lvl:1},{id:34,lvl:5}],display:{Name:"MP15",Lore:["Specialized For Only Top Of The Line"]}}},sell:{id:261,count:1,tag:{ench:[{id:49,lvl:5},{id:51,lvl:1},{id:34,lvl:5},{id:49,lvl:2}],display:{Name:"FAMAS",Lore:["MIA Level. Do You Have That Type Of Skill?"]}}}}]}}

Comments 8

Could you also add the code for the "Shank"? Otherwise its impossible to test.

EDIT: Nevermind, I reverse engineered the code:

/give @p 272 1 1 tag:{ench:[{id:16,lvl:3}],display:{Name:"Shank",Lore:["Sharp Enough"]}}

Confirmed.

Confirmed in 14w08a

/give @p stone_sword 1 0 tag:{ench:[{id:16,lvl:3}],display:{Name:"Shank",Lore:["Sharp Enough"]}}
summon Villager ~+1 ~+5 ~ {Profession:5,CustomName:Shop 3,CustomNameVisible:1,Offers:{Recipes:[{maxUses:1,buy:{id:272,count:1,tag:{ench:[{id:16,lvl:3}],display:{Name:"Shank",Lore:["Sharp Enough"]}}},sell:{id:267,count:1,tag:{ench:[{id:16,lvl:3},{id:19,lvl:2}],display:{Name:Knife,Lore:["Sharp"]}}}},{maxUsers:10,buy:{id:261,count:1,tag:{ench:[{id:49,lvl:3},{id:51,lvl:1},{id:34,lvl:5}],display:{Name:"MP15",Lore:["Specialized For Only Top Of The Line"]}}},sell:{id:261,count:1,tag:{ench:[{id:49,lvl:5},{id:51,lvl:1},{id:34,lvl:5},{id:49,lvl:2}],display:{Name:"FAMAS",Lore:["MIA Level. Do You Have That Type Of Skill?"]}}}}]}}

Ok, now the sword does not break but the bow disappears.

Did you change anything that the sword doesn't break anymore ?

Now it's called: Custom Villager trades using command blocks cause bow to break immediately , the sword is fine now.

Your tags are invalid; they need to follow proper capitalization. The "count" tag should instead read "Count". As well, numerical IDs are no longer supported, so you should be using the alphabetical IDs instead. Fixed command:

/summon Villager ~1 ~5 ~ {Profession:5,CustomName:Shop 3,CustomNameVisible:1,Offers:{Recipes:[{maxUses:1,buy:{id:minecraft:stone_sword,Count:1,tag:{ench:[{id:16,lvl:3}],display:{Name:"Shank",Lore:["Sharp Enough"]}}},sell:{id:minecraft:iron_sword,Count:1,tag:{ench:[{id:16,lvl:3},{id:19,lvl:2}],display:{Name:Knife,Lore:["Sharp"]}}}},{maxUsers:1,buy:{id:minecraft:bow,Count:1,tag:{ench:[{id:49,lvl:3},{id:51,lvl:1},{id:34,lvl:5}],display:{Name:"MP15",Lore:["Specialized For Only Top Of The Line"]}}},sell:{id:minecraft:bow,Count:1,tag:{ench:[{id:49,lvl:5},{id:51,lvl:1},{id:34,lvl:5},{id:49,lvl:2}],display:{Name:"FAMAS",Lore:["MIA Level. Do You Have That Type Of Skill?"]}}}}]}}

Anewbpro

(Unassigned)

Confirmed

Minecraft 1.7.2, Minecraft 14w08a

Retrieved