Jump to content

[1.7.2] [Re-Solved] How can i change the texture of a vanilla item?


SackCastellon

Recommended Posts

I want to know how can i change the texture of a vanilla item without editing vanilla classes (or using texture packs), something like the Metallurgy Mod did with the vanilla tools' textures.

 

Thanks for helping  :)

 

SOLUTION 1:

 

Just create your new texture, rename it as it is at minecraft vanilla textures folder (eg: to change texture of a Iron Ingot rename the texture as iron_ingot.png) and then place your new texture at [yourForgeFolder]\src\main\resources\assets\minecraft\textures\[items or blocks]\iron_ingot.png

 

SOLUTION 2:

 

You just will need to type

@EventHandler
public void preInit(FMLPreInitializationEvent event) 
{
Items.[vanillaItem].setTextureName("[yourModID]:[newTexture]");
}

Link to comment
Share on other sites

Hi

 

I've got a sneaking suspicion that this will stop working when you try to package your mod as a zip for releasing it.  If you plan to release your mod eventually, you might want to check that this method still works when you package it up, before you spend too much time on it.

 

I've never tried doing this myself so I can't suggest any other way, sorry.

 

-TGG

Link to comment
Share on other sites

Hi

 

I've got a sneaking suspicion that this will stop working when you try to package your mod as a zip for releasing it.  If you plan to release your mod eventually, you might want to check that this method still works when you package it up, before you spend too much time on it.

 

I've never tried doing this myself so I can't suggest any other way, sorry.

 

-TGG

 

Yes, you're right.  I'll do a quick reobfuscation to see if it still works.

 

Thanks

Link to comment
Share on other sites

  • 3 years later...
16 minutes ago, RoyalKingZB said:

I can't do this cause I'm in 1.10.2 Dx Help There are json files now that handle the textures and there is no .setTextureName now Dx

This thread is over 3 years old, and you're trying to do something in a completely different version. Start a new thread, explain the problem, show your code, and post fml-client-latest log :) you'll get more help that way

Link to comment
Share on other sites

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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