How to add swords to a Resource Pack using CustomModelData

No matter what type of sword you wish to add to a Resource Pack this tutorial will help you!

If you don’t know what CustomModeldata is and how the basics work, see our guide What is CustomModeldata?

First of all we need to add the sword JSON, if we don’t have it we can grab it from the Minecraft version jar.

Minecraft jar – Windows

  1. Open File Explorer
  2. type in %appdata%/.minecraft/versions
  3. Hit enter
  4. Open the folder of the game version you wish to use, for this example I use 1.16.5
  5. Right click the jar file and open with winrar or similar software (you can download winrar here).
  6. In the jar, navigate to the sword file you wish to use, I will use Diamond Sword.
    1. assets\minecraft\models\items\diamond_sword.json
  7. Drag this JSON file out and lets add it to our own resource pack.

Minecraft jar – Mac OS

  1. Open Finder
  2. In menu bar, go to “Go” then click “Go to Folder”
  3. type in ~/Library/Application Support/minecraft
  4. Hit enter
  5. Open the folder of the game version you wish to use, for this example I use 1.16.5
  6. Right click the jar file and click open with Archive Utility
  7. In the jar, navigate to the sword file you wish to use, I will use Diamond Sword.
    1. assets\minecraft\models\items\diamond_sword.json
  8. Drag this JSON file out and lets add it to our own resource pack.

Diamond_sword.json

All we can see in our new JSON is this:

{
  "parent": "minecraft:item/handheld",
  "textures": {
    "layer0": "minecraft:item/diamond_sword"
  }
}

To add 2 new sword models update the file to this:

{
	"parent": "item/handheld",
	"textures": {
		"layer0": "item/diamond_sword"
	},
	
	"overrides": [
        {"predicate": {"custom_model_data":1}, "model": "item/file/path/of/your/choice/modelname.json"},
        {"predicate": {"custom_model_data":2}, "model": "item/custom/swords/coolsword2.json"}
	]
}

As you can see, you can sort and make the folders for you model json files how ever you want.

The rest should be very easy for you if you’ve read our basics CustomModelData tutorial. Simply make sure the model json link to the correct texture and you are golden.