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
Next revisionBoth sides next revision
tutorial:shield [2023/12/21 21:42] – added banner section, still incomplete though cringestar_boitutorial:shield [2023/12/22 18:59] – just addded supported version cringestar_boi
Line 1: Line 1:
-====== Making a Custom Shield in Minecraft [1.20] ======+====== 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 to follow this tutorial, so thanks StellarWind22!
  
 Library source is available at https://github.com/CrimsonDawn45/Fabric-Shield-Lib Library source is available at https://github.com/CrimsonDawn45/Fabric-Shield-Lib
Line 29: Line 29:
 </code>\\  </code>\\ 
  
-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, latest project.fabric_shield_lib_version should be 1.7.2, which supports versions 1.20.2-1.20.4, 1.20-1.20.1. 1.19.3-1.19.4, 1.19-1.19.2, 1.18.2, and 1.17.1 . This page will be updated whenever a new update comes out.\\ \\ 
 **build.gradle** (inside repositories, the one above dependencies)\\  **build.gradle** (inside repositories, the one above dependencies)\\ 
 <code java> <code java>
Line 250: Line 250:
      });      });
  }  }
 +}
 +</code>\\
 +
 +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/''.
 +
 +Inside of it, you will have to list your ''SpriteIdentifiers'' from your client mod initializer like this:
 +<code javascript>
 +{
 +  "sources": [
 +    {
 +      "type": "single",
 +      "resource": "examplemod:entity/netherite_banner_shield_base"
 +    },
 +    {
 +      "type": "single",
 +      "resource": "examplemod:entity/netherite_banner_shield_base_nopattern"
 +    }
 +  ]
 } }
 </code> </code>
  
-That is all of our code donewe only have few .json files to make. **WILL FINISH THIS SECTION SOON**+Nextinside ''resources/assets/examplemod/models/item/'', create ''netherite_banner_shield.json'' file and put this inside it:\\  
 + 
 +<code javascript> 
 +
 +  "parent":"fabricshieldlib:item/fabric_banner_shield", 
 +  "overrides":
 +    { 
 +      "predicate":
 +        "blocking":
 +      }, 
 +      "model": "examplemod:item/netherite_banner_shield_blocking" 
 +    } 
 +  ] 
 +
 +</code>\\  
 + 
 +In the same folder, create another file, ''netherite_banner_shield_blocking.json'', and put his inside it:  
 +<code javascript> 
 +
 +  "parent":"fabricshieldlib:item/fabric_banner_shield_blocking" 
 +
 +</code>\\  
 + 
 +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 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: 
 +<code javascript> 
 +
 +  "replace": false, 
 +  "values":
 +    "examplemod: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,\\  
 +<code javascript> 
 +
 +  "item.examplemod.netherite_banner_shield": "Netherite Banner Shield", 
 +  "item.examplemod.netherite_banner_shield.red": "Red Netherite Banner Shield", 
 +  "item.examplemod.netherite_banner_shield.orange": "Orange Netherite Banner Shield", 
 +  "item.examplemod.netherite_banner_shield.yellow": "Yellow Netherite Banner Shield", 
 +  "item.examplemod.netherite_banner_shield.lime": "Lime Netherite Banner Shield", 
 +  "item.examplemod.netherite_banner_shield.green": "Green Netherite Banner Shield", 
 +  "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>
tutorial/shield.txt · Last modified: 2024/01/14 18:05 by cringestar_boi