tutorial:tags
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| tutorial:tags [2023/09/13 15:33] – Improve conventional tag documentation haykam | tutorial:tags [2026/02/10 22:24] (current) – cassiancc | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Tags ====== | ====== Tags ====== | ||
| - | Tags are groups of blocks, items, fluids, biomes or other registry objects which share similar properties. They can be used in recipes to allow for multiple items to be used in the same recipe interchangeably. Read more on what tags are on the [[https:// | + | Tags are groups of blocks, items, fluids, biomes or other registry objects which share similar properties. They can be used in recipes to allow for multiple items to be used in the same recipe interchangeably. Read more on what tags are on the [[https:// |
| - | ===== Tag Example | + | ===== Creating tags ===== |
| - | File Location: '' | + | ==== Defining through JSON ==== |
| + | |||
| + | File Location: | ||
| + | * '' | ||
| + | * '' | ||
| <code javascript> | <code javascript> | ||
| Line 18: | Line 22: | ||
| The ''" | The ''" | ||
| - | ===== Using tags in code ===== | + | ==== Accessing |
| For some cases, you might want to have tags as registered objects on code. For example, methods like '' | For some cases, you might want to have tags as registered objects on code. For example, methods like '' | ||
| Line 24: | Line 28: | ||
| Vanilla tag objects can be found in class ''< | Vanilla tag objects can be found in class ''< | ||
| - | === Minecraft 1.19.3 and above === | + | === Minecraft 1.21.11 and above (Mojang Mappings) |
| + | |||
| + | public class ModBlockTags { | ||
| + | public static final TagKey< | ||
| + | } | ||
| + | |||
| + | === Minecraft 1.21.1 and above (Mojang Mappings) | ||
| + | |||
| + | public class ModBlockTags { | ||
| + | public static final TagKey< | ||
| + | } | ||
| + | |||
| + | === Minecraft 1.21.1 through 1.21.10 (Mojang Mappings) | ||
| + | |||
| + | public class ModBlockTags { | ||
| + | public static final TagKey< | ||
| + | } | ||
| + | |||
| + | === Minecraft 1.21 and above (Yarn Mappings) === | ||
| + | |||
| + | < | ||
| + | public class ModBlockTags { | ||
| + | public static final TagKey< | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | === Minecraft 1.19.3 through 1.20.6 (Yarn Mappings) | ||
| < | < | ||
| Line 32: | Line 62: | ||
| </ | </ | ||
| - | === Minecraft 1.18.2 through 1.19.2 === | + | === Minecraft 1.18.2 through 1.19.2 |
| < | < | ||
| Line 40: | Line 70: | ||
| </ | </ | ||
| - | === Minecraft 1.17.1 through 1.18.1 === | + | === Minecraft 1.17.1 through 1.18.1 |
| In Minecraft 1.17.1 through 1.18.1, Fabric API provides a helper method for creating a tag: | In Minecraft 1.17.1 through 1.18.1, Fabric API provides a helper method for creating a tag: | ||
| Line 50: | Line 80: | ||
| </ | </ | ||
| - | === Minecraft 1.17 and below === | + | === Minecraft 1.17 and below (Yarn Mappings) |
| In Minecraft 1.17 (not including Minecraft 1.17.1) and earlier versions, Fabric API provides a different API for creating a tag: | In Minecraft 1.17 (not including Minecraft 1.17.1) and earlier versions, Fabric API provides a different API for creating a tag: | ||
| Line 62: | Line 92: | ||
| Note that '' | Note that '' | ||
| - | ===== Conventional | + | ===== Conventional |
| Conventional tags are a standardized tag naming scheme that aims to reduce guesswork and inconsistency for mod developers, data pack authors, and mod pack authors. These tags share the '' | Conventional tags are a standardized tag naming scheme that aims to reduce guesswork and inconsistency for mod developers, data pack authors, and mod pack authors. These tags share the '' | ||
| Line 70: | Line 100: | ||
| On the other hand, pieces of content that are unique enough to not be interchangable should not use conventional tags. For example, if a mod adds a unique set of machines that must be grouped within a tag, it should place these machines in a tag in its own namespace, such as '' | On the other hand, pieces of content that are unique enough to not be interchangable should not use conventional tags. For example, if a mod adds a unique set of machines that must be grouped within a tag, it should place these machines in a tag in its own namespace, such as '' | ||
| - | ======= Creating | + | ==== Creating |
| Conventional tags are simply tags in the '' | Conventional tags are simply tags in the '' | ||
| - | - '' | + | * '' |
| - | - '' | + | |
| - | - '' | + | |
| - | A flat structure is used rather than a hierarchal | + | Since 1.21, A hierarchal |
| - | ====== Existing | + | ==== Existing |
| - | Fabric API ships definitions for conventional tags in its '' | + | Fabric API ships definitions for conventional tags in its '' |
| - | A (possibly outdated) directory of general known conventional tags is available on [[known_tags|a separate page]]. | + | A (possibly outdated) directory of general known conventional tags is available on [[community: |
tutorial/tags.1694619213.txt.gz · Last modified: 2023/09/13 15:33 by haykam