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 [2022/01/01 01:04] – added 1.14 section for banner support again cringestar_boitutorial:shield [2024/01/14 18:05] (current) – fixed model cringestar_boi
Line 1: Line 1:
-====== Making a Custom Shield in Minecraft [1.17] ======+====== Making a Custom Shield in Minecraft [1.19-1.20] ======
  
 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 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.\\ 
-Luckily, CrimsonDawn45 has already made a library to help with this! If he didn't, you probably would be sitting here for the next hour to follow this tutorial, so thanks CrimsonDawn45!+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!
  
-Library source is available at https://github.com/CrimsonDawn45/Fabric-Shield-Lib+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 13: Line 13:
 **gradle.properties**\\  **gradle.properties**\\ 
 <code java> <code java>
-fabric_shield_lib_version=1.4.5-1.18+fabric_shield_lib_version=1.7.2-1.20.4 
 +midnightlib_version=1.5.2-fabric 
 +mod_menu_version=9.0.0-pre.1 
 +fabricasm_version=2.3
 </code>\\  </code>\\ 
 **build.gradle** (under dependencies)\\  **build.gradle** (under dependencies)\\ 
 <code java> <code java>
-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 "maven.modrinth:midnightlib:${project.midnightlib_version}" 
 + 
 + modImplementation "com.github.Chocohead:Fabric-ASM:v${project.fabricasm_version}"
 </code>\\  </code>\\ 
-At the time of writing, latest project.fabric_shield_lib_version should be 1.4.5-1.18. This page will be updated whenever a new update comes out.\\ \\  + 
-**build.gradle** (under repositories)\\ +At the time of writing, the latest project.fabric_shield_lib_version should be 1.7.2, which supports versions: 
 +  * **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, the one above dependencies)\\ 
 <code java> <code java>
-allprojects { repositories { maven { url 'https://jitpack.io' } } }+ maven {url 'https://jitpack.io'} 
 + maven {url "https://maven.terraformersmc.com/releases/"} 
 + maven {url = "https://api.modrinth.com/maven"}
 </code>\\  </code>\\ 
 +
 +__//**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, there are extra steps that will be covered after the main creation.**\\+**If you want your shield to support banner decoration on your shieldplease skip to the next section**\\
 On to the non-boring steps! We will now make a custom shield!\\ \\  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 you have followed the above steps correctly and refreshed the project, then you will have the FabricShieldLib installed.\\ 
 If so, the first step to do is create a new instance of an Item like: If so, the first step to do is create a new instance of an Item like:
 <code java> <code java>
-public static final Item NETHERITE_SHIELD = new FabricShieldItem(new FabricItemSettings().maxDamage(2500).group(ItemGroup.COMBAT), 10, 13, Items.NETHERITE_INGOT); // FabricShieldItem(settings.maxDamage(durability), cooldownTicks, enchantability, repairItem)+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> </code>
  
Line 37: Line 57:
    
 <code java> <code java>
-Registry.register(Registry.ITEM, new Identifier("examplemod", "netherite_shield"), NETHERITE_SHIELD)+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: 
 +<code java> 
 +ItemGroupEvents.modifyEntriesEvent(ItemGroups.COMBAT).register(entries -> { 
 + entries.add(NETHERITE_SHIELD); 
 +});
 </code> </code>
  
-And our shield is done!\\ +And our shield is (code-wise) done!\\ 
 Now, we have to create the textures and models of the shield.\\  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 looking at mojang's shield image and changing it. Put it in resources/textures/item/<filename>.png\\ +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 models, we have to write a few .json files.\\  Now, for the models, we have to write a few .json files.\\ 
-For the model file without blockingwe use: \\ + 
 + 
 +Inside ''resources/assets/examplemod/models/item/''create a ''netherite_shield.json'' file and put this inside it:\\  
 <code javascript> <code javascript>
 { {
Line 61: Line 91:
 } }
 </code>\\  </code>\\ 
-Put it in resources/models/item/netherite_shield.json\\  + 
-For the blocking modeluse this\\ +In the same foldercreate another file, ''netherite_shield_blocking.json'', and put his inside it
 <code javascript> <code javascript>
 { {
-  "parent": "fabricshieldlib:item/fabric_shield_blocking"+  "parent": "fabricshieldlib:item/fabric_shield_blocking"
 +  "textures":
 +    "shield":"examplemod:item/netherite_shield" 
 +  }
 } }
 </code>\\  </code>\\ 
-Plop it in resources/models/item/netherite_shield_blocking.json\\ \\  + 
-Don't forget to add it to **en_us.json**\\ +Lastly, create a ''shields.json'' file in ''resources/data/c/tags/items/shields.json'' and add your shield to it: 
 +<code javascript> 
 +
 +  "replace": false, 
 +  "values":
 +    "examplemod:netherite_shield" 
 +  ] 
 +
 +</code>\\  
 + 
 +Don't forget to add it to **en_us.json** in ''resources/assets/lang/en_us.json''\\ 
 <code javascript> <code javascript>
 { {
Line 75: Line 118:
 } }
 </code>\\  </code>\\ 
-And with that, your shield is done!+And with that, your non-decorateable shield is done!
  
 +===== Adding a custom shield with banner support =====
 +The process is slightly different if you want to make your shield accept banners and decorateable like a vanilla shield.
  
-===== Adding banner support to your shield (1.17+) ===== +We still make the item in the same way, just make it a FabricBannerShieldItem:
- +
-If you are using 1.17 instead of 1.18, please change the fabric_shield_lib_version in **gradle.properties** to:+
 <code java> <code java>
-fabric_shield_lib_version=1.4.5-1.17+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)
 </code> </code>
  
-This is where mixins get involved. +Then, we have to register it: 
- + 
-First thing you will want to do is to change //FabricShieldItem// to //FabricBannerShieldItem// so that it will be able to be crafted with banners. +
 <code java> <code java>
-public static final Item NETHERITE_SHIELD = new FabricBannerShieldItem(new FabricItemSettings().maxDamage(2500).group(ItemGroup.COMBAT), 10, 13, Items.NETHERITE_INGOT); // FabricBannerShieldItem(settings.maxDamage(durability), cooldownTicks, enchantability, repairItem)+Registry.register(Registries.ITEM, new Identifier("examplemod", "netherite_banner_shield"), NETHERITE_BANNER_SHIELD);
 </code> </code>
  
-Now, we have to register few things in our ''ClientModInitalizer''+If you want to add your shield to a creative tabadd this into your ''onInitialize()'' method:
- +
-To create our ''ClientModInitalizer''we will make a new class called ''ExampleModClient'' and implement ''ClientModInitializer''. We will also implement and override the method ''onInitializeClient'' **(If you already have a client initializer, you can skip these next 2 steps.)** +
 <code java> <code java>
-public class ExampleModClient implements ClientModInitializer +ItemGroupEvents.modifyEntriesEvent(ItemGroups.COMBAT).register(entries -> 
-    @Override + entries.addAfter(Items.SHIELD,NETHERITE_BANNER_SHIELD); 
-    public void onInitializeClient() +});
-     +
-    } +
-}+
 </code> </code>
  
-Before we do any work in our client mod initializer, we need to register its entrypoint in ''fabric.mod.json''.+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.
  
-<code javascript> 
-{ 
-  [...] 
-  "entrypoints": { 
-    "main": [ 
-      "net.fabricmc.ExampleMod" 
-    ], 
-    "client": [ 
-      "net.fabricmc.ExampleModClient" 
-    ] 
-  } 
-  [...] 
-} 
-</code> 
- 
-Ok, so now that is done, we can work in our client initializer. 
  
 First, we will need to create an ''EntityModelLayer'' to use later. First, we will need to create an ''EntityModelLayer'' to use later.
Line 129: Line 148:
 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_banner_shield_model_layer = new EntityModelLayer(new Identifier("examplemod", "netherite_banner_shield"),"main");
  
     @Override     @Override
Line 147: Line 166:
     @Override     @Override
     public void onInitializeClient() {     public void onInitializeClient() {
-        EntityModelLayerRegistry.registerModelLayer(NETHERITE_SHIELD_MODEL_LAYER, ShieldEntityModel::getTexturedModelData);+ EntityModelLayerRegistry.registerModelLayer(netherite_banner_shield_model_layer, ShieldEntityModel::getTexturedModelData);
     }     }
 } }
 </code> </code>
  
-Then we will register our 2 ''SpriteIdentifier''s.+Then we will create our shield model,
  
 <code java> <code java>
Line 158: Line 177:
  
     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(new Identifier("examplemod", "netherite_shield"),"main");
 +    
 +    public static ShieldEntityModel modelNetheriteShield;
  
     @Override     @Override
     public void onInitializeClient() {     public void onInitializeClient() {
         EntityModelLayerRegistry.registerModelLayer(NETHERITE_SHIELD_MODEL_LAYER, ShieldEntityModel::getTexturedModelData);         EntityModelLayerRegistry.registerModelLayer(NETHERITE_SHIELD_MODEL_LAYER, ShieldEntityModel::getTexturedModelData);
-        ClientSpriteRegistryCallback.event(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE).register((atlasTexture, registry) -> { 
-            registry.register(new Identifier("examplemod", "entity/netherite_shield_base")); 
-            registry.register(new Identifier("examplemod", "entity/netherite_shield_base_nopattern")); 
-        }); 
     }     }
 } }
 </code> </code>
  
-And now we get to the mixin. Don't worryits an easy one.+And then register that shield model,
  
-If this is your first time, [[tutorial:mixin_registration|here's how to register mixins on your fabric.mod.json]] //__(Make sure to make a **client** mixin)__// 
- 
-We will make a class called ''RendererMixin'' and write: 
 <code java> <code java>
-@Mixin (BuiltinModelItemRenderer.class) +public class ExampleModClient implements ClientModInitializer {
-public class RendererMixin {+
  
-+    public static final EntityModelLayer NETHERITE_SHIELD_MODEL_LAYER = new EntityModelLayer(new Identifier("examplemod", "netherite_shield"),"main"); 
-</code> +
- +
-Then we will make the necessary ''Spriteidentifier''s and a ''ShieldEntityModel''. The ''Spriteidentifier''s will be the same as in your ''ClientModInitializer''+
-<code java> +
-@Mixin (BuiltinModelItemRenderer.class) +
-public class RendererMixin { +
-    private ShieldEntityModel modelNetheriteShield; +
-    private static final SpriteIdentifier NETHERITE_SHIELD_BASE = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, new Identifier("examplemod","entity/netherite_shield_base")); +
-    private static final SpriteIdentifier NETHERITE_SHIELD_BASE_NO_PATTERN = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, new Identifier("examplemod","entity/netherite_shield_base_nopattern")); +
-+
-</code> +
- +
-Next, we need to @Shadow the ''entityModelLoader'' so that we can use it to initialize our model. +
-<code java> +
-@Mixin (BuiltinModelItemRenderer.class) +
-public class RendererMixin { +
-    private ShieldEntityModel modelNetheriteShield; +
-    private static final SpriteIdentifier NETHERITE_SHIELD_BASE = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, new Identifier("examplemod","entity/netherite_shield_base")); +
-    private static final SpriteIdentifier NETHERITE_SHIELD_BASE_NO_PATTERN = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, new Identifier("examplemod","entity/netherite_shield_base_nopattern")); +
- +
-    @Final +
-    @Shadow +
-    private EntityModelLoader entityModelLoader; +
-}     +
-</code> +
- +
-Now we will inject into the ''reload'' method to initialize our model. +
-<code java> +
-@Mixin (BuiltinModelItemRenderer.class) +
-public class RendererMixin { +
-   private ShieldEntityModel modelNetheriteShield; +
-    private static final SpriteIdentifier NETHERITE_SHIELD_BASE = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, new Identifier("examplemod","entity/netherite_shield_base")); +
-    private static final SpriteIdentifier NETHERITE_SHIELD_BASE_NO_PATTERN = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, new Identifier("examplemod","entity/netherite_shield_base_nopattern")); +
- +
-    @Final +
-    @Shadow +
-    private EntityModelLoader entityModelLoader; +
- +
- +
-    @Inject(method = "reload", at = @At("HEAD")) +
-    private void setModelNetheriteShield(CallbackInfo ci){ +
-        modelNetheriteShield = new ShieldEntityModel(this.entityModelLoader.getModelPart(ExampleModClient.NETHERITE_SHIELD_MODEL_LAYER)); +
-    } +
-+
-</code>     +
-  +
-Now we get to the most important part of the mixin. We will inject a method to render a banner on our shield. +
-   +
-<code java> +
-@Mixin (BuiltinModelItemRenderer.class) +
-public class RendererMixin { +
-   private ShieldEntityModel modelNetheriteShield; +
-    private static final SpriteIdentifier NETHERITE_SHIELD_BASE = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, new Identifier("examplemod","entity/netherite_shield_base")); +
-    private static final SpriteIdentifier NETHERITE_SHIELD_BASE_NO_PATTERN = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTUREnew Identifier("examplemod","entity/netherite_shield_base_nopattern")); +
- +
-    @Final +
-    @Shadow +
-    private EntityModelLoader entityModelLoader; +
- +
- +
-    @Inject(method = "reload", at = @At("HEAD")) +
-    private void setModelNetheriteShield(CallbackInfo ci){ +
-        this.modelNetheriteShield = new ShieldEntityModel(this.entityModelLoader.getModelPart(ExampleModClient.NETHERITE_SHIELD_MODEL_LAYER)); +
-    }+
          
-    @Inject(method = "render", at = @At("HEAD")) +    public static ShieldEntityModel modelNetheriteShield;
-    private void mainRender(ItemStack stack, ModelTransformation.Mode mode, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay, CallbackInfo ci) { +
-        if (stack.isOf(ExampleMod.NETHERITE_SHIELD)) { +
-            FabricShieldLibClient.renderBanner(stack, matrices, vertexConsumers, light, overlay, modelNetheriteShield, NETHERITE_SHIELD_BASE, NETHERITE_SHIELD_BASE_NO_PATTERN) +
-            //The first five parameters are taken from the method, while the last 3 you provide yourself. You will provide the model, and then your 2 sprite identifiers in the order of ''//SHIELD_NAME//_BASE'' and then ''//SHIELD_NAME//_BASE_NOPATTERN. +
-'' +
-        } +
-    }+
  
-     
-} 
-</code>      
- 
-That is now all of the complicated things done! We now only need to change our existing model, add a ''nopattern'' texture, and move our textures to the locations we identified earlier. 
- 
-In your shield model, ''netherite_shield.json'' for us, we need to change the parent and remove the texture. 
-<code javascript> 
-{ 
-  "parent":"fabricshieldlib:item/fabric_banner_shield", 
-    "overrides": [ 
-        { 
-            "predicate": { 
-                "blocking": 1 
-            }, 
-            "model": "examplemod:item/netherite_shield_blocking" 
-        } 
-    ] 
-} 
-</code> 
- 
-You also have to change your blocking model for your shield, ''netherite_shield_blocking.json'' for us, to: 
- 
-<code javascript> 
-{ 
-  "parent":"fabricshieldlib:item/fabric_banner_shield_blocking" 
-} 
-</code> 
- 
-For this next step, you will add ''_base'' to your current shield texture, so ''netherite_shield'' to ''netherite_shield_base''. 
-Then, you will need to make a ''nopattern'' version for your shield texture, so ''netherite_shield_base_nopattern''. I recommend looking at the vanilla shield's ''nopattern'' texture. 
- 
-Then, you will move both of these textures into ''resources/assets/<modid>/textures/entity''. 
- 
-For one last thing, you will need to add names for each of your shield color variants in ''en_us.json''. 
-<code javascript> 
-{ 
-    "item.examplemod.netherite_shield": "Netherite Shield", 
-    "item.examplemod.netherite_shield.red": "Red Netherite Shield", 
-    "item.examplemod.netherite_shield.orange": "Orange Netherite Shield", 
-    "item.examplemod.netherite_shield.yellow": "Yellow Netherite Shield", 
-    "item.examplemod.netherite_shield.lime": "Lime Netherite Shield", 
-    "item.examplemod.netherite_shield.green": "Green Netherite Shield", 
-    "item.examplemod.netherite_shield.light_blue": "Light Blue Netherite Shield", 
-    "item.examplemod.netherite_shield.cyan": "Cyan Netherite Shield", 
-    "item.examplemod.netherite_shield.blue": "Blue Netherite Shield", 
-    "item.examplemod.netherite_shield.purple": "Purple Netherite Shield", 
-    "item.examplemod.netherite_shield.magenta": "Magenta Netherite Shield", 
-    "item.examplemod.netherite_shield.pink": "Pink Netherite Shield", 
-    "item.examplemod.netherite_shield.brown": "Brown Netherite Shield", 
-    "item.examplemod.netherite_shield.white": "White Netherite Shield", 
-    "item.examplemod.netherite_shield.light_gray": "Light Gray Netherite Shield", 
-    "item.examplemod.netherite_shield.gray": "Gray Netherite Shield", 
-    "item.examplemod.netherite_shield.dark_gray": "Dark Gray Netherite Shield", 
-    "item.examplemod.netherite_shield.black": "Black Netherite Shield" 
-} 
-</code>     
- 
-===== Adding banner support to your shield (1.16) ===== 
- 
-This is where mixins get involved. 
- 
-First, change the fabric_shield_lib in **gradle.properties** 
-\\  
-<code java> 
-fabric_shield_lib_version=1.4.5-1.16 
-</code> 
-\\  
- 
-Next thing you will want to do is to change //FabricShieldItem// to //FabricBannerShieldItem// so that it will be able to be crafted with banners. 
- 
-<code java> 
-public static final Item NETHERITE_SHIELD = new FabricBannerShieldItem(new FabricItemSettings().maxDamage(2500).group(ItemGroup.COMBAT), 10, 13, Items.NETHERITE_INGOT); // FabricBannerShieldItem(settings.maxDamage(durability), cooldownTicks, enchantability, repairItem) 
-</code> 
- 
-Now, we have to register a few things in our ''ClientModInitalizer''. 
- 
-To create our ''ClientModInitalizer'', we will make a new class called ''ExampleModClient'' and implement ''ClientModInitializer''. We will also implement and override the method ''onInitializeClient'' **(If you already have a client initializer, you can skip these next 2 steps.)** 
- 
-<code java> 
-public class ExampleModClient implements ClientModInitializer { 
     @Override     @Override
     public void onInitializeClient() {     public void onInitializeClient() {
-    +        EntityModelLayerRegistry.registerModelLayer(NETHERITE_SHIELD_MODEL_LAYER, ShieldEntityModel::getTexturedModelData); 
 +         
 +        ShieldSetModelCallback.EVENT.register((loader) -> { 
 +     modelNetheriteShield = new ShieldEntityModel(loader.getModelPart(netherite_banner_shield_model_layer)); 
 +     return ActionResult.PASS; 
 + });
     }     }
 } }
 </code> </code>
  
-Before we do any work in our client mod initializer, we need to register its entrypoint in ''fabric.mod.json''+Next, we have to create our two ''SpriteIdentifiers'',
- +
-<code javascript> +
-+
-  [...] +
-  "entrypoints":+
-    "main":+
-      "net.fabricmc.ExampleMod" +
-    ], +
-    "client":+
-      "net.fabricmc.ExampleModClient" +
-    ] +
-  } +
-  [...] +
-+
-</code> +
- +
-Ok, so now that is done, we can work in our client initializer. +
- +
-The only thing that we will need to do is register our 2 ''SpriteIdentifier''s. +
 <code java> <code java>
 public class ExampleModClient implements ClientModInitializer { public class ExampleModClient implements ClientModInitializer {
  
-    @Override + public static final EntityModelLayer netherite_banner_shield_model_layer = new EntityModelLayer(new Identifier("examplemod", "netherite_banner_shield"),"main");
-    public void onInitializeClient() { +
-        ClientSpriteRegistryCallback.event(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE).register((atlasTexture, registry) -> { +
-            registry.register(new Identifier("examplemod", "entity/netherite_shield_base")); +
-            registry.register(new Identifier("examplemod", "entity/netherite_shield_base_nopattern")); +
-        }); +
-    } +
-+
-</code>+
  
-And now we get to the mixin. Don't worry, its an easy one.+ public static ShieldEntityModel modelNetheriteShield;
  
-If this is your first time, [[tutorial:mixin_registration|here's how to register mixins on your fabric.mod.json]] //__(Make sure to make a **client** mixin)__/+ 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_NO_PATTERN = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, new Identifier("examplemod", "entity/netherite_banner_shield_base_nopattern"));
-We will make a class called ''RendererMixin'' and write: +
-<code java> +
-@Mixin (BuiltinModelItemRenderer.class) +
-public class RendererMixin {+
  
 + @Override
 + public void onInitializeClient() {
 +            EntityModelLayerRegistry.registerModelLayer(NETHERITE_SHIELD_MODEL_LAYER, ShieldEntityModel::getTexturedModelData);
 +        
 +            ShieldSetModelCallback.EVENT.register((loader) -> {
 +         modelNetheriteShield = new ShieldEntityModel(loader.getModelPart(netherite_banner_shield_model_layer));
 +         return ActionResult.PASS;
 +     });
 + }
 } }
 </code> </code>
  
-Then we will make the necessary ''Spriteidentifier''s and a ''ShieldEntityModel''. The ''Spriteidentifier''s will be the same as in your ''ClientModInitializer''.+Finally, we are going to register our shield with the ''BuiltinItemRendererRegistry'',
 <code java> <code java>
-@Mixin (BuiltinModelItemRenderer.class) +public class ExampleModClient implements ClientModInitializer {
-public class RendererMixin { +
-    private ShieldEntityModel modelNetheriteShield = new ShieldEntityModel; +
-    private static final SpriteIdentifier NETHERITE_SHIELD_BASE = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, new Identifier("examplemod","entity/netherite_shield_base")); +
-    private static final SpriteIdentifier NETHERITE_SHIELD_BASE_NO_PATTERN = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, new Identifier("examplemod","entity/netherite_shield_base_nopattern")); +
-+
-</code> +
-</code>  +
-  +
-Now we get to the most important part of the mixin. We will inject a method to render a banner on our shield. +
-   +
-<code java> +
-@Mixin (BuiltinModelItemRenderer.class) +
-public class RendererMixin { +
-    private ShieldEntityModel modelNetheriteShield = new ShieldEntityModel; +
-    private static final SpriteIdentifier NETHERITE_SHIELD_BASE = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, new Identifier("examplemod","entity/netherite_shield_base")); +
-    private static final SpriteIdentifier NETHERITE_SHIELD_BASE_NO_PATTERN = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, new Identifier("examplemod","entity/netherite_shield_base_nopattern")); +
-     +
-    @Inject(method = "render", at = @At("HEAD")) +
-    private void mainRender(ItemStack stack, MatrixStack matrix, VertexConsumerProvider vertexConsumerProvider, int light, int overlay, CallbackInfo ci) { +
-        if (stack.getItem() == ExampleMod.NETHERITE_SHIELD)) { +
-            FabricShieldLibClient.renderBanner(stack, matrix, vertexConsumerProvider, light, overlay, modelFabricShield, NETHERITE_SHIELD_BASE, NETHERITE_SHIELD_BASE_NO_PATTERN);  +
-            //The first five parameters are taken from the method, while the last 3 you provide yourself. You will provide the model, and then your 2 sprite identifiers in the order of ''//SHIELD_NAME//_BASE'' and then ''//SHIELD_NAME//_BASE_NOPATTERN. +
-'' +
-        } +
-    }+
  
-     + public static final EntityModelLayer netherite_banner_shield_model_layer = new EntityModelLayer(new Identifier("examplemod", "netherite_banner_shield"),"main");
-+
-</code>     +
  
-That is now all of the complicated things done! We now only need to change our existing model, add a ''nopattern'' texture, and move our textures to the locations we identified earlier.+ public static ShieldEntityModel modelNetheriteShield;
  
-In your shield model, ''netherite_shield.json'' for uswe need to change the parent and remove the texture. + public static final SpriteIdentifier NETHERITE_BANNER_SHIELD_BASE = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTUREnew Identifier("examplemod""entity/netherite_banner_shield_base")); 
-<code javascript> + public static final SpriteIdentifier NETHERITE_BANNER_SHIELD_BASE_NO_PATTERN = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTUREnew Identifier("examplemod", "entity/netherite_banner_shield_base_nopattern"));
-+
-  "parent":"fabricshieldlib:item/fabric_banner_shield", +
-    "overrides": [ +
-        { +
-            "predicate":+
-                "blocking":+
-            }, +
-            "model": "examplemod:item/netherite_shield_blocking" +
-        } +
-    ] +
-+
-</code>+
  
-You also have to change your blocking model for your shield, ''netherite_shield_blocking.json'' for usto+ @Override 
- + public void onInitializeClient() { 
-<code javascript+            EntityModelLayerRegistry.registerModelLayer(NETHERITE_SHIELD_MODEL_LAYERShieldEntityModel::getTexturedModelData); 
-+         
-  "parent":"fabricshieldlib:item/fabric_banner_shield_blocking"+            ShieldSetModelCallback.EVENT.register((loader) -{ 
 +         modelNetheriteShield = new ShieldEntityModel(loader.getModelPart(netherite_banner_shield_model_layer)); 
 +         return ActionResult.PASS; 
 +     }); 
 +  
 +            BuiltinItemRendererRegistry.INSTANCE.register(ExampleMod.NETHERITE_BANNER_SHIELD, (stack, mode, matrices, vertexConsumers, light, overlay) -> 
 + renderBanner(stack, matrices, vertexConsumers, light, overlay, modelNetheriteShield, NETHERITE_BANNER_SHIELD_BASE, NETHERITE_BANNER_SHIELD_BASE_NO_PATTERN); 
 +                //The first five parameters are taken from the method, while the last 3 you provide yourself. You will provide the model, and then your 2 sprite identifiers in the order of SHIELD_NAME_BASE and then SHIELD_NAME_BASE_NOPATTERN. 
 +     }); 
 + }
 } }
-</code>+</code>\\
  
-For this next stepyou will add ''_base'' to your current shield texture, so ''netherite_shield'' to ''netherite_shield_base''. +That is all of our code donewe only have a few .json files to make. \\
-Then, you will need to make a ''nopattern'' version for your shield texture, so ''netherite_shield_base_nopattern''. I recommend looking at the vanilla shield's ''nopattern'' texture.+
  
-Thenyou will move both of these textures into ''resources/assets/<modid>/textures/entity''.+Firstcreate a ''blocks.json'' file inside of ''resources/assets/minecraft/atlases/''.
  
-For one last thing, you will need to add names for each of your shield color variants in ''en_us.json''.+Inside of it, you will have to list your ''SpriteIdentifiers'' from your client mod initializer like this:
 <code javascript> <code javascript>
 { {
-    "item.examplemod.netherite_shield": "Netherite Shield", +  "sources": [ 
-    "item.examplemod.netherite_shield.red": "Red Netherite Shield", +    { 
-    "item.examplemod.netherite_shield.orange": "Orange Netherite Shield", +      "type": "single", 
-    "item.examplemod.netherite_shield.yellow": "Yellow Netherite Shield", +      "resource": "examplemod:entity/netherite_banner_shield_base
-    "item.examplemod.netherite_shield.lime": "Lime Netherite Shield", +    }
-    "item.examplemod.netherite_shield.green": "Green Netherite Shield"+    { 
-    "item.examplemod.netherite_shield.light_blue": "Light Blue Netherite Shield", +      "type": "single", 
-    "item.examplemod.netherite_shield.cyan": "Cyan Netherite Shield", +      "resource": "examplemod:entity/netherite_banner_shield_base_nopattern"
-    "item.examplemod.netherite_shield.blue": "Blue Netherite Shield", +
-    "item.examplemod.netherite_shield.purple": "Purple Netherite Shield", +
-    "item.examplemod.netherite_shield.magenta": "Magenta Netherite Shield", +
-    "item.examplemod.netherite_shield.pink": "Pink Netherite Shield", +
-    "item.examplemod.netherite_shield.brown": "Brown Netherite Shield", +
-    "item.examplemod.netherite_shield.white": "White Netherite Shield", +
-    "item.examplemod.netherite_shield.light_gray": "Light Gray Netherite Shield", +
-    "item.examplemod.netherite_shield.gray": "Gray Netherite Shield", +
-    "item.examplemod.netherite_shield.dark_gray": "Dark Gray Netherite Shield", +
-    "item.examplemod.netherite_shield.black": "Black Netherite Shield" +
-+
-</code>     +
- +
-===== Adding banner support to your shield (1.15) ===== +
- +
-This is where mixins get involved. +
- +
-First, change the fabric_shield_lib in **gradle.properties** +
-\\  +
-<code java> +
-fabric_shield_lib_version=1.4.5-1.15 +
-</code> +
-\\  +
- +
-Next thing you will want to do is to change //FabricShieldItem// to //FabricBannerShieldItem// so that it will be able to be crafted with banners. +
- +
-<code java> +
-public static final Item NETHERITE_SHIELD = new FabricBannerShieldItem(new FabricItemSettings().maxDamage(2500).group(ItemGroup.COMBAT), 10, 13, Items.NETHERITE_INGOT); // FabricBannerShieldItem(settings.maxDamage(durability), cooldownTicks, enchantability, repairItem) +
-</code> +
- +
-Now, we have to register a few things in our ''ClientModInitalizer''+
- +
-To create our ''ClientModInitalizer'', we will make a new class called ''ExampleModClient'' and implement ''ClientModInitializer''. We will also implement and override the method ''onInitializeClient'' **(If you already have a client initializer, you can skip these next 2 steps.)** +
- +
-<code java> +
-public class ExampleModClient implements ClientModInitializer { +
-    @Override +
-    public void onInitializeClient() { +
-    +
     }     }
 +  ]
 } }
 </code> </code>
  
-Before we do any work in our client mod initializerwe need to register its entrypoint in ''fabric.mod.json''.+Nextinside ''resources/assets/examplemod/models/item/'', create a ''netherite_banner_shield.json'' file and put this inside it:\\ 
  
 <code javascript> <code javascript>
 { {
-  [...] +  "parent":"fabricshieldlib:item/fabric_banner_shield", 
-  "entrypoints": +  "overrides": [ 
-    "main": +    { 
-      "net.fabricmc.ExampleMod" +      "predicate"
-    ]+        "blocking": 1 
-    "client": [ +      }, 
-      "net.fabricmc.ExampleModClient" +      "model""examplemod:item/netherite_banner_shield_blocking"
-    ] +
-  } +
-  [...] +
-+
-</code> +
- +
-Ok, so now that is done, we can work in our client initializer. +
- +
-The only thing that we will need to do is register our 2 ''SpriteIdentifier''s. +
- +
-<code java> +
-public class ExampleModClient implements ClientModInitializer { +
- +
-    @Override +
-    public void onInitializeClient() +
-        ClientSpriteRegistryCallback.event(SpriteAtlasTexture.BLOCK_ATLAS_TEX).register((atlasTexture, registry) -> { +
-            registry.register(new Identifier("examplemod", "entity/netherite_shield_base")); +
-            registry.register(new Identifier("examplemod", "entity/netherite_shield_base_nopattern")); +
-        });+
     }     }
 +  ]
 } }
-</code> +</code>\\ 
- +
-And now we get to the mixin. Don't worry, its an easy one. +
- +
-If this is your first time, [[tutorial:mixin_registration|here's how to register mixins on your fabric.mod.json]] //__(Make sure to make a **client** mixin)__// +
- +
-We will make a class called ''RendererMixin'' and write: +
-<code java> +
-@Mixin (BuiltinModelItemRenderer.class) +
-public class RendererMixin { +
- +
-+
-</code> +
- +
-Then we will make the necessary ''Spriteidentifier''s and a ''ShieldEntityModel''. The ''Spriteidentifier''s will be the same as in your ''ClientModInitializer''+
-<code java> +
-@Mixin (BuiltinModelItemRenderer.class) +
-public class RendererMixin { +
-    private ShieldEntityModel modelNetheriteShield = new ShieldEntityModel; +
-    private static final SpriteIdentifier NETHERITE_SHIELD_BASE = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEX, new Identifier("examplemod","entity/netherite_shield_base")); +
-    private static final SpriteIdentifier NETHERITE_SHIELD_BASE_NO_PATTERN = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEX, new Identifier("examplemod","entity/netherite_shield_base_nopattern")); +
-+
-</code> +
-</code>  +
-  +
-Now we get to the most important part of the mixin. We will inject a method to render a banner on our shield. +
-   +
-<code java> +
-@Mixin (BuiltinModelItemRenderer.class) +
-public class RendererMixin { +
-    private ShieldEntityModel modelNetheriteShield = new ShieldEntityModel; +
-    private static final SpriteIdentifier NETHERITE_SHIELD_BASE = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEX, new Identifier("examplemod","entity/netherite_shield_base")); +
-    private static final SpriteIdentifier NETHERITE_SHIELD_BASE_NO_PATTERN = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEX, new Identifier("examplemod","entity/netherite_shield_base_nopattern")); +
-     +
-    @Inject(method = "render", at = @At("HEAD")) +
-    private void mainRender(ItemStack stack, ModelTransformation.Mode mode, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay, CallbackInfo ci) { +
-        if (stack.getItem() == ExampleMod.NETHERITE_SHIELD)) { +
-            FabricShieldLibClient.renderBanner(stack, matrices, vertexConsumers, light, overlay, modelNetheriteShield, NETHERITE_SHIELD_BASE, NETHERITE_SHIELD_BASE_NO_PATTERN);  +
-            //The first five parameters are taken from the method, while the last 3 you provide yourself. You will provide the model, and then your 2 sprite identifiers in the order of ''//SHIELD_NAME//_BASE'' and then ''//SHIELD_NAME//_BASE_NOPATTERN. +
-'' +
-        } +
-    } +
- +
-     +
-+
-</code>      +
- +
-That is now all of the complicated things done! We now only need to change our existing model, add a ''nopattern'' texture, and move our textures to the locations we identified earlier.+
  
-In your shield model, ''netherite_shield.json'' for uswe need to change the parent and remove the texture.+In the same folder, create another file, ''netherite_banner_shield_blocking.json'', and put his inside it: 
 <code javascript> <code javascript>
 { {
-  "parent":"fabricshieldlib:item/fabric_banner_shield", +  "parent":"fabricshieldlib:item/fabric_banner_shield_blocking", 
-    "overrides": +  "textures":{ 
-        +    "shield":"examplemod:item/netherite_shield
-            "predicate":+  }
-                "blocking":+
-            }, +
-            "model": "examplemod:item/netherite_shield_blocking+
-        } +
-    ]+
 } }
-</code> +</code>\\ 
- +
-You also have to change your blocking model for your shield, ''netherite_shield_blocking.json'' for us, to: +
- +
-<code javascript> +
-+
-  "parent":"fabricshieldlib:item/fabric_banner_shield_blocking" +
-+
-</code>+
  
-For this next step, you will add ''_base'' to your current shield texture, so ''netherite_shield'' to ''netherite_shield_base''+For this next step, you will add ''netherite_shield_base_nopattern'' texture, which will be a standard shield texture. 
-Then, you will need to make a ''nopattern'' version for your shield texture, so ''netherite_shield_base_nopattern''. I recommend looking at the vanilla shield's ''nopattern'' 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''.
  
-For one last thingyou will need to add names for each of your shield color variants in ''en_us.json''.+Lastlycreate a ''shields.json'' file in ''resources/data/c/tags/items/shields.json'' and add your shield to it:
 <code javascript> <code javascript>
 { {
-    "item.examplemod.netherite_shield": "Netherite Shield"+  "replace": false
-    "item.examplemod.netherite_shield.red": "Red Netherite Shield", +  "values": [ 
-    "item.examplemod.netherite_shield.orange": "Orange Netherite Shield", +    "examplemod:netherite_banner_shield
-    "item.examplemod.netherite_shield.yellow": "Yellow Netherite Shield", +  ]
-    "item.examplemod.netherite_shield.lime": "Lime Netherite Shield", +
-    "item.examplemod.netherite_shield.green": "Green Netherite Shield", +
-    "item.examplemod.netherite_shield.light_blue": "Light Blue Netherite Shield", +
-    "item.examplemod.netherite_shield.cyan": "Cyan Netherite Shield", +
-    "item.examplemod.netherite_shield.blue": "Blue Netherite Shield", +
-    "item.examplemod.netherite_shield.purple": "Purple Netherite Shield", +
-    "item.examplemod.netherite_shield.magenta": "Magenta Netherite Shield", +
-    "item.examplemod.netherite_shield.pink": "Pink Netherite Shield", +
-    "item.examplemod.netherite_shield.brown": "Brown Netherite Shield", +
-    "item.examplemod.netherite_shield.white": "White Netherite Shield", +
-    "item.examplemod.netherite_shield.light_gray": "Light Gray Netherite Shield", +
-    "item.examplemod.netherite_shield.gray": "Gray Netherite Shield", +
-    "item.examplemod.netherite_shield.dark_gray": "Dark Gray Netherite Shield", +
-    "item.examplemod.netherite_shield.black": "Black Netherite Shield"+
 } }
-</code>     +</code>\\ 
-===== Adding banner support to your shield (1.14) =====+
  
-This is where mixins get involved. +Don't forget to add it to **en_us.json** in ''resources/assets/lang/en_us.json'' along with the color variants,\\ 
- +
-First, change the fabric_shield_lib in **gradle.properties** +
-\\  +
-<code java> +
-fabric_shield_lib_version=1.4.5-1.14 +
-</code> +
-\\  +
- +
-Next thing you will want to do is to change //FabricShieldItem// to //FabricBannerShieldItem// so that it will be able to be crafted with banners. +
- +
-<code java> +
-public static final Item NETHERITE_SHIELD = new FabricBannerShieldItem(new FabricItemSettings().maxDamage(2500).group(ItemGroup.COMBAT), 10, 13, Items.NETHERITE_INGOT); // FabricBannerShieldItem(settings.maxDamage(durability), cooldownTicks, enchantability, repairItem) +
-</code> +
- +
-The only thing we will need to do now is to add a simple mixin. +
- +
-If this is your first time, [[tutorial:mixin_registration|here's how to register mixins on your fabric.mod.json]] //__(Make sure to make a **client** mixin)__// +
- +
-We will make a class called ''RendererMixin'' and write: +
-<code java> +
-@Mixin (BuiltinModelItemRenderer.class) +
-public class RendererMixin { +
- +
-+
-</code> +
- +
-Then we will make the necessary ''Identifier''s. They will be the path to your textures and the second one will have an additional **_nopattern** added to the file name. +
-<code java> +
-@Mixin (BuiltinModelItemRenderer.class) +
-public class RendererMixin { +
-    private static final Identifier NETHERITE_SHIELD_BASE = new Identifier("examplemod","entity/netherite_shield_base"); +
-    private static final Identifier NETHERITE_SHIELD_BASE_NO_PATTERN = new Identifier("examplemod","entity/netherite_shield_base_nopattern"); +
-+
-</code>  +
-  +
-Now we get to the most important part of the mixin. We will inject a method to render a banner on our shield. **Do not forget to mark the inject with //cancellable = true//** +
-   +
-<code java> +
-@Mixin (BuiltinModelItemRenderer.class) +
-public class RendererMixin { +
-    private static final Identifier NETHERITE_SHIELD_BASE = new Identifier("examplemod","entity/netherite_shield_base"); +
-    private static final Identifier NETHERITE_SHIELD_BASE_NO_PATTERN = new Identifier("examplemod","entity/netherite_shield_base_nopattern"); +
-     +
-    @Inject(method = "render", at = @At("HEAD"), cancellable = true) +
-    private void mainRender(ItemStack stack, CallbackInfo callbackInfo) { +
-        if (stack.getItem() == ExampleMod.NETHERITE_SHIELD)) { +
-            //The first parameter is taken from the method, while you will provide your 2 identifiers in the order of ''//SHIELD_NAME//_BASE_NOPATTERN'' and then ''//SHIELD_NAME//_BASE''. +
-            FabricShieldBannerRendering.render(stack, NETHERITE_SHIELD_BASE_NO_PATTERN, NETHERITE_SHIELD_BASE); +
-            callbackInfo.cancel(); +
-        } +
-    } +
- +
-     +
-+
-</code>      +
- +
-That is now all of the complicated things done! We now only need to change our existing model, add a ''nopattern'' texture, and move our textures to the locations we identified earlier. +
- +
-In your shield model''netherite_shield.json'' for us, we need to change the parent and remove the texture.+
 <code javascript> <code javascript>
 { {
-  "parent":"fabricshieldlib:item/fabric_banner_shield", +  "item.examplemod.netherite_banner_shield": "Netherite Banner Shield", 
-    "overrides": [ +  "item.examplemod.netherite_banner_shield.red""Red Netherite Banner Shield", 
-        { +  "item.examplemod.netherite_banner_shield.orange": "Orange Netherite Banner Shield", 
-            "predicate": { +  "item.examplemod.netherite_banner_shield.yellow": "Yellow Netherite Banner Shield", 
-                "blocking": 1 +  "item.examplemod.netherite_banner_shield.lime": "Lime Netherite Banner Shield", 
-            }+  "item.examplemod.netherite_banner_shield.green": "Green Netherite Banner Shield", 
-            "model": "examplemod:item/netherite_shield_blocking+  "item.examplemod.netherite_banner_shield.light_blue": "Light Blue Banner Netherite Shield", 
-        } +  "item.examplemod.netherite_banner_shield.cyan": "Cyan Netherite Banner Shield"
-    ]+  "item.examplemod.netherite_banner_shield.blue": "Blue Netherite Banner Shield", 
 +  "item.examplemod.netherite_banner_shield.purple""Purple Netherite Banner Shield", 
 +  "item.examplemod.netherite_banner_shield.magenta": "Magenta Netherite Banner Shield", 
 +  "item.examplemod.netherite_banner_shield.pink": "Pink Netherite Banner Shield", 
 +  "item.examplemod.netherite_banner_shield.brown": "Brown Netherite Banner Shield", 
 +  "item.examplemod.netherite_banner_shield.white": "White Netherite Banner Shield", 
 +  "item.examplemod.netherite_banner_shield.light_gray": "Light Gray Netherite Banner Shield", 
 +  "item.examplemod.netherite_banner_shield.gray": "Gray Netherite Banner Shield", 
 +  "item.examplemod.netherite_banner_shield.dark_gray": "Dark Gray Netherite Banner Shield", 
 +  "item.examplemod.netherite_banner_shield.black": "Black Netherite Banner Shield"
 } }
 </code> </code>
  
-You also have to change your blocking model for your shield, ''netherite_shield_blocking.json'' for us, to:+And now your shield is fully completed and supports banner decoration!
  
-<code javascript+===== Changes for 1.19 ===== 
-+If you are working in 1.19, make sure to change the FabricShieldLib and FAPI versions accordingly as well as changing your Midnight Lib and Mod Menu dependencies to these versions:\\ 
-  "parent":"fabricshieldlib:item/fabric_banner_shield_blocking" +**gradle.properties** 
-}+<code java
 +midnightlib_version=1.0.0-fabric 
 +mod_menu_version=4.2.0-beta.2
 </code> </code>
- 
-For this next step, you will add ''_base'' to your current shield texture, so ''netherite_shield'' to ''netherite_shield_base''. 
-Then, you will need to make a ''nopattern'' version for your shield texture, so ''netherite_shield_base_nopattern''. I recommend looking at the vanilla shield's ''nopattern'' texture. 
- 
-Then, you will move both of these textures into ''resources/assets/<modid>/textures/entity''. 
- 
-For one last thing, you will need to add names for each of your shield color variants in ''en_us.json''. 
-<code javascript> 
-{ 
-    "item.examplemod.netherite_shield": "Netherite Shield", 
-    "item.examplemod.netherite_shield.red": "Red Netherite Shield", 
-    "item.examplemod.netherite_shield.orange": "Orange Netherite Shield", 
-    "item.examplemod.netherite_shield.yellow": "Yellow Netherite Shield", 
-    "item.examplemod.netherite_shield.lime": "Lime Netherite Shield", 
-    "item.examplemod.netherite_shield.green": "Green Netherite Shield", 
-    "item.examplemod.netherite_shield.light_blue": "Light Blue Netherite Shield", 
-    "item.examplemod.netherite_shield.cyan": "Cyan Netherite Shield", 
-    "item.examplemod.netherite_shield.blue": "Blue Netherite Shield", 
-    "item.examplemod.netherite_shield.purple": "Purple Netherite Shield", 
-    "item.examplemod.netherite_shield.magenta": "Magenta Netherite Shield", 
-    "item.examplemod.netherite_shield.pink": "Pink Netherite Shield", 
-    "item.examplemod.netherite_shield.brown": "Brown Netherite Shield", 
-    "item.examplemod.netherite_shield.white": "White Netherite Shield", 
-    "item.examplemod.netherite_shield.light_gray": "Light Gray Netherite Shield", 
-    "item.examplemod.netherite_shield.gray": "Gray Netherite Shield", 
-    "item.examplemod.netherite_shield.dark_gray": "Dark Gray Netherite Shield", 
-    "item.examplemod.netherite_shield.black": "Black Netherite Shield" 
-} 
-</code>     
- 
-Now your shield is done and has banner support! 
tutorial/shield.1640999048.txt.gz · Last modified: 2022/01/01 01:04 by cringestar_boi