Jump to content

Items With metata and getting damage. but need help with material


Speiger

Recommended Posts

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?

Crazy Brain...

Link to comment
Share on other sites

If i could test per day 8 ours i do not need to ask. but i can test maybe at the week 2/4 ours. the most goes to test the pickaxe thing here and installing forge which is at the moment a pain to install it. hope you help me. thank for reading this.

Crazy Brain...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

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