The bug
Clicking a villager's first listed trade while the items for a different trade are already in the trading slot always causes the villager to play its 'agree' sound, even if the player does not have the items required for the first listed trade.
How to reproduce
Place some stonecutters
Spawn some villagers
Give yourself 64 emeralds
Find a mason whose first listed trade is clay for emeralds
Click the emeralds for bricks trade
→ ✔ The villager plays its 'agree' soundAfter the sound finishes, click the clay for emeralds trade
→ ❌ The villager plays its 'agree' sound
Expected result
The villager should play its 'disagree' sound at the final step. This is the observed result if the two trades are listed in the other order.
Attachments
Comments 4
This was not fixed in 1.20.2 Pre Release 2. It also affects 24w09a and 1.20.4, however was hit and miss in 1.20.4. It worked in one world but not in another.
My mistake, sorry. The bug only seems to affect the trade that's listed first; I've updated the report to reflect this and reopened it.
Fixed in 1.20.2 Pre-release 2.