Jump to content

How To Add Kill Counter To A Custom Tool


fierymelon300

Recommended Posts

addInformation is a method belonging to the Item class, so you need to implement/override it in your custom Item class.

 

In the method, you will need to check if the Item NBT tag is null and if so, create a new tag first, otherwise you will crash your game when you mouse over your Item in the Creative Tab.

Link to comment
Share on other sites

Your UltimateGemSword class should look more like this:

 

package yourpackage.examplemod

 

import net.minecraft.everything.*;

 

public class UltimateGemSword extends ItemSword

{

 

public UltimateGemSword(yourparams)

{

 

super(par1, par2Material);

 

}

 

@Override

public void doStuff()

{

 

//example stuff

 

}

 

public void addInformation()

{

 

//example stuff

 

}

 

}

 

 

To my knowledge, I don't think you should be placing methods inside of other methods.

Kain

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.

Announcements



×
×
  • Create New...

Important Information

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