I have searched the internet yet I can't find any information on this topic. I want to be able to reference item json files from another folder.
Right now they are referenced in the models/item folder, which is great and all, but it will get very crowded when I have to add in my 800+ things my mod adds. I was wondering if and/or how to set it to find them in a folder like this for example: models/item/food
If I can figure that out, I could make the item folder for json files much cleaner and easier to search for the correct file if I need to alter it later on.
I've not used JSON in 1.8 yet so I'm not sure, but can you somehow pass an instance of File to whatever needs to read the JSON?
If not, a trade-off could be to hierarchically name json files. For example, model.item.food.hotdog.json (if it crashes out from periods then you could use underscore).
Figured it out while messing around with adding items, if I add "food/beefSandwich" in the .getUnlocalizedName(), it finds it in the corresponding folder.
I only realized that a few days later. Major fail on my behalf. I tried added foods/ after the ":" but it didn't want to work for me, then I realized that the folder name didn't have an "s" after "food".
I have searched the internet yet I can't find any information on this topic. I want to be able to reference item json files from another folder.
Right now they are referenced in the models/item folder, which is great and all, but it will get very crowded when I have to add in my 800+ things my mod adds. I was wondering if and/or how to set it to find them in a folder like this for example: models/item/food
If I can figure that out, I could make the item folder for json files much cleaner and easier to search for the correct file if I need to alter it later on.
Owner and developer of the Mo' Shiz Mod
I've not used JSON in 1.8 yet so I'm not sure, but can you somehow pass an instance of File to whatever needs to read the JSON?
If not, a trade-off could be to hierarchically name json files. For example, model.item.food.hotdog.json (if it crashes out from periods then you could use underscore).
This is my food class as of now:
I tried changing things on the resource location thing, but I was unable to get it to work.
Owner and developer of the Mo' Shiz Mod
Figured it out while messing around with adding items, if I add "food/beefSandwich" in the .getUnlocalizedName(), it finds it in the corresponding folder.
Owner and developer of the Mo' Shiz Mod
If you have tons of .json files to create, there's a much easier way to use models. I suggest looking here as this explains it in greater detail.
Hello!
Yeah, this is just basic Java stuff - no offense. This part...
...is just building a string from a few variables, based on your MOD_ID + the unlocalized name of the item.
I only realized that a few days later. Major fail on my behalf. I tried added foods/ after the ":" but it didn't want to work for me, then I realized that the folder name didn't have an "s" after "food".
Owner and developer of the Mo' Shiz Mod