mojira.dev
MC-148454

Villager trade GUI shows incorrect price when a discount is applied on servers

The bug

On servers, all players (on LAN servers, all players except the host) get displayed an incorrect price for discounted trades. Instead of the original price being displayed crossed out and the discounted price standing next to it, the discounted price is crossed out and an incorrect price stands next to it (that price being the original price discounted twice).

This is how it looks to the host of a LAN world / to the server:

[media]

This is how it looks to all the other players:

[media]

To reproduce

by @unknown

  1. Create a new singleplayer world (superflat for convenience, creative).

  2. Summon on a safe spot a villager, assign him the mason profession by placing down a stonecutter.

  3. Open the world to you LAN and let a second account join.

  4. Give the hero of the village status effect to both players:

    /effect give @a hero_of_the_village 999 1 true
  5. Try to trade with the mason one account, then the other.

  6. ❌ The guest account is displaying the incorrect price

Video

[media]

Original report

Server side inventories do not apply the advertised price, instead applying the original full price. This is applicable to both buy and sell trades. If the world is copied to saves folder and played as a single player world, the proper price will be applied to the trade.

How to produce:
1. Download server jar file from most recent patch notes page.
2. Create server.
3. Trade with villagers on server.

Side Note: This bug also affects Realms servers.

Related issues

MC-10809 Hearts from breeding animals appear "behind" water and ice MC-147225 Villager trade shows wrong prices MC-147971 Villagers do not show the real discount with effect "Hero of the village" MC-148333 Villager UI destroying trade items when multi-trading MC-148803 Villager Trade reverses after closing trade screen MC-149094 specialPrice NBT tag works wrong MC-149499 Promos avec villageois (Héros du village) MC-149533 Hero of the village -- won't take discounted trade amount MC-149551 Villagers are cheating me out of emeralds! MC-149559 Villager Discounts not working MC-149752 Villagers won't give any discounts. MC-149808 Villager Discounts Not Working MC-149939 Trades appear lower for me then they actually are MC-149956 Villager's discount trade MC-150014 Villager discounts not applied to trades MC-150134 Items disappearing after buying from villager MC-150200 1.14 Trader inventory bug MC-150251 The villagers do not lower prices MC-150320 Cannot trade with Villager if discount is active MC-150334 Hero of the Village reduced prices not Letting you trade if you only have enough for the reduced price MC-150343 Trade sales MC-150391 Librarian villager refuses to trade enchanted book, but gives ghost item when shift clicking (on server) MC-150435 Villagers Giving Ghost Items MC-150648 Can't trade for discount price with less emeralds than undiscounted price MC-150734 Villager Trades In Stock But Broken MC-150754 Trading Issue with Lib MC-150787 Деревенские жители показывают обманчивую скидку. (и так же "накрутка" опыта,которая фальшивая) MC-150900 Wrong trade sales MC-150921 Villager Trading Bug - Trade does not complete and gets refunded MC-150928 Cannot trade on villager discount if inventory is less than original requirement MC-150942 Villagers show trades but will not allow me to trade with them/other issues with trading MC-151120 Realm - Villagers won't trade for discounted price during Hero of the Village if you don't have the undiscounted requirement MC-151260 Villager Trading Discount not working MC-151298 Villager discounts shown but not applied MC-151403 Villager Discount not working MC-151549 villager discounts don't work MC-151643 Villager trading does not accurately count/take from quantity given MC-151663 The villagers' discount doesn't work MC-153438 Villagers consuming more items than are actually being traded MCL-10809 Hero of the Village breaks where you cant buy stuff at the discounted price

Attachments

Comments

migrated
[media][media][media][media]
Johnibur

Can confirm.
You should update the title for more visibility, something like: "Villager trades do no apply discount on dedicated servers".

migrated

Great Idea! If you don't mind I'm going to use your title.

Johnibur

Can confirm for 1.14-pre5.

Johnibur

Can confirm for 1.14.

Jerozgen

Villager trades do apply discount, but it is displayed wrongly. Trade cost is (original_price - x), but it displayed as (original_price - x - x).

Johnibur

Indeed, this is my testing trade:

[media]


You can see it is displayed as selling 8 clay instead of 9, but after doing some research I found that the normal trade is 10 and remains the same for all mason. So what happens is the price slot is replaced by the discounted price, and the discounted slot is replaced by the discounted price applied twice. Also makes sense with the trades on the attached video.
Please update this ticket accordingly: Villager trade GUI shows incorrect price when a discount is applied on dedicated server.

migrated

Confirming this bug is also present on Realms servers, took awhile to figure out I had to pay the not-full-full price.

migrated

What I've found is that the discounted price is used for buying gear, but only if the player has at least as many emeralds as the original.  I had the hero affect, and I could buy gear that normally cost 11 for 1, but only of I had 11 emeralds.  

 

migrated

I had this bug on Pre-Release 5.  Made an entire raid farm just to be disappointed that the trades weren't being discounted server side.  Although, I haven't had any issues with this on a fresh, 1.14 world, indicating this might be a converting issue.

migrated

Playing on a fresh world. This bug affects my server as well

migrated

This also happens on our Realms world, huge bummer.

Johnibur

Reproduction steps on a new world open to LAN and 2 accounts

  1. With the first account, the "host", create a new singleplayer world (superflat for convenience, creative).

  2. Summon on a safe spot a villager, assign him the mason profession by placing down a stonecutter.

  3. Open the world to your LAN and join with a second account, the "client".

  4. Give the hero of the village status effect to both players:

    /effect give @a hero_of_the_village 999 1 true
  5. Try to trade with the mason with the host, then with the client.

-> The host account (the one playing on "integrated server") has the correct trade displaying:

[media]


-> The client account (the one playing on "vanilla server") who joined the world has the incorrect trade displaying:

[media]

We can see the prices are just shifted by one extra discount operation. In both cases, the villager will only accept the price as displayed to the host account.

migrated

I believe the hero of the village effect is just to get the discounted trades quicker rather than trading with them. I don't know if my bug is the same or not. see MC-149880

migrated

From what I can tell, it seems as though the server is only sending the discounted price to the client account, which is being confused as the full price, and thus the discount is applied twice. This obviously would be fixed by either sending both prices to the client or just the full price and the discount factor. I may be wrong though.

To No Thanks,
it seems as though your bug is different although possibly related, with again the client side of the game being confused as the what the server side is actually doing.

migrated

I was wondering what was causing this! Had this exact same issue except on a friend group realm.

 

migrated

Can confirm on my friends 1.14 Release realm

migrated

I have this problem too on my realm

 

migrated

This bug can also be seen in this video, in 2:25, when he trades emeralds for the chestplate that shows 1 emerald as cost but gets 5 emeralds deducted instead -> https://www.youtube.com/watch?v=poK7CzjWsGM

I'm hoping it gets fixed soon, it can be really misleading, completely broken display

migrated

I'm not sure how to re-open this, but this is still NOT resolved in 1.14.1 pre-1, see MC-151282

migrated

Anqing, is that in pre-release 1, or 2? I cannot currently test this and would like to not incorrectly mark affected versions.

violine1101

I cannot reproduce this in 1.14.1-pre1 and assumed that the 1.14.1-pre1 being added to affected versions in MC-151282 was a mistake. @unknown, if you want your ticket to be reopened, please leave a comment on that ticket.

migrated

I also was unable to reproduce this in 1.14.1-pre2, The trades and their GUIs are working on my dedicated server.

violine1101

The same issue still exists, but only for villagers that previously were zombie villagers and have been cured. See MC-151282.

migrated

Still A Major Problem, Mods no help marking everything resolved.

violine1101

@unknown, this particular issue has been fixed in 1.14.1 Pre-Release 1, though a similar issue still exists. A report about that issue, MC-151282, is still left open.

migrated

migrated

Confirmed

Trading

Gui, server, villager-trade

Minecraft 1.14 Pre-Release 2, Minecraft 1.14 Pre-Release 3, Minecraft 1.14 Pre-Release 4, Minecraft 1.14 Pre-Release 5, Minecraft 1.14

Minecraft 1.14.1 Pre-Release 1

Retrieved