Data tags

From Mine Blocks Wiki
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.

Usage

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

Item 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

spawn_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.

See enchanting for a list of enchantment identifiers.

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 disabled, this will hide the particles of potion effects when a potion is drank. Boolean

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

category Specifies the category of certain items. String

Only applies to potion. Potions with the "splash" category are splash potions.

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.

Block Tags

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

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

dye, glass, glass_backdrop: Color ("red", "purple", "light gray")

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

mob_head: Creeper, zombie, skeleton, enderdragon, or skin ID

name Specifies the display name of a container block (such as a chest), as if it was renamed by an anvil. String

Applies to chest, furnace, brewing_stand, enchantment_table, dropper, dispenser.

growth Specifies the growth stage of a crop. Integer

Applies to melon_seed, pumpkin_seed, seeds, carrot, potato, nether_wart, beetroot_seeds. Value clamped to range 1-7.

text Defines the writing on a sign. String

Applies only to sign.

damage Specifies the damage state of an anvil. Integer

Applies only to anvil. Value clamped to range 1-3.

items Defines the items inside of the container. Item Data or Array of Item Data

chest is an array of 27 item data.

dropper and dispenser are an array of 9 item data.

If the value is an item data without an array, the item will be duplicated for each item slot.

input Defines the input item of a block. Item Data

furnace accepts any item that can be smelted.

brewing_stand accepts any brewing ingredient.

If the value is an item data without an array, the item will be duplicated for each item slot.

fuel Defines the fuel item of a block. Item Data

furnace accepts any fuel.

brewing_stand only accepts blaze powder.

output Defines the output item(s) of a block. Item Data or Array of Item Data (for brewing_stand)

furnace accepts any item.

brewing_stand accepts potions. If the value is an item data without an array, the item will be duplicated for each item slot.

powered Defines whether a block is activated. Boolean

Only applies to the switch state of a lever

facing Determines the orientation of a block. String

coral_lantern, torch, odd_rock_torch, redstone_torch, button, lever: "left", "right", or "up".

piston, piston_sticky, hay, wood: "left", "right", "up", or "down".

Any _stair block: "left", "right", "upleft", "upright", "downleft", or "downright".

Any _slab block: "up", or "down".

head_mob: "left" or "right".

Colors Tags

For colored items or blocks, the color is specified using the type data tag.

Type Preview
red
green
blue
brown
cyan
lightblue
lightgreen
magenta
orange
pink
purple
white
yellow
lightgray
gray
black
rainbow

History

Version Date Changes
1.25 May 11, 2013
  • Added data tags to store item properties
1.28 Oct 8, 2016
  • Data tags can be specified when using the /give command

See also