Jump to content

.setUnlocalizedName Error


iOppy

Recommended Posts

Hello everyone today I bring an issue to the forums about an error I cannot seem to fix on my mod... Here is the code with the error

package com.ioppy.industrialrevolution.init;

import net.minecraft.item.Item;

public class IndustrialRevolutionItems {

public static Item pocket_watch;

public static void register() {
	pocket_watch = new Item().setUnlocalizedName(pocket_watch);
}

}

 

It is the line "pocket_watch = new Item().setUnlocalizedName(pocket_watch);" I keep getting the error: "The method setUnlocalizedName(String) in the type Item is not applicable for the arguments (Item)" As you can probably tell I am brand new to mod creation and I was hoping someone could help me resolve this so that I can learn from it....

 

Note: if you need to see any other part of my mod please let me know!

 

Regards,

 

 

~Ops

Link to comment
Share on other sites

Item#setUnlocalizedName

takes a

String

argument, but you're trying to pass it the value of the

pocket_watch

field (an

Item

). String literals are delimited by double quotes (

"

).

 

This is an extremely basic concept of Java. You can't write a mod until you understand Java properly.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...

Important Information

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