To use a name tag, first head to an anvil. Open the anvil UI and place the name tag in the far left slot. Click on the bar above the name tag to rename the name tag. This should be the name you want to change a mob’s name to. It will cost one level and a bit of anvil durability to name your name tag. Next right click on the mob you want to Normally, zombie villagers despawn like other hostile mobs do. However, due to the bug MC-182304, zombie villagers that have been traded with do not despawn, but count towards the mob cap. To build such a mob switch, you will need a villager breeder, a job site block, and a zombie to zombify the villagers. Make sure to put blocks over the head .

how to make zombie villager not despawn without name tag