Jump to content

Texture to an Item


traxys

Recommended Posts

I am tying to give a texture to an item , but it is not working .

I gave , with nearly the same code a texture to a block , it worked .

 

So here are my code : for the block

 

package traxys.infbow.block;

 

import cpw.mods.fml.common.registry.LanguageRegistry;

import traxys.infbow.InfinityBow;

import traxys.infbow.creativeTab.CreativeTabInfBow;

import traxys.infbow.lib.NameList;

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraftforge.common.MinecraftForge;

 

public class HardWall extends Block{

 

public HardWall(int id) {

super(id, Material.rock);

this.setUnlocalizedName(NameList.HARD_WALL);

this.setCreativeTab(InfinityBow.tabInfBow);

this.setHardness(10.0F);

this.setResistance(2000.0F);

this.setTextureName("infbow:hardWall"); //<-------------------Texture given here

 

MinecraftForge.setBlockHarvestLevel(this, "pickaxe", 2);

 

}

 

}

 

 

 

For the Item :

 

package traxys.infbow.items;

 

import cpw.mods.fml.common.registry.LanguageRegistry;

import traxys.infbow.InfinityBow;

import traxys.infbow.lib.NameList;

import net.minecraft.item.Item;

 

public class Fletching extends Item{

 

public Fletching(int id) {

super(id);

this.setCreativeTab(InfinityBow.tabInfBow);

this.setUnlocalizedName(NameList.FLETCHING);

this.setTextureName("infbow:fletching"); //<----------------------------Texture given here

this.setMaxStackSize(16);

 

}

 

}

 

 

 

The folder path are src/minecraft/assets/infbow/textures/[items or blocks]

 

So Is there another function for items , or is it setTextureName() ?

If it is , how can I make it work ?

Link to comment
Share on other sites

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.