Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Adding lore to items in 1.16


PandaTobi
 Share

Recommended Posts

When trying to define an addInformation function to add lore to my custom item, the IDE is telling me that I am not overriding a method from it's superclass. Am I doing something wrong?

My function:

@Override
public void addInformation(ItemStack stack, PlayerEntity player, List list, boolean check) {
    list.add("Lorem ipsum for your troubled soul:");

}
Link to comment
Share on other sites

3 minutes ago, PandaTobi said:

Am I doing something wrong?

Yes, you have marked a method with @Override but are not actually overriding a method. You need to correct the method signature so that you are overriding a method.

  • Like 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

41 minutes ago, PandaTobi said:

A bit of an odd naming scheme,

Its called a SRG name. Its an automatically assigned identifier by the decompilation process so that even as obfuscated names get shuffled and changed every time Mojang updates the game, the SRG names stay constant. But it means that when major versions happen the SRG -> MCP name identification and mapping needs to be rediscovered.

  • Like 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

@Draco18s I understand. Have a good day, and thank you for giving the time to help me!

 

I'll just post the working code here just to help any future users that happend to stumble across this thread:

@Override
public void addInformation(ItemStack stack, World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn)
{
    super.addInformation(stack, worldIn, tooltip, flagIn);

    tooltip.add(ITextComponent.func_241827_a_("'Lore'em Ipsum! Ha!"));
}
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
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.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.