Tag
Tags (also called registry tags) in data packs[JE only] and behavior packs[BE only] allow players to group different game elements together.
Usage[edit | edit source]
Java Edition[edit | edit source]
Tags are part of the data pack directory structure, highlighted below:
/
<data pack name>
pack.mcmeta
data
<namespace>
tags
function
<name>.json: A function tag.
<registry name>
<name>.json: A tag for the corresponding registry.
- More directories…
Minecraft defines many tags in the vanilla data pack in the minecraft
namespace. These tags are often referenced by the code or other vanilla data pack files. Modifying those tags through a data pack therefore has a direct effect. For example, vanilla block tags are used for various block behaviors, vanilla item tags are used for various item behaviors, vanilla advancement files and vanilla recipe files, and vanilla entity type tags are used for various mob behaviors. See § List of tag types section for their usages.
Resource location[edit | edit source]
The resource location of a tag is also in the format of <namespace>:<path>
, where namespace is the name of the folder that the tags folder is in, and path is the JSON file's path under the respective tag folder.
For example, JSON file 'data/wiki/tags/block/foo/example.json' defines a block tag with the resource location of wiki:foo/example
.
To distinguish normal contents from tags, a “#” is usually required before tag's resource location.
JSON format[edit | edit source]
- [NBT Compound / JSON Object] The root object.
- [Boolean] replace: Optional. Whether or not the contents of this tag should completely replace tag contents from different lower priority data packs with the same resource location. When
false
the tag's content is appended to the contents of the higher priority data packs, instead. Defaults tofalse
. - [NBT List / JSON Array] values: A list of mix and match of object names and tag names. For tags, recursive reference is possible, but a circular reference causes a loading failure.
- [String]: An object's resource location.
- [String]: ID of another tag of the same type, prefixed with a
#
. - [NBT Compound / JSON Object]: An entry with additional options.
- [String] id: A string in one of the string formats above.
- [Boolean] required: Whether or not loading this tag should fail if this entry is not found, true by default (also for the string entries). A tag that fails to load can still be referenced in any data pack and be (re)defined in other data packs. In other words, only the entries in this JSON file are ignored if this entry cannot be found.
- [Boolean] replace: Optional. Whether or not the contents of this tag should completely replace tag contents from different lower priority data packs with the same resource location. When
Bedrock Edition[edit | edit source]
Tags are defined in the block's, item's, and biome's behavior as follows:
JSON format[edit | edit source]
- [NBT Compound / JSON Object] The root object.
- [NBT Compound / JSON Object] minecraft:<definition>: The type of definition. Must be a
block
,item
, orbiome
.- [NBT Compound / JSON Object] components
- [NBT Compound / JSON Object] minecraft:tags (Biomes and items only)
- [NBT List / JSON Array] tags: List of tags.
- [String]: A tag name.
- [NBT List / JSON Array] tags: List of tags.
- [NBT Compound / JSON Object] tag:<tag name>: (Blocks only)
<tag name>
is replaced by the name of the tag. Object must be empty.
- [NBT Compound / JSON Object] minecraft:tags (Biomes and items only)
- [NBT Compound / JSON Object] components
- [NBT Compound / JSON Object] minecraft:<definition>: The type of definition. Must be a
A block, item, or biome may have multiple tags. Custom and vanilla tags are authorized.
Tags can be used to run queries in commands and behavior packs.
List of tag types[edit | edit source]
This section lists the tag types that are used by the game to affect its behavior in various ways, as well as those that are populated by default, even if the game does not use them to control some behavior.
Java Edition[edit | edit source]
It is possible to defined tags for any registry. The list below show only the ones used by the game.
- Block
- Item
- Function
- Fluid
- Entity type
- Game event
- Biome
- Flat level generator preset
- World preset
- Structure
- Cat variant
- Point of interest type
- Painting variant
- Banner pattern
- Instrument
- Damage type
- Enchantment
Bedrock Edition[edit | edit source]
History[edit | edit source]
[hide]Java Edition | |||||||
---|---|---|---|---|---|---|---|
1.13 | 17w49a | Added tags type for blocks and items. | |||||
17w49b | Functions can now be tagged. | ||||||
18w19a | Added fluids tag type. | ||||||
1.14 | 18w43a | Added entitys tag type. | |||||
1.16.2 | 20w30a | Added the replace property in tag. | |||||
Release Candidate 1 | Entries in a tag can now be optional with the required property. | ||||||
1.16.5 | 20w49a | Added game events tag type. | |||||
1.18.2 | 22w06a | Tags can now be defined for any type in the registry, rather than only blocks, items, fluids, entity types, game events and functions previously. | |||||
1.18.2 | 22w07a | Added biome tags. | |||||
1.19 | 22w11a | Added world preset and flat level generator preset tags. | |||||
Added structure tags. | |||||||
22w14a | Added cat variant and point of interest tags. | ||||||
22w16a | Added painting variant tags. | ||||||
22w18a | Added banner pattern and instrument tags. | ||||||
1.19.4 | 23w06a | Added damage type tags. | |||||
1.20.5 | Pre-release 1 | Added enchantment tags. | |||||
[hide]Bedrock Edition | |||||||
? | Added tags for blocks, items, and biomes. | ||||||
1.19.40 | Preview 1.19.40.22 | Added new item tags. | |||||
1.20.50 | Preview 1.20.50.20 | The way an item can be tagged has been changed. | |||||
1.20.60 | Preview 1.20.60.24 | The way a biome can be tagged has been changed. |
Issues[edit | edit source]
Issues relating to "Tag" are maintained on the bug tracker. Issues should be reported and viewed there.
[edit | edit source]
[hide] | |||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
|