Adding a new villager profession

Written by cubicfloof for 1.20 - 1.21.1

This guide covers the following:

Registering a new POI type

Adding the POI type to acquirable job sites

This step is required to make the villager actually start looking for their workstation. If the POI type is not added to the acquirable job sites, villagers will not acknowledge the workstation.

data/minecraft/tags/point_of_interest_type/acquirable_job_site.json

{
    "values": [
        "mod:profession"
    ]
}

Creating a unique sound event

Villagers trigger the SoundEvent associated with their profession whenever they interact with their workstation.

Defining sound events

Sound events allow Minecraft to display the correct subtitles and allow you to mix and match existing or new sounds. To do this, create a sounds.json file in your mod’s asset folder. Refer to the sounds.json page on the Minecraft Wiki for insights on how to write such file.

In this example we have an Enchanter profession. If its POI was an Enchanting Table then we can re-use Minecraft’s sound.

{
  "entity.villager.work_enchanter": {
    "subtitle": "subtitles.entity.villager.work_enchanter",
    "sounds": [
      {
        "name": "minecraft:block.enchantment_table.use",
        "type": "event"
      }
    ]
  }
}

Registering sound events

Registering the new Villager profession

Adding trades to profession

Minecraft provides several ItemListings, as shown in the table below:

ItemListing Example
ItemsForEmeralds 1 Emerald for 2 Redstone Dust
EmeraldForItems 1 Lapis Lazuli for 1 Emerald
ItemsAndEmeraldsToItems 1 Emerald and 6 Raw Cod
EnchantBookForEmeralds 22 Emeralds and 1 Book for 1 Enchanted Book
EnchantedItemForEmeralds 21 Emeralds and 1 Iron Sword for 1 Enchanted Iron Sword
SuspiciousStewForEmerald 1 Emerald for 1 Suspicious Stew
TippedArrowForItemsAndEmeralds 2 Emeralds and 5 Arrows for 5 Tipped Arrows

Adding assets & resources

Language files

Don’t forget to include translation text for the name of your new profession.

assets/mod/lang/en_us.json

{
    "entity.minecraft.villager.profession": "Profession"
}

Textures

Provide textures for your new profession in assets/[mod]/textures/entity/villager/profession/[profession].png.

Create a corresponding .mcmeta file, if you want to provide a different hat appearance.

{
    "villager": {
        "hat": "partial"
    }
}