Posted March 30, 201411 yr I made a custom pickaxe, and I don't want it to break, but it doesn't return stone when mined, can someone help please? Pickaxe code: package com.budboy.am.item; import com.budboy.am.creativetab.CreativeTab; import net.minecraft.item.ItemTool; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemTool; public class ItemEmpoweredPickaxe extends Item { public int getHarvestLevel (ItemStack stack, Block block, int meta){ return 3; } @Override public float getDigSpeed (ItemStack stack, Block block, int meta) { return 20.0f; } protected String getHarvestType () { return "pickaxe"; } @Override public boolean hasEffect(ItemStack par1ItemStack) { return true; } @Override @SideOnly(Side.CLIENT) public EnumRarity getRarity(ItemStack par1ItemStack){ return EnumRarity.epic; } public ItemEmpoweredPickaxe() { maxStackSize = 1; setCreativeTab(CreativeTab.magicTab); setUnlocalizedName("empoweredPickaxe"); setTextureName("am:empoweredPickaxe"); } } Sorry it's not in a spoiler, the spoiler button doesn't seem to work for me
March 30, 201411 yr Try to extend it with ItemPickaxe If I helped then you help, hit that Thank You button or Applaud.
March 30, 201411 yr Author Okay, but it's now giving me an error at public ItemEmpoweredPickaxe() { "Implicit super constructor ItemPickaxe() is undefined. Must explicitly invoke another constructor" So what would I do there? Put down a super constructor?
March 30, 201411 yr Should look like this: public Itemname(ToolMaterial material) { super(material); } Then you can add this: setCreativeTab(CreativeTab.magicTab); setUnlocalizedName("empoweredPickaxe"); setTextureName("am:empoweredPickaxe"); You won't need to set the stack size since its a pickaxe, they never stack.. If I helped then you help, hit that Thank You button or Applaud.
March 30, 201411 yr Author Ah, I see, and I just replace "material" after ToolMaterial with my custom material?
March 30, 201411 yr I hope I helped! If I helped then you help, hit that Thank You button or Applaud.
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.