package net.minecraft.src;
import net.minecraft.src.*;
public class ItemTest extends Item
{
public ItemTest(int id)
{
super(id);
setHasSubtypes(true);
setMaxDamage(0);
}
private String[] names = new String[] {"name", "name1", "name2", "name3",};
public String getNameIS(ItemStack itemstack)
{
return names[itemstack.getItemDamage()];
}
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{
return 5.0F;
}
public boolean onBlockDestroyed(ItemStack par1ItemStack, int par2, int par3, int par4, int par5, EntityLiving par6EntityLiving)
{
par1ItemStack.damageItem(1, par6EntityLiving);
return true;
}
@Override
public int getIconFromDamage(int i)
{
if(i==0)
{
setMaxStackSize(64);
return mod_test.item1;
}
if(i==1)
{
setMaxStackSize(1);
return mod_test.item2;
}
if(i==2)
{
setMaxStackSize(1);
return mod_test.item3;
}
if(i==3)
{
setMaxStackSize(1);
return mod_test.item4;
}
else
{
setMaxDamage(10);
setMaxStackSize(1);
return mod_test.item5;
}
}
}
this is the code and the metadata item is like an shovel... now i need to tell it its an pickaxe... Lex it works.. like i want it! but now i need to tell it that it can breaks a rock.. how?