Difference between revisions of "Data tags"
m |
(Added the block section, with type only so far) |
||
Line 10: | Line 10: | ||
== Tags == | == Tags == | ||
+ | === Item Tags === | ||
Listed below are all the data tags that can be applied to items. | Listed below are all the data tags that can be applied to items. | ||
Line 62: | Line 63: | ||
Only applies to <code>potion</code>. Value is simply omitted when true. | Only applies to <code>potion</code>. Value is simply omitted when true. | ||
+ | |- | ||
+ | |<code>category</code> | ||
+ | |Specifies the category of certain items. | ||
+ | |''String'' | ||
+ | |||
+ | Only applies to <code>potion</code>. Potions with the "splash" category are [[splash potions]]. | ||
|- | |- | ||
|<code>command</code> | |<code>command</code> | ||
Line 74: | Line 81: | ||
Only applies to <code>command_book</code>. Non-positive numbers are invalid. | Only applies to <code>command_book</code>. Non-positive numbers are invalid. | ||
+ | |} | ||
+ | |||
+ | === Block Tags === | ||
+ | Listed below are all the data tags that can be applied to blocks. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | !Tag Name | ||
+ | !Description | ||
+ | !Values and Applicable Blocks | ||
+ | |- | ||
+ | |<code>type</code> | ||
+ | |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'' | ||
+ | |||
+ | <code>dye</code>, <code>glass</code>, <code>glass_backdrop</code>: Color ("red", "purple", "light gray") | ||
+ | |||
+ | <code>carpet</code>, <code>wool</code>, <code>wool_backdrop</code>: Color, or "rainbow" | ||
+ | |||
+ | <code>mob_head</code>: Creeper, zombie, skeleton, enderdragon, or skin ID | ||
+ | |||
|} | |} | ||
=== Colors Tags === | === Colors Tags === | ||
− | For colored items, the color is specified using the <code>type</code> data tag. | + | For colored [[items]] or [[blocks]], the color is specified using the <code>type</code> data tag. |
{{Colors|rainbow=true}} | {{Colors|rainbow=true}} | ||
Revision as of 15:11, 1 October 2019
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
|
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 |
category
|
Specifies the category of certain items. | String
Only applies to |
command
|
Specifies the command run by a command book. | String
Only applies to |
uses
|
Specifies how many times a command book can be used before it disappears. | Integer
Only applies to |
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
|
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 |
|
1.28 | Oct 8, 2016 |
|