User Tools

Site Tools


tutorial:shield

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tutorial:shield [2023/12/22 08:07] – finished with page update cringestar_boitutorial:shield [2024/09/29 19:35] (current) – updated with 1.21 guide and past guides cringestar_boi
Line 1: Line 1:
-====== Making a Custom Shield in Minecraft [1.20] ======+====== Making a Custom Shield in Minecraft [1.19-1.21.1] ====== 
 +:!: The tutorial depends on third-party libraries.
  
-Congrats! You just learned how to create your custom sword in the last tutorial! Now imagine you want to shield yourself from that sword if your friend got it. If you made it too op, a regular shield won't do. So we will see how to make a custom shield.\\  +Congrats! You just learned how to create your custom tools in the last tutorial! Now imagine you want to shield yourself from that sword if your friend got it. If you made it too op, a regular shield won't do. So we will see how to make a custom shield.
-Luckily, StellarWind22 has already made a library to help with this! If she didn't, you probably would be sitting here for the next hour to follow this tutorial, so thanks StellarWind22!+
  
-Library source is available at https://github.com/CrimsonDawn45/Fabric-Shield-Lib+Luckily, StellarWind22 has already made a library to help with this! If she didn't, you probably would be sitting here for the next hour following this tutorial, so thanks StellarWind22! 
 + 
 +The library source is available at https://github.com/CrimsonDawn45/Fabric-Shield-Lib
  
 Library compiled as a jar is available at https://www.curseforge.com/minecraft/mc-mods/fabric-shield-lib Library compiled as a jar is available at https://www.curseforge.com/minecraft/mc-mods/fabric-shield-lib
Line 10: Line 12:
 ===== Adding the library to your project ===== ===== Adding the library to your project =====
  
-Add the following code to the files mentioned:\\ \\  +Add the following code to the files mentioned: 
-**gradle.properties**\\  + 
-<code java+**gradle.properties** 
-fabric_shield_lib_version=1.7.2-1.20.4 +<file properties gradle.properties
-midnightlib_version=1.5.2-fabric +fabric_shield_lib_version=1.7.2-1.21.1 
-mod_menu_version=9.0.0-pre.1+midnightlib_version=1.5.8-fabric 
 +mod_menu_version=11.0.1
 fabricasm_version=2.3 fabricasm_version=2.3
-</code>\\  +</file> 
-**build.gradle** (under dependencies)\\  + 
-<code java>+**build.gradle** (under ''dependencies'' block)  
 +<file groovy build.gradle>
  modImplementation "com.github.CrimsonDawn45:Fabric-Shield-Lib:v${project.fabric_shield_lib_version}"  modImplementation "com.github.CrimsonDawn45:Fabric-Shield-Lib:v${project.fabric_shield_lib_version}"
- 
  modImplementation "com.terraformersmc:modmenu:${project.mod_menu_version}"  modImplementation "com.terraformersmc:modmenu:${project.mod_menu_version}"
- 
  modImplementation "maven.modrinth:midnightlib:${project.midnightlib_version}"  modImplementation "maven.modrinth:midnightlib:${project.midnightlib_version}"
- 
  modImplementation "com.github.Chocohead:Fabric-ASM:v${project.fabricasm_version}"  modImplementation "com.github.Chocohead:Fabric-ASM:v${project.fabricasm_version}"
-</code>\\ +</file>
  
-At the time of writing, latest project.fabric_shield_lib_version should be 1.7.2-1.20.4. This page will be updated whenever a new update comes out.\\ \\  +At the time of writing, the latest project.fabric_shield_lib_version should be 1.7.2, which supports versions: 
-**build.gradle** (inside repositories, the one above dependencies)\\  +  * **1.21** **1.21.1** (''1.7.2-1.21.1''
-<code java>+  * **1.20.5** - **1.20.6** (''1.7.2-1.20.6''
 +  * **1.20.2** - **1.20.4** (''1.7.2-1.20.4''
 +  * **1.20** - **1.20.1** (''1.7.2-1.20.1''
 +  * **1.19.3** - **1.19.4** (''1.7.2-1.19.4''
 +  * **1.19** - **1.19.2** (''1.7.2-1.19.2''
 +  * **1.18.2** (''1.7.2-1.18.2''
 +  * **1.17.1** (''1.7.2-1.17.1'')\\  
 +**build.gradle** (inside ''repositories'' block
 +<file groovy build.gradle>
  maven {url = 'https://jitpack.io'}  maven {url = 'https://jitpack.io'}
  maven {url "https://maven.terraformersmc.com/releases/"}  maven {url "https://maven.terraformersmc.com/releases/"}
  maven {url = "https://api.modrinth.com/maven"}  maven {url = "https://api.modrinth.com/maven"}
-</code>\\ +</file>\\ 
  
-__//**Midnight Lib and FabricASM are included in FabricShieldLib release (.jar on Curseforge/Modrinth) but need to be used as dependencies when developing**//__+__//**Midnight Lib and FabricASM are included in the FabricShieldLib release (.jar on Curseforge/Modrinth) but need to be used as dependencies when developing**//__
  
 ===== Adding a custom shield ===== ===== Adding a custom shield =====
-**If you want your shield to support banner decoration on your shield, please skip to the next section**\\ +**If you want your shield to support banner decoration on your shield, please skip to the next section**
-On to the non-boring steps! We will now make a custom shield!\\ \\  +
-If you have followed the above steps correctly and refreshed the project, then you will have the fabric shield api installed.\\  +
-If so, the first step to do is create a new instance of an Item like: +
-<code java> +
-public static final Item NETHERITE_SHIELD = new FabricShieldItem(new FabricItemSettings().maxDamage(2500), 10, 13, Items.NETHERITE_INGOT); // FabricShieldItem(settings.maxDamage(durability), cooldownTicks, enchantability, repairItems) +
-</code>+
  
-Then, we have to register it, like so: +On to the non-boring steps! We will now make a custom shield!
-  +
-<code java> +
-Registry.register(Registries.ITEM, new Identifier("examplemod", "netherite_shield"), NETHERITE_SHIELD); +
-</code>+
  
-If you want to add your shield to a creative tab, add this into your ''onInitialize()'' method+If you have followed the above steps correctly and refreshed the project, then you will have the FabricShieldLib installed. 
-<code java> + 
-ItemGroupEvents.modifyEntriesEvent(ItemGroups.COMBAT).register(entries -> { +If so, the first step to do is create new instance of an ''Item'' (see [[items]] tutorial), like
- entries.add(NETHERITE_SHIELD); +<code java TutorialItems
-});+public final class TutorialItems { 
 +    // ... 
 +    public static final Item NETHERITE_SHIELD = register(new FabricShieldItem(new FabricItemSettings().maxDamage(2500), 10, 13, Items.NETHERITE_INGOT), "netherite_shield");  
 +    //The constructor for the item takes in the following values: FabricBannerShieldItem(settings.maxDamage(durability), cooldownTicks, enchantability, repairItems 
 +    // ... 
 +}
 </code> </code>
  
-And our shield is (code-wise) done!\\  +If you want to add your shield to a [[itemgroup|item groups]], for example, the "Combat" groupuse:
-Now, we have to create the textures and models of the shield.\\  +
-For the texture, you can use anything. A good place to start is to look at Mojang's shield texture and change it. Put it in ''resources/assets/examplemod/textures/item/netherite_shield.png''\\  +
-Now, for the modelswe have to write a few .json files.\\ +
  
 +<yarncode java ExampleMod>
 +public class ExampleMod implements ModInitializer {
 +    @Override
 +    public void onInitialize() {
 +        ItemGroupEvents.modifyEntriesEvent(ItemGroups.COMBAT).register(entries -> {
 +            entries.add(NETHERITE_SHIELD);
 +        });
 +    }
 +}
 +</yarncode>
  
-Inside ''resources/assets/examplemod/models/item/'', create a ''netherite_shield.json'' file and put this inside it:\\ +And our shield is (code-wise) done!
  
-<code javascript>+Now, we have to create the textures and models of the shield. 
 + 
 +For the texture, you can use anything. A good place to start is to look at Mojang's shield texture and change it. Put it in ''resources/assets/tutorial/textures/item/netherite_shield.png'' 
 + 
 +Now, for the models, we have to write a few .json files. 
 + 
 +Inside ''resources/assets/tutorial/models/item/'', create a ''netherite_shield.json'' file and put this inside it: 
 + 
 +<file javascript resources/assets/tutorial/models/item/netherite_shield.json>
 { {
     "parent":"fabricshieldlib:item/fabric_shield",     "parent":"fabricshieldlib:item/fabric_shield",
     "textures":{     "textures":{
-        "shield":"examplemod:item/netherite_shield"+        "shield":"tutorial:item/netherite_shield"
     },     },
     "overrides": [     "overrides": [
Line 80: Line 99:
                 "blocking": 1                 "blocking": 1
             },             },
-            "model": "examplemod:item/netherite_shield_blocking"+            "model": "tutorial:item/netherite_shield_blocking"
         }         }
     ]     ]
 } }
-</code>\\ +</file
  
 In the same folder, create another file, ''netherite_shield_blocking.json'', and put his inside it:  In the same folder, create another file, ''netherite_shield_blocking.json'', and put his inside it: 
-<code javascript>+<file javascript resources/assets/tutorial/models/item/netherite_shield_blocking.json>
 { {
   "parent": "fabricshieldlib:item/fabric_shield_blocking",   "parent": "fabricshieldlib:item/fabric_shield_blocking",
   "textures":{   "textures":{
-    "shield":"examplemod:item/netherite_shield"+    "shield":"tutorial:item/netherite_shield"
   }   }
 } }
-</code>\\ +</file>
  
-Lastly, create a ''shields.json'' file in ''resources/data/c/tags/items/shields.json'' and add your shield to it: +Then, as a [[tags|conventional tag]], create a ''shield.json'' file in ''resources/data/c/tags/item/tools/shield.json'' and add your shield to it: 
-<code javascript>+<code javascript resources/data/c/tags/items/shields.json>
 { {
   "replace": false,   "replace": false,
   "values": [   "values": [
-    "examplemod:netherite_shield"+    "tutorial:netherite_shield"
   ]   ]
 } }
-</code>\\ +</code>
  
-Don't forget to add it to **en_us.json** in ''resources/assets/lang/en_us.json''\\  +Lastly, to make it enchantable, create a ''durability.json'' file in ''resources/data/minecraft/tags/item/enchantable/durability.json'' and add your shield to it: 
-<code javascript>+<code javascript resources/data/minecraft/tags/item/enchantable/durability.json>
 { {
-  "item.examplemod.netherite_shield": "Netherite Shield"+  "replace": false, 
 +  "values":
 +    "tutorial:netherite_shield" 
 +  ] 
 +
 +</code> 
 + 
 +Don't forget to add it to **en_us.json** in ''resources/assets/tutorial/lang/en_us.json'' 
 +<code javascript resources/assets/tutorial/lang/en_us.json> 
 +
 +  "item.tutorial.netherite_shield": "Netherite Shield"
 } }
 </code>\\  </code>\\ 
Line 115: Line 144:
  
 ===== Adding a custom shield with banner support ===== ===== Adding a custom shield with banner support =====
-If you want to make your shield accept banners and decorateable like a vanilla shield, the process is slightly different.+The process is slightly different if you want to make your shield accept banners and decorateable like a vanilla shield.
  
-We still make the item in the same way, just make it a FabricBannerShieldItem: +We still make the item in the same way, just make it a ''FabricBannerShieldItem''
-<code java> +<code java TutorialItems
-public static final Item NETHERITE_BANNER_SHIELD = new FabricBannerShieldItem(new FabricItemSettings().maxDamage(2500), 10, 13, Items.NETHERITE_INGOT); // FabricBannerShieldItem(settings.maxDamage(durability), cooldownTicks, enchantability, repairItems)+    public static final Item NETHERITE_BANNER_SHIELD = register(new FabricBannerShieldItem(new FabricItemSettings().maxDamage(2500), 10, 13, Items.NETHERITE_INGOT), "netherite_banner_shield");
 </code> </code>
- +If you want to add your shield to a [[itemgroup|item groups]], for example, the "Combat" group, use:  
-Then, we have to register it:+
    
-<code java> +<yarncode java ExampleMod>   
-Registry.register(Registries.ITEM, new Identifier("examplemod", "netherite_banner_shield"), NETHERITE_BANNER_SHIELD); +public class ExampleMod implements ModInitializer {   
-</code> +    @Override   
- +    public void onInitialize() {   
-If you want to add your shield to a creative tab, add this into your ''onInitialize()'' method: +        ItemGroupEvents.modifyEntriesEvent(ItemGroups.COMBAT).register(entries -> {   
-<code java> +            // ...  
-ItemGroupEvents.modifyEntriesEvent(ItemGroups.COMBAT).register(entries -> { +            entries.add(NETHERITE_BANNER_SHIELD);   
- entries.addAfter(Items.SHIELD,NETHERITE_BANNER_SHIELD); +        });   
-}); +    }  
-</code>+}   
 +</yarncode>
  
 Now the item is created, we need to set up its rendering. For these steps, we are going to be working in our client mod initializer, which should already be set up for you in the fabric example mod. Now the item is created, we need to set up its rendering. For these steps, we are going to be working in our client mod initializer, which should already be set up for you in the fabric example mod.
- 
  
 First, we will need to create an ''EntityModelLayer'' to use later. First, we will need to create an ''EntityModelLayer'' to use later.
 <code java> <code java>
 +@Environment(EnvType.CLIENT)
 public class ExampleModClient implements ClientModInitializer { public class ExampleModClient implements ClientModInitializer {
- +    public static final EntityModelLayer NETHERITE_BANNER_SHIELD_MODEL_LAYER = new EntityModelLayer(Identifier.of("tutorial", "netherite_banner_shield"),"main");
-    public static final EntityModelLayer netherite_banner_shield_model_layer = new EntityModelLayer(new Identifier("examplemod", "netherite_banner_shield"),"main");+
  
     @Override     @Override
Line 154: Line 182:
  
 <code java> <code java>
 +@Environment(EnvType.CLIENT)
 public class ExampleModClient implements ClientModInitializer { public class ExampleModClient implements ClientModInitializer {
  
-    public static final EntityModelLayer NETHERITE_SHIELD_MODEL_LAYER = new EntityModelLayer(new Identifier("examplemod", "netherite_shield"),"main");+    public static final EntityModelLayer NETHERITE_SHIELD_MODEL_LAYER = new EntityModelLayer(Identifier.of("tutorial", "netherite_shield"),"main");
  
     @Override     @Override
     public void onInitializeClient() {     public void onInitializeClient() {
- EntityModelLayerRegistry.registerModelLayer(netherite_banner_shield_model_layer, ShieldEntityModel::getTexturedModelData);+ EntityModelLayerRegistry.registerModelLayer(NETHERITE_BANNER_SHILED_MODEL_LAYER, ShieldEntityModel::getTexturedModelData);
     }     }
 } }
Line 168: Line 197:
  
 <code java> <code java>
 +@Environment(EnvType.CLIENT)
 public class ExampleModClient implements ClientModInitializer { public class ExampleModClient implements ClientModInitializer {
- +    public static final EntityModelLayer NETHERITE_SHIELD_MODEL_LAYER = new EntityModelLayer(Identifier.of("tutorial", "netherite_shield"), "main");
-    public static final EntityModelLayer NETHERITE_SHIELD_MODEL_LAYER = new EntityModelLayer(new Identifier("examplemod", "netherite_shield"),"main");+
          
     public static ShieldEntityModel modelNetheriteShield;     public static ShieldEntityModel modelNetheriteShield;
Line 184: Line 213:
  
 <code java> <code java>
 +@Environment(EnvType.CLIENT)
 public class ExampleModClient implements ClientModInitializer { public class ExampleModClient implements ClientModInitializer {
- +    public static final EntityModelLayer NETHERITE_SHIELD_MODEL_LAYER = new EntityModelLayer(Identifier.of("tutorial", "netherite_shield"),"main");
-    public static final EntityModelLayer NETHERITE_SHIELD_MODEL_LAYER = new EntityModelLayer(new Identifier("examplemod", "netherite_shield"),"main");+
          
     public static ShieldEntityModel modelNetheriteShield;     public static ShieldEntityModel modelNetheriteShield;
Line 204: Line 233:
 Next, we have to create our two ''SpriteIdentifiers'', Next, we have to create our two ''SpriteIdentifiers'',
 <code java> <code java>
 +@Environment(EnvType.CLIENT)
 public class ExampleModClient implements ClientModInitializer { public class ExampleModClient implements ClientModInitializer {
  
- public static final EntityModelLayer netherite_banner_shield_model_layer = new EntityModelLayer(new Identifier("examplemod", "netherite_banner_shield"),"main");+ public static final EntityModelLayer netherite_banner_shield_model_layer = new EntityModelLayer(Identifier.of("tutorial", "netherite_banner_shield"), "main");
  
  public static ShieldEntityModel modelNetheriteShield;  public static ShieldEntityModel modelNetheriteShield;
  
- public static final SpriteIdentifier NETHERITE_BANNER_SHIELD_BASE = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, new Identifier("examplemod", "entity/netherite_banner_shield_base")); + public static final SpriteIdentifier NETHERITE_BANNER_SHIELD_BASE = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, Identifier.of("tutorial", "entity/netherite_banner_shield_base")); 
- public static final SpriteIdentifier NETHERITE_BANNER_SHIELD_BASE_NO_PATTERN = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, new Identifier("examplemod", "entity/netherite_banner_shield_base_nopattern"));+ public static final SpriteIdentifier NETHERITE_BANNER_SHIELD_BASE_NO_PATTERN = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, Identifier.of("tutorial", "entity/netherite_banner_shield_base_nopattern"));
  
  @Override  @Override
Line 227: Line 257:
 Finally, we are going to register our shield with the ''BuiltinItemRendererRegistry'', Finally, we are going to register our shield with the ''BuiltinItemRendererRegistry'',
 <code java> <code java>
 +@Environment(EnvType.CLIENT)
 public class ExampleModClient implements ClientModInitializer { public class ExampleModClient implements ClientModInitializer {
- + public static final EntityModelLayer netherite_banner_shield_model_layer = new EntityModelLayer(Identifier.of("tutorial", "netherite_banner_shield"),"main");
- public static final EntityModelLayer netherite_banner_shield_model_layer = new EntityModelLayer(new Identifier("examplemod", "netherite_banner_shield"),"main");+
  
  public static ShieldEntityModel modelNetheriteShield;  public static ShieldEntityModel modelNetheriteShield;
  
- public static final SpriteIdentifier NETHERITE_BANNER_SHIELD_BASE = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, new Identifier("examplemod", "entity/netherite_banner_shield_base")); + public static final SpriteIdentifier NETHERITE_BANNER_SHIELD_BASE = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, Identifier.of("tutorial", "entity/netherite_banner_shield_base")); 
- public static final SpriteIdentifier NETHERITE_BANNER_SHIELD_BASE_NO_PATTERN = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, new Identifier("examplemod", "entity/netherite_banner_shield_base_nopattern"));+ public static final SpriteIdentifier NETHERITE_BANNER_SHIELD_BASE_NO_PATTERN = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, Identifier.of("tutorial", "entity/netherite_banner_shield_base_nopattern"));
  
  @Override  @Override
Line 251: Line 281:
  }  }
 } }
-</code>\\+</code>
  
-That is all of our code done, we only have a few .json files to make. \\+That is all of our code done, we only have a few json files to make.
  
-First, create a ''blocks.json'' file inside of ''resources/assets/minecraft/atlases/''. +First, create a ''blocks.json'' file inside of ''resources/assets/minecraft/atlases/''. Inside of it, you will have to list your ''SpriteIdentifiers'' from your client mod initializer like this: 
- +<code javascript resources/assets/minecraft/atlases/blocks.json>
-Inside of it, you will have to list your ''SpriteIdentifiers'' from your client mod initializer like this: +
-<code javascript>+
 { {
   "sources": [   "sources": [
     {     {
       "type": "single",       "type": "single",
-      "resource": "examplemod:entity/netherite_banner_shield_base"+      "resource": "tutorial:entity/netherite_banner_shield_base"
     },     },
     {     {
       "type": "single",       "type": "single",
-      "resource": "examplemod:entity/netherite_banner_shield_base_nopattern"+      "resource": "tutorial:entity/netherite_banner_shield_base_nopattern"
     }     }
   ]   ]
Line 273: Line 301:
 </code> </code>
  
-Next, inside ''resources/assets/examplemod/models/item/'', create a ''netherite_banner_shield.json'' file and put this inside it:\\  +Next, inside ''resources/assets/tutorial/models/item/'', create a ''netherite_banner_shield.json'' file and put this inside it: 
- +<code javascript resources/assets/tutorial/models/item/etherite_banner_shield.json>
-<code javascript>+
 { {
   "parent":"fabricshieldlib:item/fabric_banner_shield",   "parent":"fabricshieldlib:item/fabric_banner_shield",
Line 283: Line 310:
         "blocking": 1         "blocking": 1
       },       },
-      "model": "examplemod:item/netherite_banner_shield_blocking"+      "model": "tutorial:item/netherite_banner_shield_blocking"
     }     }
   ]   ]
 } }
-</code>\\ +</code>
  
 In the same folder, create another file, ''netherite_banner_shield_blocking.json'', and put his inside it:  In the same folder, create another file, ''netherite_banner_shield_blocking.json'', and put his inside it: 
-<code javascript>+<code javascript resources/assets/tutorial/models/item/etherite_banner_shield_blocking.json>
 { {
-  "parent":"fabricshieldlib:item/fabric_banner_shield_blocking"+  "parent":"fabricshieldlib:item/fabric_banner_shield_blocking"
 +  "textures":
 +    "shield":"tutorial:item/netherite_banner_shield" 
 +  }
 } }
-</code>\\ +</code>
  
-For this next step, you will add a ''netherite_shield_base_nopattern'' texture, which will be a standard shield texture. +For this next step, you will add a ''netherite_shield_base_nopattern'' texture, which will be a standard shield texture. Then, you will need to make a ''base'' version for your shield texture, so ''netherite_shield_base''. I recommend looking at the vanilla shield's ''base'' texture.
-Then, you will need to make a ''base'' version for your shield texture, so ''netherite_shield_base''. I recommend looking at the vanilla shield's ''base'' texture.+
  
 Then, you will move both of these textures into ''resources/assets/<modid>/textures/entity''. Then, you will move both of these textures into ''resources/assets/<modid>/textures/entity''.
  
-Lastly, create a ''shields.json'' file in ''resources/data/c/tags/items/shields.json'' and add your shield to it: +Next, create a ''shields.json'' file in ''resources/data/c/tags/items/shields.json'' and add your shield to it: 
-<code javascript>+<code javascript resources/data/c/tags/items/shields.json>
 { {
   "replace": false,   "replace": false,
   "values": [   "values": [
-    "examplemod:netherite_banner_shield"+    "tutorial:netherite_banner_shield"
   ]   ]
 } }
-</code>\\ +</code> 
 + 
 +Finally create a ''durability.json'' file in ''resources/data/minecraft/tags/item/enchantable/durability.json'' and add your shield to it: 
 +<code javascript resources/data/minecraft/tags/item/enchantable/durability.json> 
 +
 +  "replace": false, 
 +  "values":
 +    "tutorial:netherite_banner_shield" 
 +  ] 
 +
 +</code>
  
 Don't forget to add it to **en_us.json** in ''resources/assets/lang/en_us.json'' along with the color variants,\\  Don't forget to add it to **en_us.json** in ''resources/assets/lang/en_us.json'' along with the color variants,\\ 
 <code javascript> <code javascript>
 { {
-  "item.examplemod.netherite_banner_shield": "Netherite Banner Shield", +  "item.tutorial.netherite_banner_shield": "Netherite Banner Shield", 
-  "item.examplemod.netherite_banner_shield.red": "Red Netherite Shield", +  "item.tutorial.netherite_banner_shield.red": "Red Netherite Banner Shield", 
-  "item.examplemod.netherite_banner_shield.orange": "Orange Netherite Shield", +  "item.tutorial.netherite_banner_shield.orange": "Orange Netherite Banner Shield", 
-  "item.examplemod.netherite_banner_shield.yellow": "Yellow Netherite Shield", +  "item.tutorial.netherite_banner_shield.yellow": "Yellow Netherite Banner Shield", 
-  "item.examplemod.netherite_banner_shield.lime": "Lime Netherite Shield", +  "item.tutorial.netherite_banner_shield.lime": "Lime Netherite Banner Shield", 
-  "item.examplemod.netherite_banner_shield.green": "Green Netherite Shield", +  "item.tutorial.netherite_banner_shield.green": "Green Netherite Banner Shield", 
-  "item.examplemod.netherite_banner_shield.light_blue": "Light Blue Netherite Shield", +  "item.tutorial.netherite_banner_shield.light_blue": "Light Blue Banner Netherite Shield", 
-  "item.examplemod.netherite_banner_shield.cyan": "Cyan Netherite Shield", +  "item.tutorial.netherite_banner_shield.cyan": "Cyan Netherite Banner Shield", 
-  "item.examplemod.netherite_banner_shield.blue": "Blue Netherite Shield", +  "item.tutorial.netherite_banner_shield.blue": "Blue Netherite Banner Shield", 
-  "item.examplemod.netherite_banner_shield.purple": "Purple Netherite Shield", +  "item.tutorial.netherite_banner_shield.purple": "Purple Netherite Banner Shield", 
-  "item.examplemod.netherite_banner_shield.magenta": "Magenta Netherite Shield", +  "item.tutorial.netherite_banner_shield.magenta": "Magenta Netherite Banner Shield", 
-  "item.examplemod.netherite_banner_shield.pink": "Pink Netherite Shield", +  "item.tutorial.netherite_banner_shield.pink": "Pink Netherite Banner Shield", 
-  "item.examplemod.netherite_banner_shield.brown": "Brown Netherite Shield", +  "item.tutorial.netherite_banner_shield.brown": "Brown Netherite Banner Shield", 
-  "item.examplemod.netherite_banner_shield.white": "White Netherite Shield", +  "item.tutorial.netherite_banner_shield.white": "White Netherite Banner Shield", 
-  "item.examplemod.netherite_banner_shield.light_gray": "Light Gray Netherite Shield", +  "item.tutorial.netherite_banner_shield.light_gray": "Light Gray Netherite Banner Shield", 
-  "item.examplemod.netherite_banner_shield.gray": "Gray Netherite Shield", +  "item.tutorial.netherite_banner_shield.gray": "Gray Netherite Banner Shield", 
-  "item.examplemod.netherite_banner_shield.dark_gray": "Dark Gray Netherite Shield", +  "item.tutorial.netherite_banner_shield.dark_gray": "Dark Gray Netherite Banner Shield", 
-  "item.examplemod.netherite_banner_shield.black": "Black Netherite Shield"+  "item.tutorial.netherite_banner_shield.black": "Black Netherite Banner Shield"
 } }
 </code> </code>
 +
 +And now your shield is fully completed and supports banner decoration!
 +
 +===== Changes for 1.20.6 =====
 +If you are working in 1.20.6, first change the FabricShieldLib and FAPI versions accordingly and change your other dependencies to these versions:\\
 +
 +<file properties gradle.properties>
 +mod_menu_version=10.0.0-beta.1
 +midnightlib_version=1.5.5-fabric
 +</file>
 +
 +Next, change all instances of ''Identifier.of'' to ''new Identifier''; these are when you are registering your item, creating your ''EntityModelLayer'', and creating your ''SpriteIdentifiers''.
 +
 +Then, change your ''shield.json'' in ''resources/data/c/tags/item/tools/shield.json'' to ''shields.json'' file in ''resources/data/c/tags/items/shields.json'' 
 +
 +Finally, move your ''durability.json'' from ''resources/data/minecraft/tags/items/enchantable/durability.json'' to ''resources/data/minecraft/tags/item/enchantable/durability.json''
 +
 +===== Changes for 1.20.4 =====
 +If you are working in 1.20.4, **follow the changes for 1.20.6 first**, then change the FabricShieldLib and FAPI versions accordingly and change your other dependencies to these versions:\\
 +
 +**gradle.properties**
 +<file properties gradle.properties>
 +midnightlib_version=1.5.2-fabric
 +mod_menu_version=9.0.0-pre.1
 +</file>
 +
 +Additionally, **remove the** ''durability.json'' **file** completely.
 +
 +===== Changes for 1.19 =====
 +If you are working in 1.19, **follow the changes for 1.20.6 and 1.20.4 first**, then change the FabricShieldLib and FAPI versions accordingly and change your other dependencies to these versions:\\
 +
 +**gradle.properties**
 +<file properties gradle.properties>
 +midnightlib_version=1.0.0-fabric
 +mod_menu_version=4.2.0-beta.2
 +</file>
tutorial/shield.1703232428.txt.gz · Last modified: 2023/12/22 08:07 by cringestar_boi