Updated:

Summon a villager with a profession (Java)

/summon minecraft:villager ~ ~ ~ {VillagerData:{profession:"minecraft:librarian",level:1,type:"minecraft:plains"}}

profession is the job, level the trade level and type the biome look.

Profession IDs and job site blocks

ProfessionIDJob site block
ArmorerarmorerBlast furnace
ButcherbutcherSmoker
CartographercartographerCartography table
ClericclericBrewing stand
FarmerfarmerComposter
FishermanfishermanBarrel
FletcherfletcherFletching table
LeatherworkerleatherworkerCauldron
LibrarianlibrarianLectern
MasonmasonStonecutter
ShepherdshepherdLoom
ToolsmithtoolsmithSmithing table
WeaponsmithweaponsmithGrindstone
Nitwit (never works)nitwitNone
UnemployednoneNone

Levels and types

level runs from 1 (Novice) to 5 (Master). Higher levels unlock more trades.

type sets the outfit: desert, jungle, plains, savanna, snow, swamp or taiga, each with the minecraft: prefix.

Change a villager that already exists (Java)

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

This turns the nearest villager into a librarian. A villager that has already traded may keep its old trades, so use a freshly summoned villager when you need new ones. For fully custom trades, see the villager shop guide.

Survival and Bedrock

Bedrock commands cannot set the profession in detail, so use job site blocks. This also works in Java survival.

  1. Find a villager that has never traded.
  2. If it already has a job, break its job site block to make it unemployed.
  3. Place the job site block you want nearby. The villager takes that job after a moment.

Once a villager has traded, its profession is locked and breaking the block does nothing.

When it does not work

Common questions

Check your command

The Command Error Doctor checks common syntax mistakes in your browser.