NBT Tags for Villager – Wiki Guide
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.16, 1.17, 1.18, 1.19 and 1.20.
TIP: If you are not running Minecraft Java Edition (PC/Mac) 1.16/1.17/1.18/1.19/1.20, find NBT tags for villager in another version of Minecraft:
- Java Edition (PC/Mac) 1.14/1.15
- Java Edition (PC/Mac) 1.11/1.12
- Java Edition (PC/Mac) 1.10
Background
In Minecraft Java Edition 1.16, 1.17, 1.18, 1.19 and 1.20, 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.16, 1.17, 1.18, 1.19 and 1.20:
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. It uses a combination of the following tags: “buy” is the first item to buy “buyB” is optional and is the second item to buy “sell” is the item that is sold by the villager “id” is the Minecraft ID for the item “Count” is the number of items “maxUses” is the number of times that the trade can be done before it is unavailable “xp” is the amount of experience earned by a player for performing the trade “rewardExp” determines whether the player is rewarded with xp (the amount of experience set in the “xp” tag) after completing the trade “uses” is the number of time this trade has been completed “specialPrice” is a special price adjustment that is applied to the price of the first buy item in a trade when the Villager Trade Menu is opened for the first time (it then disappears and is not available for the 2nd, 3rd, 4th, etc time you access the Villager Trade menu. It is one time only!) Use a negative value to reduce the price of the first buy item or a positive value to increase the price of the first buy item. (NOTE: The game will not allow the adjusted price of the first buy item to be lower than 1 or exceed the stack size of the item.) “priceMultiplier” is the price multiplier that is applied to the first buy item in a trade. The villager can increase the price of the first buy item (not the buyB item) in the trade if the “priceMultiplier” and the “demand” values are positive. (NOTE: The new adjusted price can not exceed the stack size of the item.) Price increase = "priceMultiplier" x "demand" x "price" “demand” is an integer value that determines the demand for this trade which is used to adjust the price of the first buy item automatically by the villager. A negative value indicates negative demand for this trade and that players have been trading other items with the villager. A positive value indicates positive demand for this trade and that players have been completing this trade more (relative to the other trades offered by the villager). A positive “demand” value in combination with a positive “priceMultiplier” can cause the villager to increase the price of the first buy item in the trade (see formula in the “priceMultiplier” section). 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 |
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 netherite chestplate:
/summon villager ~ ~ ~ {Offers:{Recipes:[{buy:{id:emerald,Count:6}, sell:{id:netherite_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:
Summon Villager with Customized Trade
How to Summon a Villager