Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

Try to extend it with ItemPickaxe

If I helped then you help, hit that Thank You button or Applaud.

  • 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?

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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.