Mojira Archive
MC-269813

Item count in villager trade offers is restricted to standard max stack sizes by default

When attempting to create a villager with a trade offer that either buys or sells an item with a max stack size above the default allowed size, the trades will not function as expected, being restricted down to the default values.

Steps to Reproduce:

  1. Summon these villagerss
    /summon minecraft:villager ~ ~ ~ {VillagerData:{profession:"minecraft:cleric", level:5}, Offers:{Recipes:[{maxUses:100, sell:{count:99, id:"minecraft:emerald"}, buy:{count:99, id:"minecraft:diamond_sword"}}]}}
    
    /summon minecraft:villager ~ ~ ~ {VillagerData:{profession:"minecraft:cleric", level:5}, Offers:{Recipes:[{maxUses:100, sell:{count:99, id:"minecraft:diamond_sword"}, buy:{count:99, id:"minecraft:emerald"}}]}}
    
  2. Open their respective trading UI's

Observed & Expected Results:

- The item the villager is buying will properly show the expected value of 99 for the item, but will be discounted down to the default max size of 64, despite the item not actually being 'discounted'. The item that the villager is selling will simpy be restricted down to the default max stack size. (one for 'non-stackables', and 64 for most items, etc)
- The villager would require the the player have the proper amount of items to buy (not at a discounted price), and be rewarded with the intended amount.

Screenshots/Videos:

VillagersMax.mp4

Notes:

  1. This behavior could be intentional based off of the 'fixed' command in the pinned comment.
  2. Related to MC-269700 MC-269684

Works As Intended

[Mod] Jiingy

2024-03-23, 06:31 PM

2024-04-10, 07:00 AM

2024-04-10, 07:00 AM

2

4

Community Consensus

Low

Platform

Commands, Trading

component, max_stack_size, villager-trade

24w12a

-