SciHi Posted April 4, 2018 Posted April 4, 2018 I have been working at this for hours now; following countless different tutorials but to no avail. I am creating a new item like so: public class Item_NewIngot extends Item { public Item_NewIngot() { setUnlocalizedName("newingot"); setRegistryName("newingot"); setCreativeTab(Wire.tab); } public void registerModel() { ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation("wire:newingot", "inventory")); } } I register it in public static void registerItems(RegistryEvent.Register<Item> event) I call registerModel in public static void registerItems(ModelRegistryEvent event) But this never actually works, I get an output like this when forge loads: Quote Caused by: java.io.FileNotFoundException: wire:models/item/newingot.json So for some reason it doesn't find the json file. I know it exists and I have it under that directory - attached an image Here is the contents of that file: { "parent": "item/generated", "textures": { "layer0": "wire:items/newingot" } } And I also have the icon here - attached another image Why isn't this working? Quote
jabelar Posted April 4, 2018 Posted April 4, 2018 Your modding workspace is set up in your roaming AppData folder? So that's where your project file is? It seems like you're putting your JSON in your regular minecraft location not your project asset location... Can you show screenshot of Eclipse's package explorer tree showing the resource package location? Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/
SciHi Posted April 4, 2018 Author Posted April 4, 2018 Just now, jabelar said: Your modding workspace is set up in your roaming AppData folder? So that's where your project file is? It seems like you're putting your JSON in your regular minecraft location not your project asset location... Can you show screenshot of Eclipse's package explorer tree showing the resource package location? Oh I know how weird it looks, I created a modding folder in the .minecraft folder just so I didn't have to have everything dumped on the desktop. Here is a screenshot of all the directories and stuff Quote
SciHi Posted April 4, 2018 Author Posted April 4, 2018 Thought I'd add another quick edit. It even builds to (what I think) is the right places. Opening the JAR file in 7z Quote
hiotewdew Posted April 4, 2018 Posted April 4, 2018 Quote from StackOverflow. " There are three cases where a FileNotFoundException may be thrown. The named file does not exist. The named file is actually a directory. The named file cannot be opened for reading for some reason. The first two cases are unlikely based on your description. I would test against the third case using file.canRead() . " Quote All Projects found here: Website Main Programmer for: Better Animals Plus, Better Animal Models Created independently: QuickHomes, ClaimIt, ClaimIt API, CloneLand, DerpCats, QuickTeleports, QuickSpawns, MCMusicPlayer, MCDevDate, [SBM] Fluid Gun, OpenScreens Work on/Contribute to: Bewitchment Commissioned for: [SBM] Breadstone, [SBM] Infinite Falling, [SBM] Dead Man's Satchel, [SBM] Handheld Piston
hiotewdew Posted April 4, 2018 Posted April 4, 2018 Also try running attrib -R -H /D /S C:\Users\Reece\AppData\Roaming\.minecraft This will remove both the hidden and read-only attributes from .minecraft and all of its subfolders and files. Quote All Projects found here: Website Main Programmer for: Better Animals Plus, Better Animal Models Created independently: QuickHomes, ClaimIt, ClaimIt API, CloneLand, DerpCats, QuickTeleports, QuickSpawns, MCMusicPlayer, MCDevDate, [SBM] Fluid Gun, OpenScreens Work on/Contribute to: Bewitchment Commissioned for: [SBM] Breadstone, [SBM] Infinite Falling, [SBM] Dead Man's Satchel, [SBM] Handheld Piston
jabelar Posted April 4, 2018 Posted April 4, 2018 (edited) 11 minutes ago, hiotewdew said: Quote from StackOverflow. " There are three cases where a FileNotFoundException may be thrown. The named file does not exist. The named file is actually a directory. The named file cannot be opened for reading for some reason. The first two cases are unlikely based on your description. I would test against the third case using file.canRead() . " I was going to mention a similar thing -- I think AppData folder might have permissions issues in some cases. The first two cases are still possible -- the smallest typo can cause a file to not be found. For example, I'm assuming your mod id is actually "wire" all lower cases and stuff. I usually try to avoid typos by only entering the text once -- for example, in your model registration instead of "wire:newingot.json" I would usually code it as ingotInstance.getRegistryName(). In my example of course you would replace ingotInstance with the injected instance from your item registration. Edited April 4, 2018 by jabelar Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/
SciHi Posted April 4, 2018 Author Posted April 4, 2018 Ok so if I do a full build through the commands line then launch the game it works! Then if I do the same thing through the IDE then it doesn't... I assume it must be to do with the permissions now then 2 minutes ago, hiotewdew said: Also try running attrib -R -H /D /S C:\Users\Reece\AppData\Roaming\.minecraft This will remove both the hidden and read-only attributes from .minecraft and all of its subfolders and files. I ran this but nothing changed unfortunately. Quote
hiotewdew Posted April 4, 2018 Posted April 4, 2018 I would make a new project in a little better of a folder. Hidden appdata folders are not a good place to have configuration heavy IDE projects. Quote All Projects found here: Website Main Programmer for: Better Animals Plus, Better Animal Models Created independently: QuickHomes, ClaimIt, ClaimIt API, CloneLand, DerpCats, QuickTeleports, QuickSpawns, MCMusicPlayer, MCDevDate, [SBM] Fluid Gun, OpenScreens Work on/Contribute to: Bewitchment Commissioned for: [SBM] Breadstone, [SBM] Infinite Falling, [SBM] Dead Man's Satchel, [SBM] Handheld Piston
SciHi Posted April 4, 2018 Author Posted April 4, 2018 Yep just moved it to my NAS and everything worked fine. Been up for way too long didn't even think about it 2 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.