#Tags clear and simple v1.21

4 messages · Page 1 of 1 (latest)

hollow onyx
#

There are very confusing topics and notes surrounding tags. We learn how to define tags in data/tags/block/ourtag.json and use them in the code

But no one is telling us what the values mean precisely.

from wiki, the value array specifies: 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.

The hashtag defines a tag name. Without a # preffix we are referring to objects.

That means if we declare a tag and call it metal ores to group all metal ores into a set

We only referring to the normal ore objects, and exclude the deepslate variants

{  
    "replace": false,  
    "values": [  
        "minecraft:gold_ores",  
        "minecraft:iron_ores",  
        "minecraft:copper_ores"  
    ]  
}

If we add the hashtag,

{  
    "replace": false,  
    "values": [  
        "#minecraft:gold_ores",  
        "#minecraft:iron_ores",  
        "#minecraft:copper_ores"  
    ]  
}

We are referring to the tag itself which includes, all variants of gold, iron and copper ores.

Common tags (Conventional tags)

These are the successor to forge's old oredict. They allow mod compatibility. by allowing mod authors to define their new jungle iron ore as an ore type by attaching it to both the minecraft:iron_ores tag, and c:iron_ores and also reference other ore variants

A list of common tags can be found here: https://fabricmc.net/wiki/community:common_tags

https://docs.fabricmc.net/develop/items/custom-tools#inverse-tag-getmininglevel
https://minecraft.wiki/w/Tag
https://fabricmc.net/wiki/tutorial:tags

Minecraft Wiki
Tag

Tags in data packs‌ and behavior packs‌ allow players to group different game elements together.

cinder shuttle
#

A tag is a way to say that a thing is used for something. Like piglin_loved means piglins will pick it up and admire it. The hashtag references another tag - ores might include gold ores, irons ores, etc.

hollow onyx
#

Yes, which i feel isnt written clearly enough what the hashtag means. When we define a tag we are essentially defining a set/collection. We use code to associate the tags with certain behavior.

tame pasture
#

ID of another tag of the same type, prefixed with a #.