Why my Minecraft villager does not identify items while trading?

//ads -- adsterra.com -- native banner
?>
I am trying to make some custom villager trades that use emeralds with mending for money.
But if I try to trade with those emeralds, the villager doesn't trade with me.
These are the commands.
This is buying armor with emerald:
/summon villager ~ ~1.5 ~ {VillagerData:{profession:armorer,level:5,type:plains},PersistenceRequired:1,Silent:1,NoAI:1,Rotation:[270f,0f],CustomName:"\"armor\"",Offers:{Recipes:[{buy:{id:emerald,Count:8,tag:{Enchantments:[{id:mending,lvl:1}]}},sell:{id:iron_helmet,Count:1,tag:{Enchantments:[{id:protection,lvl:5}]}},rewardExp:0b,maxUses:9999999},{buy:{id:emerald,Count:8,tag:{Enchantments:[{id:mending,lvl:1}]}},sell:{id:iron_chestplate,Count:1,tag:{Enchantments:[{id:protection,lvl:5}]}},rewardExp:0b,maxUses:9999999},{buy:{id:emerald,Count:8,tag:{Enchantments:[{id:mending,lvl:1}]}},sell:{id:iron_leggings,Count:1,tag:{Enchantments:[{id:protection,lvl:5}]}},rewardExp:0b,maxUses:9999999},{buy:{id:emerald,Count:8,tag:{Enchantments:[{id:mending,lvl:1}]}},sell:{id:iron_boots,Count:1,tag:{Enchantments:[{id:protection,lvl:5}]}},rewardExp:0b,maxUses:9999999},{buy:{id:emerald,Count:24,tag:{Enchantments:[{id:mending,lvl:1}]}},sell:{id:netherite_helmet,Count:1,tag:{Enchantments:[{id:protection,lvl:5},{id:unbreaking,lvl:3}]}},rewardExp:0b,maxUses:9999999},{buy:{id:emerald,Count:24,tag:{Enchantments:[{id:mending,lvl:1}]}},sell:{id:netherite_chestplate,Count:1,tag:{Enchantments:[{id:protection,lvl:5},{id:unbreaking,lvl:3}]}},rewardExp:0b,maxUses:9999999},{buy:{id:emerald,Count:24,tag:{Enchantments:[{id:mending,lvl:1}]}},sell:{id:netherite_leggings,Count:1,tag:{Enchantments:[{id:protection,lvl:5},{id:unbreaking,lvl:3}]}},rewardExp:0b,maxUses:9999999},{buy:{id:emerald,Count:24,tag:{Enchantments:[{id:mending,lvl:1}]}},sell:{id:netherite_boots,Count:1,tag:{Enchantments:[{id:protection,lvl:5},{id:unbreaking,lvl:3}]}},rewardExp:0b,maxUses:9999999}]}}
This is buying emerald with some things:
/summon villager ~ ~1.5 ~ {VillagerData:{profession:weaponsmith,level:4,type:plains},PersistenceRequired:1,Silent:1,NoAI:1,Rotation:[90f,0f],CustomName:"\"miner\"",Offers:{Recipes:[{buy:{id:redstone,Count:16},sell:{id:emerald,Count:1,tag:{Enchantments:[{id:mending,lvl:1}]}},rewardExp:0b,maxUses:9999999},{buy:{id:lapis_lazuli,Count:16},sell:{id:emerald,Count:1,tag:{Enchantments:[{id:mending,lvl:1}]}},rewardExp:0b,maxUses:9999999},{buy:{id:iron_ingot,Count:8},sell:{id:emerald,Count:1,tag:{Enchantments:[{id:mending,lvl:1}]}},rewardExp:0b,maxUses:9999999},{buy:{id:gold_ingot,Count:8},sell:{id:emerald,Count:1,tag:{Enchantments:[{id:mending,lvl:1}]}},rewardExp:0b,maxUses:9999999},{buy:{id:stone,Count:64},sell:{id:emerald,Count:1,tag:{Enchantments:[{id:mending,lvl:1}]}},rewardExp:0b,maxUses:9999999}]}}
Also I generated some of the commands at the Digminecraft.
Pictures about "Why my Minecraft villager does not identify items while trading?"



Why is my villager trade not working?
Well, a Villager simply needs to use their Job Site block and they'll be able to trade with you again. If you're building a more traditional Village, you should make sure that everyone can easily access their own Job Site blocks.Why do villagers stop trading certain things?
Villagers will deactivate an offer if the offer has been used some number of times and it is not the villager's only offer. The chance of an offer's deactivation is random, but an offer must be used at least 3 times before it is eligible for deactivation.How do you get villagers to trade specific items?
Villagers Need Beds If villagers don't have beds, their trades won't restock - as simple as that.Fixing villagers that won't trade. Minecraft
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Pavel Danilyuk, Pavel Danilyuk, Надежда Ильина, Trang Doan