Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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?

dir.png

dir2.png

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?

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

  • Author
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

dir3.png

  • Author

Thought I'd add another quick edit. It even builds to (what I think) is the right places.

Opening the JAR file in 7z

jar.png

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() . "

 

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.

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 by jabelar

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

  • Author

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.

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.

  • Author

Yep just moved it to my NAS and everything worked fine.

Been up for way too long didn't even think about it

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.