mojira.dev
MC-186647

Villager price changes are extremely inconsistent, and completely break in combination with hero of the village

When a villager gives a discount or increases prices, these price changes vary drastically. When in combination with hero of the village, the villager could discount and increase prices at the same time! This happens with practically all discounts, and applies to all professions. Assuming the prices were supposed to double, it would be expected for the cleric to trade 64 rotten flesh for an emerald, and 2 emeralds for 2 redstone.

To reproduce, spawn 2 villagers and place down a brewing stand and grindstone. Punch both villagers once. The cleric's first trade will increase by 6.25%, while its second trade will increase by 200%. The masons first trade will increase by 20%, while its second trade will increase by 200%. (Under the following context, delta means "change in") The cleric's delta second trade is 32 times worse than its delta first trade, while the mason's delta second trade is 10 times worse than its delta first trade. This logic breaks even more in combination with the hero of the village effect, causing the first trade to be discounted, while the second trade is more expensive.

Linked issues

Attachments

Comments 5

I don't see the issue here - Punching both villagers decreases your reputation, but it's not enough to make prices double. The emeralds have an increase of 100% because they're a single item, and the game will always try to round up. When you get Hero of the Village the prices get discounted, but the previous penalties are still accounted.

Did I understand this report correctly?

I spawned in a mason, and killed a villager next to it. The game adds 7 to the required clay/emeralds needed to make a trade, even though the clay trade starts at 10, and the bricks trade starts at 1, causing extremely different price increases. The clay trade increases by only 70%, while the bricks trade increases by 800%.

About hero of the village, the penalties are applied, but incorrectly. The hero of the village effect is applied before the bonus/penalty instead of after, which can make them too powerful when combined with other discounts. It also makes no sense that when you have a penalty, one trade is discounted, and another trade is increased.

One way to fix this is to make villager price changes percentage based, like hero of the village.

Can confirm in 23w03a

Villagers have a expensive income

[media]

gaspoweredpick

(Unassigned)

Confirmed

Village system

hero-of-the-village, villager-trade

1.15.2, 20w22a, 1.16 Pre-release 1, 1.16 Pre-release 2, 1.16 Pre-release 5, ..., 1.20.2, 1.20.3 Pre-Release 1, 1.21, 1.21.1, 1.21.3

Retrieved