Data tags

From Mine Blocks Wiki
Revision as of 19:04, 14 October 2016 by Zanzlanz (talk | contribs)
Jump to navigation Jump to search
If you find a typo, inconsistency, or error, please sign up and help out the wiki! We can't do it without your help! :D Thank you!

Data tags are pieces of information that get stored on items and blocks. Tags are used to alter items in various ways, such as in appearance or in functionality.

Uses

Data tags can be applied to items by using the give command. They are the fourth parameter.

An example of a give command using data tags:

give leather_cap 1 0 {type:"purple", name:"Purple Hat", enchantments:["unbreaking2", "Fire Protection III"]}

Tags

Listed below are all the data tags that can be applied to items.

Tag Name Description Values and Applicable Items
type Specifies the type of the item. Oftentimes this is the color of the item, such as wool. If the value is invalid for the item, the value will be omitted. String

mob_egg: The mob spawned by the egg ("zombie", "ender dragon", "nethereye")

potion: Specifies the type of potion ("empty", "water", "fire protection +")

dye, glass, glass_backdrop, leather_boots, leather_pants, leather_tunic, leather_cap: Color ("red", "purple", "light gray")

carpet, wool, wool_backdrop: Color, or "rainbow"

balloon: Color, or "ghast"

unbreakable If enabled, and the item is a tool, the item will never lose durability. Boolean

Applies to all tools. Value is simply omitted when false.

enchantments A list of enchantments applied to the item. Array of Strings

Applies to all items. Both "unbreaking1" and "Unbreaking I" will refer to the same enchantment. Duplicate enchantments are ignored.

anvilUses Specifies the number of times the item has been used in an anvil. This only affects the cost of using an anvil on the item. Integer

Applies to all items.

name Overrides the default naming of the item (as if it was renamed by an anvil) String

Applies to all items.

showParticles When enabled, this will hide the particles of potion effects. Boolean

Only applies to potion. Value is simply omitted when false.

command Specifies the command run by a command book. String

Only applies to command_book. Command will not be checked for errors upon creation.

uses Specifies how many times a command book can be used before it disappears. Integer

Only applies to command_book. Non-positive numbers are invalid.

Colors Tags

Color value Preview
red
green
blue
brown
cyan
lightblue
lightgreen
magenta
orange
pink
purple
white
yellow
lightgray
gray
black
rainbow N/A

See Also

History

  • Introduced as an official in 1.28, however data tags were used to store item properties since 1.25.