Jump to content

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


Recommended Posts

Posted

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]");
}

Posted

There is an asset folder in the minecraft jar file. you can change the picture using photoshop or gimp and just put that in your mod and it will replace your only minecraft textures

 

Hope this helps!

 

Thanks it works.

Posted

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

Posted

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

Posted

Correct me if I'm wrong, but can't you do:

 

Items.item.setTextureName("mod:other_texture");

 

Where "item" is the vanilla item, "mod" is your folder for textures, and "other_texture" is for your other texture.

Posted

Correct me if I'm wrong, but can't you do:

 

Items.item.setTextureName("mod:other_texture");

 

Where "item" is the vanilla item, "mod" is your folder for textures, and "other_texture" is for your other texture.

 

You're rigth. It also works.

  • 3 years later...
Posted
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

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