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

Hey guys,

 

I am wondering how would you give a tool unlimited uses

 

I dont want the tool to ever break also i dont want the durability bar to appear

 

So giving the item a massive number like 1000000000000000000000000000000000000000000000000  wouldnt work

 

Thanks in advance

STOP CRUCIFYING NEW MODDERS!!!!

Okay. Make sure to do a few things

1: Don't extend itemtool, extend item

2: just change a float that's something like effeciancyOnCorrectBlock

:P

"you seem to be THE best modder I've seen imo."

~spynathan

 

ლ(́◉◞౪◟◉‵ლ

  • Author

Okay. Make sure to do a few things

1: Don't extend itemtool, extend item

2: just change a float that's something like effeciancyOnCorrectBlock

:P

 

Wow far easier than I thought :P

STOP CRUCIFYING NEW MODDERS!!!!

Over ride these two methods from ItemTool:

    /**
     * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise
     * the damage on the stack.
     */
    public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
    {
        par1ItemStack.damageItem(2, par3EntityLiving);
        return true;
    }

    public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLiving par7EntityLiving)
    {
        if ((double)Block.blocksList[par3].getBlockHardness(par2World, par4, par5, par6) != 0.0D)
        {
            par1ItemStack.damageItem(1, par7EntityLiving);
        }

        return true;
    }

 

and remove the part which damages it.

 

this should also work, and allows for tool materials and effectiveness without having to add extra stuff to your item code

take any item and add this code to your main mod class

MinecraftForge.setToolClass(ITEM, "pickaxe", HARVEST_LEVEL);

HARVEST_LEVEL is an int 0-3 where: 0 = wood/gold; 1 = stone; 2 = iron; 3 = diamond.

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.