Did you make sure your name was exactly the same? I think it's case sensitive too. If it makes life easier, the auto-complete when pressing tab will work for the usernames. So type "/give " then press tab to get your username, then type "tm:" and press tab like said previously.
Note that you have an empty method called register, and an instance initializer block that calls GameRegistry.registerItem. What you should do is remove braces to form something like this:
public static void register()
{
GameRegistry.registerItem(super_sword, super_sword.getUnlocalizedName().substring(5)); //tile.super_sword
}
public static void register()
{
GameRegistry.registerItem(super_sword, super_sword.getUnlocalizedName().substring(5)); //tile.super_sword
}
Also, I've just noticed here that you're getting the unlocalised name of the item you're registering! It won't have one because it's not registered yet!
You should actually be using the GameRegistry.register method which only takes one argument (an item/block) and call setRegistryName on your item either on the instance or within it's constructor.
Hey everyone!
I've been trying to create a mod, but I got a problem
Whenever I try to /give myself the item, it says
"There is no such item with name tm:super_sword"
I am using eclipse
Some pictures of my code
Your problem is that you registered your registry name wrong. To check what your actual name is, load Minecraft, open the command console and type in
/give <player> tm: and then hit Tab.
Hitting Tab will show you what your actual name in the game is. The line you need to change is:
GameRegistry.registerItem(Item i, String name)
Change the name to super_sword.
Thanks, I'll try that!
EDIT: It already is? In which image and what line number is the code you are talking about at? Thanks
The line of code that I am referring to is in your ToolItems class at line 20.
I'm very confused.. isn't it already super_sword?
EDIT: Should I remove .getUnlocalizedName().substring(5)
after super_sword?
Also, I did do /give @p tm then hit tab but nothing happened
You do tm: with the colon because Minecraft will recognize that as a modid. And yeah, get rid of the substring() and just put super_sword
Did /give @p tm: then pressed tab. Nothing happens.
Pretty sure you should be putting your own username instead of "@p".
Already tried that, still didn't work. Thanks
Did you make sure your name was exactly the same? I think it's case sensitive too. If it makes life easier, the auto-complete when pressing tab will work for the usernames. So type "/give " then press tab to get your username, then type "tm:" and press tab like said previously.
Did exactly that.
EDIT: Here's a screenshot of me doing it.
EDIT 2: This is confusing me.. where's my item???!??!
In your ToolItems, you have code that looks like this:
Note that you have an empty method called register, and an instance initializer block that calls GameRegistry.registerItem. What you should do is remove braces to form something like this:
Also, registerRenders has the same problem.
Also, I've just noticed here that you're getting the unlocalised name of the item you're registering! It won't have one because it's not registered yet!
You should actually be using the GameRegistry.register method which only takes one argument (an item/block) and call setRegistryName on your item either on the instance or within it's constructor.