Hey, so I've created a custom item, ItemTrainingStaff. The name of its JSON file, and registry name, match that. Even though I'm 99% sure my folder structure is correct, the JSON file isn't being found. It continues to spit out the error: "Caused by: java.io.FileNotFoundException: test:models/item/ItemTrainingStaff.json". I'll provide the code I'm using to set the ModelResourceLocation and a picture of my folder structure. Any help is greatly appreciated!
@Mod.EventBusSubscriber
public class ModelRegistry {
@SubscribeEvent
public static void registerModels(ModelRegistryEvent event){
for(Item item: ItemHandler.INSTANCE.itemList){
ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(Test.MODID + ":" + item.getRegistryName().toString(), "inventory"));
}
}
}
But isn't that how I have it set up? It's just that IntelliJ will put packages "together" if there isn't a file in that particular package. So that structure really is assets/test/models/item/ItemTrainingStaff.json
But isn't that how I have it set up? It's just that IntelliJ will put packages "together" if there isn't a file in that particular package. So that structure really is assets/test/models/item/ItemTrainingStaff.json
You are right. I dunno. Wait for CoolAlias to show up XD.
Rollback Post to RevisionRollBack
Whomsoever takes up this mod shall wield power eternal.
Please show use your ItemTrainingStaff code where you put setRegistryName(). Make sure this is exactly the same as ItemTrainingStaff, and to be more safe try setting setUnlocalizedName() to ItemTrainingStaff too (if you haven''t already).
EDIT: I'm not sure but I think getRegistryName() might return the registry name plus "item." at the start. That's what setUnlocalizedName() does. If it does do this (use System.out.println() to test it), use getRegistryName().substring(5).
EDIT2: Wait has ehaugw already answered this? I thought that was just a misunderstanding. But anyway if he hasn't then I just saw someone using item.getRegistryName().getResourcePath(). Maybe try that too?
the difference between registry names and unlocalized names is that unlocalized names can be changed at any point, so you can't safely refer to them. registry names CAN'T change, so they always reference the correct item.
Btw if you read the previous posts you might have noticed that this has already been resolved...
Though it is a couple years later, I have the exact same issue and cannot work out what is meant by "assets.test.etc isn't the same as assets/test/etc".
Any explanation on what i must do to change from one to the other ?
I am just trying to find where to identify the textures for a simpple item I am making and I can't find resources/assets/mod/models/item anywhere I can find resources but nothing else
Hey, so I've created a custom item, ItemTrainingStaff. The name of its JSON file, and registry name, match that. Even though I'm 99% sure my folder structure is correct, the JSON file isn't being found. It continues to spit out the error: "Caused by: java.io.FileNotFoundException: test:models/item/ItemTrainingStaff.json". I'll provide the code I'm using to set the ModelResourceLocation and a picture of my folder structure. Any help is greatly appreciated!
Folder structure:
I have never done 1.10 mods before, but I think that if your MODID is test, the path should be:
resources/assets/test/models/item/ItemTrainingStaff.json.
I am also quite sure that this part is correct:
test:models/item/ItemTrainingStaff.json
But isn't that how I have it set up? It's just that IntelliJ will put packages "together" if there isn't a file in that particular package. So that structure really is assets/test/models/item/ItemTrainingStaff.json
You are right. I dunno. Wait for CoolAlias to show up XD.
* Twiddles thumbs patiently *
Turns out you were right. assets.test.etc isn't the same as assets/test/etc... With a bit of janky work I got IntelliJ to cooperate. Thanks!
If I actually said something useful, I would be proud if you could give me my first +1 from helping people
Gladly would, just don't know how to do it on these forums! xD
The green button on the lower left of his post. (with the up button) Click that to give him his upvote. :-)
the difference between registry names and unlocalized names is that unlocalized names can be changed at any point, so you can't safely refer to them. registry names CAN'T change, so they always reference the correct item.
Btw if you read the previous posts you might have noticed that this has already been resolved...
Though it is a couple years later, I have the exact same issue and cannot work out what is meant by "assets.test.etc isn't the same as assets/test/etc".
Any explanation on what i must do to change from one to the other ?
I am having the same problem, just with 1.12.2, any help would be appreciated
(I meant that as a :), I wasn't asking for help from notch xD)
I am just trying to find where to identify the textures for a simpple item I am making and I can't find resources/assets/mod/models/item anywhere I can find resources but nothing else