How do i summon a villager that trades custom banners

I'm familiar with creating a villager using custom trades with command blocks, however when trying to have a villager trade items for a custom banner, it failed and only summoned a villager that trades the base banner.

I've tried

/summon villager ~ ~1 ~ {VillagerData:{profession:leatherworker,level:5,type:plains},CustomName:"\"Banner Clerk\"",Offers:{Recipes:[{buy:{id:golden_hoe,Count:1},buyB:{id:golden_axe,Count:1},sell:{id:red_banner,Count:1,BlockEntityTag:{Patterns:[{Pattern:"drs",Color:4},{Pattern:"ld",Color:14},{Pattern:"rud",Color:14},{Pattern:"mc",Color:14},{Pattern:"dls",Color:4},{Pattern:"ld",Color:14},{Pattern:"moj",Color:4},{Pattern:"tr",Color:4},{Pattern:"cbo",Color:14},{Pattern:"tts",Color:14}]}},maxUses:9999999}]}}

/summon villager ~ ~1 ~ {VillagerData:{profession:leatherworker,level:5,type:plains},CustomName:"\"Banner Clerk\"",Offers:{Recipes:[{buy:{id:golden_hoe,Count:1},buyB:{id:golden_axe,Count:1},sell:{id:red_banner,Count:1,tag:{Patterns:[{Pattern:"drs",Color:4},{Pattern:"ld",Color:14},{Pattern:"rud",Color:14},{Pattern:"mc",Color:14},{Pattern:"dls",Color:4},{Pattern:"ld",Color:14},{Pattern:"moj",Color:4},{Pattern:"tr",Color:4},{Pattern:"cbo",Color:14},{Pattern:"tts",Color:14}]}},maxUses:9999999}]}}

/summon villager ~ ~1 ~ {VillagerData:{profession:leatherworker,level:5,type:plains},CustomName:"\"Banner Clerk\"",Offers:{Recipes:[{buy:{id:golden_hoe,Count:1},buyB:{id:golden_axe,Count:1},sell:{id:red_banner,Count:1,Patterns:[{Pattern:"drs",Color:4},{Pattern:"ld",Color:14},{Pattern:"rud",Color:14},{Pattern:"mc",Color:14},{Pattern:"dls",Color:4},{Pattern:"ld",Color:14},{Pattern:"moj",Color:4},{Pattern:"tr",Color:4},{Pattern:"cbo",Color:14},{Pattern:"tts",Color:14}]},maxUses:9999999}]}}

But they all yield the same result:

Trading the base color of the banner (red) anyone know how to do this or even if this is possible?

for context on the banner that the villager's supposed to trade here is its give command: /give @p red_banner{BlockEntityTag:{Patterns:[{Pattern:"drs",Color:4},{Pattern:"ld",Color:14},{Pattern:"rud",Color:14},{Pattern:"mc",Color:14},{Pattern:"dls",Color:4},{Pattern:"ld",Color:14},{Pattern:"moj",Color:4},{Pattern:"tr",Color:4},{Pattern:"cbo",Color:14},{Pattern:"tts",Color:14}]}} 1


Solution 1:

tag is responsible for telling the trade what tags the item has, BlockEntityTag for telling the item what tags the block has. So you need both:

summon villager ~ ~1 ~ {VillagerData:{profession:leatherworker,level:5,type:plains},CustomName:"\"Banner Clerk\"",Offers:{Recipes:[{buy:{id:golden_hoe,Count:1},buyB:{id:golden_axe,Count:1},sell:{id:red_banner,Count:1,tag:{BlockEntityTag:{Patterns:[{Pattern:"drs",Color:4},{Pattern:"ld",Color:14},{Pattern:"rud",Color:14},{Pattern:"mc",Color:14},{Pattern:"dls",Color:4},{Pattern:"ld",Color:14},{Pattern:"moj",Color:4},{Pattern:"tr",Color:4},{Pattern:"cbo",Color:14},{Pattern:"tts",Color:14}]}}},maxUses:9999999}]}}