User Tools

Site Tools


tutorial:tags

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
tutorial:tags [2025/12/05 21:10] – [Creating new conventional tags] cassiancctutorial:tags [2026/02/10 22:24] (current) cassiancc
Line 8: Line 8:
  
 File Location:  File Location: 
-  * ''src/main/resources/data/tutorial/tags/**blocks**/example_ores.json'' (before 1.21) 
   * ''src/main/resources/data/tutorial/tags/**block**/example_ores.json'' (since 1.21)   * ''src/main/resources/data/tutorial/tags/**block**/example_ores.json'' (since 1.21)
 +  * ''src/main/resources/data/tutorial/tags/**blocks**/example_ores.json'' (before 1.21)
  
 <code javascript> <code javascript>
Line 28: Line 28:
 Vanilla tag objects can be found in class ''<yarn class_3481>'' and ''<yarn class_3489>''. To register tag objects in your mod, see the following. Vanilla tag objects can be found in class ''<yarn class_3481>'' and ''<yarn class_3489>''. To register tag objects in your mod, see the following.
  
-=== Minecraft 1.21 and above ===+=== Minecraft 1.21.11 and above (Mojang Mappings) 
 + 
 +public class ModBlockTags { 
 +  public static final TagKey<Block> EXAMPLE_ORES = TagKey.create(Registries.BLOCK, Identifier.fromNamespaceAndPath("tutorial", "example_ores")); 
 +
 + 
 +=== Minecraft 1.21.1 and above (Mojang Mappings) 
 + 
 +public class ModBlockTags { 
 +  public static final TagKey<Block> EXAMPLE_ORES = TagKey.create(Registries.BLOCK, ResourceLocation.fromNamespaceAndPath("tutorial", "example_ores")); 
 +
 + 
 +=== Minecraft 1.21.1 through 1.21.10 (Mojang Mappings) 
 + 
 +public class ModBlockTags { 
 +  public static final TagKey<Block> EXAMPLE_ORES = TagKey.create(Registries.BLOCK, ResourceLocation.fromNamespaceAndPath("tutorial", "example_ores")); 
 +
 + 
 +=== Minecraft 1.21 and above (Yarn Mappings) ===
  
 <yarncode java> <yarncode java>
Line 36: Line 54:
 </yarncode> </yarncode>
  
-=== Minecraft 1.19.3 through 1.20.6 ===+=== Minecraft 1.19.3 through 1.20.6 (Yarn Mappings) ===
  
 <yarncode java> <yarncode java>
Line 44: Line 62:
 </yarncode> </yarncode>
  
-=== Minecraft 1.18.2 through 1.19.2 ===+=== Minecraft 1.18.2 through 1.19.2 (Yarn Mappings) ===
  
 <yarncode java> <yarncode java>
Line 52: Line 70:
 </yarncode> </yarncode>
  
-=== Minecraft 1.17.1 through 1.18.1 ===+=== Minecraft 1.17.1 through 1.18.1 (Yarn Mappings) ===
  
 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 62: Line 80:
 </yarncode> </yarncode>
  
-=== 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:
tutorial/tags.txt · Last modified: 2026/02/10 22:24 by cassiancc