NBT Tags for Villager in Minecraft (Java Edition 1.14/1.15)
This Minecraft tutorial explains the NBT tags (formerly called data tags) that you can use for a villager in Minecraft Java Edition (PC/Mac) 1.14 and 1.15.
TIP: If you are not running Minecraft Java Edition (PC/Mac) 1.14/1.15, find NBT tags for villager in another version of Minecraft:
Background
In Minecraft Java Edition 1.14 and 1.15, the entity value for a villager is villager
. The villager
entity has a unique set of data tags that can be used in Minecraft commands such as: /summon and /data.
What are NBT tags (formerly called Data Tags)?
NBT tags allow you to set certain properties of an entity (such as villager
). The NBT tag is always surrounded in {} such as {NoAI:1}. If there is more than one NBT tag used in a game command, the NBT tags are separated by a comma such as {NoAI:1,CustomName:"\"Stan\""}.
List of NBT Tags
Here is a list of the NBT tags that you can use for villager
in Minecraft Java Edition (PC/Mac) 1.14 and 1.15:
NBT Tag | Value (Description) | Works With |
---|---|---|
profession | name (The name of the profession. There are 14 different professions to choose from and each profession has different clothing.) farmer armorer Example for a Farmer |
/summon /data |
level | number (The profession level of the villager. The higher the level, the better the trades the villager can offer. If you enter a number that is higher than 5, the villager will not have any traders to offer. See villager trades to learn about the different trades based on profession and level.) 1 (Novice) TIP: A villager that is a novice will not immediately select a profession and may even switch profession. If you want the villager to hold its profession, you must spawn the villager with at least a level of "Apprentice". Example for a Farmer that is an Apprentice |
/summon /data |
type | biome (The name of the biome that the villager is associated with. The biome determines the clothes that the villager wears which means that a Farmer from the Plains biome will look different than a Farmer from the Taiga biome.) plains desert TIP: If you spawn a villager in a different biome than their own, they will seek out the biome they were created for. This makes it difficult to keep a villager in a different biome than its own. Example for a Farmer that is an Apprentice from the Jungle biome |
/summon /data |
Offers | Lists the custom trades for the villager. Syntax where trade is: Example (1 trade) Example (2 trades) TIP: Try our Villager Trade Generator to help you create custom trades! |
/summon /data |
Age | ticks (The age of the villager in game ticks. Use 0 or higher for an adult. Use a negative number such as -25000 for a baby.) Example |
/summon /data |
ForcedAge | ticks (When a baby villager matures, the Age data tag will be set to ForcedAged. However, there have been bugs with this data tag so it may not work properly.) Example |
/summon /data |
LeftHanded | 0 (The villager is right-handed) Example |
/summon /data |
CustomName | name (The name to assign to the villager) Example |
/summon /data |
Health | number (The number of health points the villager has) Example |
/summon /data |
AbsorptionAmount | number (The number of absorption health points the villager has) Example |
/summon /data |
Invulnerable | 0 (The villager will take damage like normal) Example |
/summon /data |
PersistenceRequired | 0 (The villager will despawn naturally) Example |
/summon /data |
NoAI | 0 (The villager will have artificial intelligence and will move/behave like normal) Example |
/summon /data |
Silent | 0 (The villager will make its usual noises in the game) Example |
/summon /data |
Fire | ticks (The number of game ticks until the villager is no longer on fire - there are 20 ticks in a second) Example |
/summon /data |
PortalCooldown | ticks (The number of game ticks until the villager can go through a portal again - there are 20 ticks in a second) Example |
/summon /data |
Air | ticks (The number of game ticks the villager has air left for) Example |
/summon /data |
UUIDLeast | A number that specifies the right half of the UUID for the villager (use UUIDLeast and UUIDMost to target/find a particular villager in the game) Example |
/summon /data |
UUIDMost | A number that specifies the left half of the UUID for the villager (use UUIDLeast and UUIDMost to target/find a particular villager in the game) Example |
/summon /data |
id | villager (The entity value used to represent a villager in the EntityTag or Passengers tag) Example |
/summon /give |
Passengers | The mob that is riding on the villager. Use the entity value for the passenger mob Example of skeleton as passenger |
/summon /data |
NBT Tag Examples
To summon a villager with a custom name of Stan:
/summon villager ~ ~ ~ {CustomName:"\"Stan\""}
To summon a villager that is a Master Armorer from the Taiga biome:
/summon villager ~ ~ ~ {VillagerData:{profession:armorer,level:5,type:taiga}}
To summon a villager that has a custom trade of 6 emeralds for a diamond chestplate:
/summon villager ~ ~ ~ {Offers:{Recipes:[{buy:{id:emerald,Count:6}, sell:{id:diamond_chestplate,Count:1}, maxUses:9999999}]}}
Target Selectors
Before we finish discussing data tags, let's quickly explore how to use the @e target selector. The @e target selector allows you to target entities in your commands. If you use the type=villager
value, you can target villagers:
@e[type=villager]
Target Selector Examples
To change the name of the nearest villager to Joe:
/data merge entity @e[type=villager,limit=1,sort=nearest] {CustomName:"\"Joe\""}
To kill all villagers:
/kill @e[type=villager]
Next, learn how to use the game commands in Minecraft.
Command Examples
Here are some game command examples for a villager in Minecraft:
Command Generators
If you need help, you can use these tools to automatically generate commands for you:
Advertisements