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:
- 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"}}]}} - 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:
Notes:
Created Issue:
Item count in villager trade offers is restricted to default max stack sizes
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:
- 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"}}]}}- 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:
Notes:
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:
- 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"}}]}}- 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:
Notes:
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:
- 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"}}]}}- 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:
Notes:
Item count in villager trade offers is restricted todefaultmax stack sizesItem 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:
- 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"}}]}}- 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:
Notes:
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:
- 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"}}]}}- 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:
Notes:
Can confirm
An easy fix without changing the code a bit would be to use this:
summon minecraft:villager ~ ~ ~ {VillagerData:{profession:"minecraft:cleric", level:5}, Offers:{Recipes:[{maxUses:100, sell:{count:99, id:"minecraft:emerald", components:{"minecraft:max_stack_size":99}}, buy:{count:99, id:"minecraft:diamond_sword", components:{"minecraft:max_stack_size":99}}}]}}/summon minecraft:villager ~ ~ ~ {VillagerData:{profession:"minecraft:cleric", level:5}, Offers:{Recipes:[{maxUses:100, sell:{count:99, id:"minecraft:diamond_sword", components:{"minecraft:max_stack_size":99}}, buy:{count:99, id:"minecraft:emerald", components:{"minecraft:max_stack_size":99}}}]}}This may not be fixed due to this
That command is probably the intended behavior, this may be invalid or WAI