What is wrong here?

av
3

I wanted to spawn a villager with certain trades in minecrafrt today it is there but if you click on it it only opens its inventory for a very, very short time. Can anyone help me with this? Here the command

/ summon villager ~ ~ ~ {Offers: {Recipes: [{rewardExp: 1b, buy: {id: "minecraft: emerald", Count: 20b}, buyB: {id: "minecraft: book", Count: 1b}, sell: {id: "minecraft: enchanted_book", Count: 1b, tag: {StoredEnchantments: [{id: "minecraft: looting", lvl: 3s}, {id: "minecraft: unbreaking", lvl: 3s}]} }}]}}

gl

What do you mean by

he only opens his inventory for a very, very short time

Be

You have to give the villager a job.

/ summon villager ~ ~ ~ {VillagerData: {profession: "minecraft: nitwit"}, Offers: {Recipes: [{rewardExp: 1b, buy: {id: "minecraft: emerald", Count: 20b}, buyB: {id: "minecraft: book", Count: 1b}, sell: {id: "minecraft: enchanted_book", Count: 1b, day: {StoredEnchantments: [{id: "minecraft: looting", lvl: 3s}, {id: "minecraft: unbreaking", lvl: 3s}]}}}]}}

If you don't care that the Villager is a Nitwit, you can omit this command:
To change the profession you have to use the following command:

/ data merge entity @e [type = villager, limit = 1, sort = nearest] {VillagerData: {profession: "minecraft: armorer", type: "minecraft: plains"}}

You can find out exactly how the IDs are here:

https://minecraft.gamepedia.com/...profession

av

Well I click on it and 1 second after it closes again