Spawn a villager (you can set NoAI to 1b on him to make reproduction easier).
Make him sell a nonstackable item and set recipe's maxUses to a low value:
/data modify entity @e[type=villager,sort=nearest,limit=1] Offers.Recipes[0] merge value {uses:0,maxUses:8,buy:{id:"minecraft:emerald",Count:1b},sell:{id:"minecraft:stone_shovel",Count:1b}}
Put 8 emeralds in a first trade slot, watch your inventory and shiftclick the shovel.
7 shovels flashed and disappeared right away, you got only 1 shovel, and the trade has reached it's max uses:
/data get entity @e[type=villager,sort=nearest,limit=1] Offers.Recipes[0].uses
Linked issues
duplicates 1
Comments 0
No comments.