When you give this villager 4 melons, he will give you 2 emerald.
Note: Minify the command to avoid issues :)
Melon Trade
Potato Give
Pumpkin Give
Hopper Take
OP Armor! :D
Headshop
The Redstone Trader
A custom potion giver