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

Having recently decided to try my hand at modding I've been having fun learning new things.

But now I've hit a wall, I can't get a texture to load and I can't figure out why.

 

RedCoal.java

package Newt;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;

public class RedCoal extends Item
{

public RedCoal()
{
        setUnlocalizedName(Reference.MODID + "_" + "redcoal");
        setTextureName(Reference.MODID+":"+"redcoal");
        setCreativeTab(CreativeTabs.tabMaterials);  
}

}

 

Reference.java

package Newt;

import net.minecraft.item.Item;

public class Reference
{
    public static final String MODID = "Newt";
    public static final String VERSION = "0.1";
}

 

Newt.java

package Newt;

import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;

@Mod(modid = Reference.MODID, version = Reference.VERSION)
public class Newt
{
    public static final String MODID = "Newt";
    public static final String VERSION = "0.1";
    public static Item RedCoal;
    
    @EventHandler
    public void init(FMLPreInitializationEvent event)
    {
    	RedCoal =  new RedCoal();
    	
    	GameRegistry.registerItem(RedCoal, "RedCoal");
    	
    	GameRegistry.addRecipe(new ItemStack(Blocks.mossy_cobblestone), new Object[]
    	{
        	"AAA",
        	"ABA",
        	"AAA",
        	'A', Blocks.sapling, 'B', Blocks.cobblestone
        });
    	
    	GameRegistry.addRecipe(new ItemStack(Blocks.stonebrick, 1, 1), new Object[]
    	{
        	"AAA",
        	"ABA",
        	"AAA",
        	'A', Blocks.sapling, 'B', Blocks.stonebrick
    	});	    	
    	
    }
}


 

And this is the directory tree:

 

Forge Mods\src\main\resources\assets\Newt\textures\items\redcoal.png

 

 

When I load up the test environment in Eclipse the log spits out this:

 

[10:07:21] [Client thread/ERROR]: Using missing texture, unable to load newt:textures/items/redcoal.png

java.io.FileNotFoundException: newt:textures/items/redcoal.png

 

 

 

I don't understand why the localizations are working fine, but the textures wont load.

I'm not trying to be rude it just comes out that way sometimes.

I'm here to try and learn as much as I can, won't you join me?

  • Author

I have saved and refreshed. I even restarted and that didn't help.  :-\

I'm not trying to be rude it just comes out that way sometimes.

I'm here to try and learn as much as I can, won't you join me?

do you have your project on git? Or somewhere I can view all of your code?

 

my only suggestion would be maybe making your ID lowercase and your mod's package to be lowercase as well

 

Newt => newt

 

don't think that is the issue but at this moment I'm spitballin' at little things that might be an issue even if they don't seem like it.

 

EDIT:

you have redcoal saved as a png that is 16x16 correct?

  • Author

Oh my gosh I figured it out. I feel silly.

 

I changed:

 

Forge Mods\src\main\resources\assets\Newt\textures\items\redcoal.png

 

To:

 

Forge Mods\src\main\resources\assets\newt\textures\items\redcoal.png

 

and it worked.

 

Thanks for your help. :)

I'm not trying to be rude it just comes out that way sometimes.

I'm here to try and learn as much as I can, won't you join me?

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.