Reputation: 11
I am making a new mod and my block textures work fine but my item textures dont i need assistance on this because i just started to code java This Is My Script:
package com.HaydenMod.item;
import com.HaydenMod.lib.RefStrings;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
public class DiamondShard {
public static void MainRegistery(){
intializeItem();
registerItem();
}
public static Item Dshard;
public static void intializeItem(){
Dshard = new Item().setUnlocalizedName("Dshard").setCreativeTab(CreativeTabs.tabMaterials).setTextureName(RefStrings.MODID + ":Diamond_Shard").setMaxStackSize(16);
}
public static void registerItem(){
GameRegistry.registerItem(Dshard, Dshard.getUnlocalizedName());
}
}
Upvotes: 1
Views: 587
Reputation: 153
YourItemName= new Item().setUnlocalizedName("YourItemName").setTextureName("yourModFile:YourtextureImageNAme").setCreativeTab(TheCreativeTabYouWantToPutItIn);
This is what is used and it works perfectly. The TextureName
has to be exactly the same as the TextureName
in the source folder.
For example, my TextureName
is blah.png
and in my source folder. When calling it, should write it as setTextureName("yourModFile:blah")
.
Upvotes: 0
Reputation: 51
Try
.setTextureName(RefStrings.MODID + ":" + "Diamond_Shard")
If it dosn't work can you attach a pastebin with the error log
Upvotes: 0