mojira.dev
MC-157438

The base price for enchanted items is random

The bug

So as far as I understand, the base price of a villager is supposed to be always the same.

For enchanted items, this price is supposed to depend on the enchantment.
There is, however, still a random component to it, as 2 trades with the same enchanted item still can have different prices.

How to reproduce

  1. Summon some villagers

  2. Provide a lectern workstation for them (since librarians only have a single enchantment on each book, it's easiest to reproduce with them).

  3. Do the above until you have 2 instances of the same trade and compare the prices.
    → ❌ The price may differ

Why this happens

Information on the likely cause by @unknown can be found here and here.

Linked issues

Attachments

Comments 11

this is normal unless you haven't traded with said villagers 

@unknown The base price is the thing that always stays the same, no matter if you traded with the villager or not (the base price is what is crossed out in the screenshots, so 15 and 7 emeralds in this case)

Confirmed. One librarian sold looting II for 15 emeralds and another villager sold this same enchantment for 25 emeralds. This also relates to MC-71354

You are saying that when a villager picks a book the book's prize can fluctuate although it is the same book. In your example Aqua Affinity, which has an Enchantment level of 1, has a price of 15 emeralds for one librarian, and a price of 7 for another (or the trades were reset, same thing).

Fluctuating prices for enchanted items are normal (see Enchanted Armor, Tools and Weapons), but not the topic of this report. The report is talking about fluctuations although the enchant is the same. Which, in fact, is normal, as you can see here: https://minecraft.gamepedia.com/Trading#cite_note-book-java-7

Else "Mending", for example, would always cost a certain number. While many people know that mending's cheapest price is 10, and can go up to 38 when trusting the Wiki (Explanation: Mending is a level 1 enchant => Price fluctuates between 5 and 19 => Mending is a "treasure enchantment => Price doubles => Mending can fluctuate between 10 and 38).

 

Thus, your "bug report" is not a bug. Fluctuating prices for the same enchant on a book are intentional.

But if you mean that a villager that sells i.e Aqua Affinity to you for 15 emeralds, but you decide to reset his trades by destroying and replacing the Workstation until you get Aqua Affinity again, youre expecting no other price than 15 emeralds... How exactly are you expecting him to remember this price? There is no seed for prices like there is for enchanting for example. Thats why people always reset villager trades to get a certain enchantment cheaper. The price always is chosen random with the few conditions cited in the link.

This is also confirmed for enchanted items that are not books as well (such as weaponsmiths selling knockback I iron swords for 17 and 18 emeralds respectively).

1 more comments

Re why I think/thought it was a bug:

All other trades have always the same base price.
For enchanted items all sources only say "The price is depenant on the enchantment the item has".

All of that makes perfect sense.

But Mojang never said that the base price of enchanted items include a random factor.

 

Your analysis a properly right, as this makes a lot of sense. Wheather or not Mojang intended the random factor of enchantment level costs to affect the prices of villagers is however still not confirmed by Mojang, even though it might very well be working as intended.

Can confirm in 20w51a.

More likely intentional. Just like real life when you shopping, the bread of brand A is 4$ for one, while B is 6$ for one. We cannot call for the same price to both, we can only choose the cheaper one for ourselves.

Uploaded serveral screenshots.

Curse of Binding (固咒) is sold twice in different price.

NeunEinser

(Unassigned)

Confirmed

Trading

price, trading, villager

1.14.4, 19w44a, 1.15.2, 20w13b, 20w51a, 1.19.2, 24w45a

Retrieved