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

(SOLVED) [1.16.5] Item addInformatiom - Override not regonized


Recommended Posts

Hello ladies and gentlemen !

I've recently started with Minecraft Modding - Moved from C#.
And ran into several issues. One of them is what I stated in the title.

About my setup
MDK: forge-1.16.5-36.1.0-mdk
IDE: IntelliJ IDEA 2020
Minecraft: obviously 1.16.5
 

package com.example.examplemod.common.items;

import ...;

public class ItemTest extends Item {

    public ItemTest(Properties properties) {
        super(properties);
    }

  	// ERROR Method does not override method from its superclass
    @Override
    public void addInformation(ItemStack stack, World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) {
      	// ERROR Cannot resolve method 'addInformation' in 'Item'
        super.addInformation(stack, worldIn, tooltip, flagIn);

        tooltip.add(new StringTextComponent("Example tooltip"));
    }

}

 

I checked the Source Code, surprisingly addInformation doesn't exist?
What is the alternative for that?
I've only found a getter for Tooltip

 

Best regards, Carbon.

Edited by Carbon
Link to post
Share on other sites

Do not override manually, use your IDE to do that for you.

Forge has switched to using Mojang mappings by default, so many methods will have different names addInformation is now called appendHoverText.

Link to post
Share on other sites
19 minutes ago, diesieben07 said:

Do not override manually, use your IDE to do that for you.

I'm aware of that - Thank you. 

But is hard to understand the procedure with wrong function naming 

20 minutes ago, diesieben07 said:

addInformation is now called appendHoverText

Is there a list of changed things? 

I'm working by a really recent tutorial. 

 

Instead of removing the old function right away, maybe keep it and mark it as depreciation. 

 

Best wishes 😷

Link to post
Share on other sites
1 minute ago, Carbon said:

Is there a list of changed things? 

I'm working by a really recent tutorial. 

For now assume every method or field in vanilla code has a different name.

Until now all the names were crowdsourced by the MCP project. Now (by default, you can change this in your build.gradle if you want to) we use the mappings published by Mojang, so methods and fields will have the names they have in Mojangs code (before obfuscation).

 

2 minutes ago, Carbon said:

Instead of removing the old function right away, maybe keep it and mark it as depreciation. 

The methods have not changed. They just have a different name.

  • Thanks 1
Link to post
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.

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.



×
×
  • Create New...

Important Information

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