Jump to content

Recommended Posts

Posted

hi i was wondering if anyone here knew how to make an item show a description in grey text when hovered over in inventory or when shifted while hovering over the item if anyone could help i would be Grateful

(Sorry if my english gets a bit terrible not my main language). :)

Posted

 

public void addInformation(ItemStack par1ItemStack, List par2List)

    {

    par2List.add("test");

    }

 

this is what i came up with put i get an error saying Void is an invalid type for the variable addinformation

 

Posted

@TotalyTaco

 

The addInformation() method is defined in the Item class as:

    /**
     * allows items to add custom lines of information to the mouseover description
     */
    @SideOnly(Side.CLIENT)
    public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {}

 

So if you're going to override it you need to:

a) also make it only loaded on client side with the @SideOnly annotation

b) use exactly the same parameter list -- otherwise in Java you've defined a different method that won't be called.

 

Note that this method is called automatically by the showToolTip() method in ItemStack class, and is appended to the display name for the item.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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.