Merchant menu can resolve the wrong offer
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 12.7k
- Forks
- 3.5k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 11
Description
Expected behavior
When a player selects a specific villager trade, the output slot should only show the result of that selected offer if the current input items satisfy that offer.
If the selected offer does not match the current inputs, the output slot should remain empty. The server should not fall back to another matching offer.
Observed/Actual behavior
A librarian had both of these offers available at the same time:
emerald + book -> enchanted book
emerald -> lantern
If I selected the enchanted book trade and placed only emerald(s) into the payment slot while leaving the second required slot empty, the output slot showed a lantern instead of remaining empty.
So the selected trade was not respected and another matching offer was resolved instead.
Steps/models to reproduce
- Start a clean Paper server on the latest build for your Minecraft version, with no plugins and no datapacks.
- Get a librarian that has both of these offers available:
emerald + book -> enchanted book
emerald -> lantern - Open the merchant UI.
- Select the enchanted book trade.
- Put only emerald(s) into the first payment slot and leave the second slot empty.
- Observe that the output slot shows a lantern instead of staying empty.
This appears to happen when the selected offer is the first recipe in the merchant offer list.
Plugin and Datapack List
Plugins: None
Datapacks: None
Paper version
This server is running Paper version 1.21.11-127-main@bd74bf6 (2026-03-10T02:55:23Z) (Implementing API version 1.21.11-R0.1-SNAPSHOT)
You are running the latest version
Previous version: 1.21.11-35-9ce7072 (MC: 1.21.11)
Other
mb fix
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the librarian merchant scenario described in the issue on the specified Paper version, focusing on selecting the first offer and leaving its second payment slot empty. Trace how the selected offer and matching offers are resolved. Done when an unmatched selected offer leaves the output empty instead of showing another offer's result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100