The bug
If you summon a villager at a specific level, it will only offer trades of that level and skip the previous level's trades.
How to reproduce
Run this command:
/summon minecraft:villager ~ ~.5 ~ { VillagerData: { profession: "minecraft:cartographer", type: "plains", level: 5 } }
Right-click the villager to see its trades
→❌ Notice he only offers the globe pattern trade
Linked issues
is duplicated by 1
Attachments
Comments 42
Confirmed for 18w48b.
When the careerlevel is specified and greater than zero, it will specifically unlock only the trade(s) at that career progression level. The CareerLevel property is not used to specify all trades, only to spedify which trades should be added to the previous career level.
When not specified or at zero or less, the career level has the effect of randomizing the career (as documented), however this also happens when you specifically specify a career.
Cannot reproduce in 18w50a.
Worsened in fact, cannot summon villager with specified profession even. Professions are randomized now as well, regardless of CareerLevel value (omited or non-negative). The "Profession", "Career" or "CareerLevel" nbt values might have been changed/renamed. I'm not sure how to test this anymore.
Retested with now updated NBT property names, and still affects 18w50a.
It is now possible to reliably summon villagers with any trade tier unlocked, however they would only include trades of that tier (and above when they get unlocked by trading manually).
So it is not possible to summon a villager with for instance the first two tiers unlocked, as
level:2
will skip level 1 and start trades at 2.
To summon a villager correctly now in 18w50a:
/summon minecraft:villager ~ ~.5 ~ {VillagerData: {level: 1, profession: "minecraft:librarian", type: "minecraft:plains"}}
Changed behaviour since 1.14.3 pre2: opening the trade window of a villager that was summoned as described, while not in a proper village, will briefly open the GUI and immediately close it again.
Trades can still be seen in that brief moment, and the issue can still be observed eventhough it's hard to see.
The closing trade window is reported here: MC-154201 (likely a side effect of the fix for MC-152638).
Observed behavior in 1.14.3-pre4 regarding the trading level:
/summon minecraft:villager ~ ~.5 ~ { VillagerData: { profession: "minecraft:cartographer", type: "plains", level: 1 } }
A villager spawned with level 0 or 1 loses the profession instantly, even if a workstation is next to him. In above case, place a cartography table in front of you, then spawn the cartographer. For a split second, the cartographer outfit is visible. Then it won't have a profession and therefore not trade with you (nods head). A few seconds later, it will turn into a cartographer because of the cartography table and trading will work. In both cases (level 0/1), the trading level is Novice and he offers an emerald for paper and an empty map for emeralds (the level makes no difference in trades).
If it is summoned with level 2 or higher, the cartographer profession & outfit is kept! It does not nod the head. Any attempt to trade with the villager will result in the mentioned UI glitch however (trade window closes immediately). Nonetheless, it is possible to see the offered trades by spamming RMB and the trades are indeed just the ones for the respective level (level 2: glass pane / ocean explorer map trades, level 3: compass / woodland mansion map trades etc.). After a few seconds, when the villager accepts the cartography table, the trading UI will work normally and the trades will be the same as before (only the two trades specific to the level he was spawned with).
Changing the level from 2 to 3 to 4 to 5:
/data modify entity @e[type=minecraft:villager,limit=1] VillagerData.level set value 2
... does change the trading level as displayed in the trading window (5 = Master), but it does not affect the offered trades. So there is no easy workaround to unlock all trades by progressively increasing the trading level via a command. The only way to spawn a villager with all trades unlocked seems to be through a command block with hardcoded prices, which is pretty disappointing.
Confirmed for 1.13.2-pre2.