NBT Tags in Minecraft: All you need to know

A sword's NBT tag can be seen here having been edited, confirmed by the "1 tag" present in the item description (Image via Mojang)
A sword's NBT tag can be seen here having been edited, confirmed by the "1 tag" present in the item description (Image via Mojang)

The Named Binary Tag (NBT) is one of Minecraft's more complex aspects, used on items and entities to specify and set information about them. The tag is often employed in the creation of custom maps, especially for Adventure maps.

youtube-cover

Even in vanilla Minecraft, NBT tags play a large part in dictating an entity's stats and behavior as well as defining its item properties. This information can be viewed in detail thanks to the /data command, which will present players with information on a given entity or item and their present tags.

This can be useful to look up the IDs of specific mobs and things such as their current activity, whether they are in love mode or not, and tons of other metrics.


Minecraft: Additional info on NBT tags

Outside of mobs, items are also capable of possessing certain NBT tags (Image via Mojang)
Outside of mobs, items are also capable of possessing certain NBT tags (Image via Mojang)

In addition to using the /data command, players can also use third-party NBT tag editors to change properties if they don't want to use command syntax to do the job in-game. Some players prefer this when crafting specific entities or objects, particularly in custom world creation.

Regardless, NBT tags can be used in cohesion with the /give and /summon commands to create custom items or mobs if players don't want to create the entity and then modify it afterward.

Entities by default enter a Minecraft world without any tags attached to them, and if players would like to add them manually, they can follow this process:

  1. Type /tag while aiming at the chosen entity. This could be a mob, an armor stand, or most things in between.
  2. After pressing space, the target selectors will appear, with one appearing as a long string of numbers and letters. This is the targeted entity's ID, which should be chosen to add tags.
  3. After placing another space, players can then enter "add".
  4. Players can then enter any tag they come up with. Since a tag at its essence is a descriptor, players can come up with any tag they'd like. For example, players could use the tag "Friend" and add it to a mob.
  5. After entering and successfully adding the tag, entities tagged "Friend" can now appear when searched by commands such as "/say @e[tag=Friend]" which will make the player list any entities tagged with "Friend" in the chat. For example, if the "Friend" tag was placed on a pig, the text result of the /say command would return "Pig."

In much the same way, Minecraft's NBT tags can also be removed. This can be achieved with the same syntax as adding a tag, but using the "Remove" command instead of "Add" in the command line. Editing can work in this fashion as well.

Tags can also be used to exclude certain entities in a Minecraft world. Using the "Friend" example from earlier, players can use a /give command and then use the entity tag "@e[tag=!Friend]" to exclude anything tagged as a Friend from receiving a specific item.

Minecraft's scripting language has tons of functions that can use tags to alter several parts of a given game world. It may benefit players to keep a document of the most-used ones or use the script language in a tag or tag code editor. This will allow them not to be overwhelmed in-game by the sheer amount of information available.

Learning about NBT tags is time-consuming, but for Minecraft players who may want to try their hand at in-depth content creation, NBT tags are an incredibly useful tool that can be applied even if the commands that interact with them are complex.

Players can find additional information about NBT tags on sites such as DigMinecraft or the Minecraft Wiki, which have allowed the community to source all the relevant commands pertaining to tags and targeting in one location.

Quick Links