Note: This guide was made for 1.8. In 1.12 replace any camel case with snake case. EX: "myAxe" is now "my_axe".
Before making the JSON file double check the Game Registry line. Mine looks like this:
GameRegistry.registerItem(myAxe, "myAxe");
To start open up the folder "assets.foundations.models.item" in the package explorer:
Right click on an existing JSON file such as "mySword.json", this will bring up a menu.
In the menu find a click on "Copy", this will close the menu.
After you copy, right click "mySword.json" again and this time click "Paste."
After you press paste you will be asked a new name for your file.
For my item, my file needs to be named "myAxe.json". The part before ".json" is the same as what is written between the quotes ("") in the GameRegistry.registerItem line for our item. The CAPITAL and lower case letters need to match exactly.
Your new json is now created and now we need to change it to include the texture for our new item.
Lets double check that we have a texture for our new item in "assets.foundations.textures.item"
If you are missing a texture for your item, you can copy and paste an existing one as we did for the JSON. Then, give it an appropriate name and edit it like any other texture.
Now go back and locate your new JSON file and right click it to bring up that menu again.
This time find "Open With" the click on "Text Editor" to open up the JSON file.
When you have opened your JSON file it will look like this:
How to change your .JSON to include the correct texture is shown for our new item below.
Go to line 4 and change it from:
"layer0": "foundations:items/mySword"
to
"layer0": "foundations:items/myAxe"
so it matches the first part of our .PNG file
Now let's just make sure all the file names and lines of code match:
If both those pairs match go ahead and save all your files:
Now you can test out your new item!
Comments
0 comments
Please sign in to leave a comment.