No, I've been using this setUnlocalizedName-method just yesterday
and it doesn't change the Name, which appears in the game. It
is still for recognizing the related png-file in your textures-folder.
Example:
That's in your mod class:
public static final Item hahaha = new ItemHahaha(300).setUnlocalizedName("hahaha");
So the texture manager will be looking for ~/textures/items/hahaha.png.
Yes I know that... I wasnt the one needing help, I assumed he only needed the one line for textures since that's what this topic is about
No, I've been using this setUnlocalizedName-method just yesterday
and it doesn't change the Name, which appears in the game. It
is still for recognizing the related png-file in your textures-folder.
Example:
That's in your mod class:
public static final Item hahaha = new ItemHahaha(300).setUnlocalizedName("hahaha");
So the texture manager will be looking for ~/textures/items/hahaha.png.
.setUnlocalizedName doesn't set the in-game name. You use LanguageRegistry to add a name to an item right after you create the item.
public static final Item hahaha = new ItemHahaha(300).setUnlocalizedName("hahaha");
LanguageRegistry.addName(hahaha, "Item Name Here");
I am not using forge, sorry...I expect, that's a method, which you can find in the forge API,
therefore eclipse tells me, that LanguageRegistry cannot be resolved.
Okay so I got it to work in game and everything works, but when I go to open my inventory when I go to the block minecraft crashes. Here is my code and crash log, what do I need to fix?
As I said before, the blocks function perfectly in game, it's only when in the menu does it crash the game.
Thanks for your time
You just copy-pasted the Log class ... you should learn how to java and how to understand crash logs, my friend (pun intended)
When basically replacing an existing class you want to extend it and only change what needs to be different
For that, you need to understand it's inner workings
In this case, you messed up creating the Icon Array, it's the wrong size (too small) for the amount of Icons requested
How do I implement this method into a metadata block?
code:
Since it is currently returning the Icon position on the old texture file, not sure how to make it and link it to the specific icon image.
What I see you have is a single Icon field. Make that an array of the size of your metadata list (so yours has 14 it looks like, so make Icon[] icons = new Icon[14];
When you go to register them in the method with the IconRegister parameter, register each index as a specific String, like so
icon[0] = iconRegister.idkTheMethod("the file location for metadata 0's texture");
And do that for each one or, a better way
for(int i = 0; i < icons.length; i++)
{
String file = "crops" + i;
icons[i] = iconRegister.idkTheMethod(file);
}
This way is quicker and will automatically append the metadata to the crop name (assuming your block is named "crops", whatever way) and is neater.
When you go to the getBlockTextureFromSideAndMetadata(int i, int j), you can not just return icon[j], which makes that one cleaner, too.
Ok I don;t understand what I would put where it says: HellBody.iconIndex = ModLoader.addOverride("/gui/items.png", "/items/Hellchest.png"); what would I put to fix the modloader.addoverride error?
package net.minecraft.src;
import java.util.Random;
public class mod_minecraft extends BaseMod
{
public static final Item yellowGem = new ItemYellowGem(3001).setUnlocalizedName("yellowgem");
public void load()
{
ModLoader.addName(yellowGem, "Yellow Gem");
}
public String getVersion()
{
return "3.14159265";
}
}
package net.minecraft.src;
import java.util.Random;
public class ItemYellowGem extends Item
{
public ItemYellowGem(int i)
{
super(i);
maxStackSize = 10;
}
public String Version()
{
return "3.14159265";
}
}
This is my code using .setUnlocalizedName. I could start minecraft on eclipse perfectly but i can't find my item. I even tried using the command to spawn it but it still doesnt work
Under my mod_name in public load section how would I fix this texturing to work Hellgem.iconIndex = ModLoader.addOverride("/gui/items.png" , "/items/Hellgem.png");. Also where would I put the folders for the .png files
Under my mod_name in public load section how would I fix this texturing to work Hellgem.iconIndex = ModLoader.addOverride("/gui/items.png" , "/items/Hellgem.png");. Also where would I put the folders for the .png files
package net.minecraft.src;
import java.util.Random;
public class mod_minecraft extends BaseMod
{
public static final Item yellowGem = new ItemYellowGem(3001).setUnlocalizedName("yellowgem");
public void load()
{
ModLoader.addName(yellowGem, "Yellow Gem");
}
public String getVersion()
{
return "3.14159265";
}
}
package net.minecraft.src;
import java.util.Random;
public class ItemYellowGem extends Item
{
public ItemYellowGem(int i)
{
super(i);
maxStackSize = 10;
}
public String Version()
{
return "3.14159265";
}
}
This is my code using .setUnlocalizedName. I could start minecraft on eclipse perfectly but i can't find my item. I even tried using the command to spawn it but it still doesnt work
Yes I know that... I wasnt the one needing help, I assumed he only needed the one line for textures since that's what this topic is about
.setUnlocalizedName doesn't set the in-game name. You use LanguageRegistry to add a name to an item right after you create the item.
edit: deleted double quote.
You just copy-pasted the Log class ... you should learn how to java and how to understand crash logs, my friend (pun intended)
When basically replacing an existing class you want to extend it and only change what needs to be different
For that, you need to understand it's inner workings
In this case, you messed up creating the Icon Array, it's the wrong size (too small) for the amount of Icons requested
code:
Since it is currently returning the Icon position on the old texture file, not sure how to make it and link it to the specific icon image.
In the zip I put \mod\jackd44scupcakes\items\ChocCupcake.png
From the base of the Archive.
What I see you have is a single Icon field. Make that an array of the size of your metadata list (so yours has 14 it looks like, so make Icon[] icons = new Icon[14];
When you go to register them in the method with the IconRegister parameter, register each index as a specific String, like so
icon[0] = iconRegister.idkTheMethod("the file location for metadata 0's texture");
And do that for each one or, a better way
for(int i = 0; i < icons.length; i++)
{
String file = "crops" + i;
icons[i] = iconRegister.idkTheMethod(file);
}
This way is quicker and will automatically append the metadata to the crop name (assuming your block is named "crops", whatever way) and is neater.
When you go to the getBlockTextureFromSideAndMetadata(int i, int j), you can not just return icon[j], which makes that one cleaner, too.
RSMC - A massive RPG mod which adds skills and tons of content to Minecraft, one block at a time!
the path SHOULD be mods\jackd44scupcakes\textures\items\ChocCupcake.png
Yes, armor works the same way it did before.
What about TextureFX? Like the compass or clock.
This is my code using .setUnlocalizedName. I could start minecraft on eclipse perfectly but i can't find my item. I even tried using the command to spawn it but it still doesnt work
mods\yourmodid\textures\items
I still don't understand so I make a folder in my minecraft.jar called that or what??
The folder is in yourmoddingfolder/bin/minecraft/textures/item
If you are using eclipse then yourmoddingfolder/eclipse/client/bin/textures/items
---------------------------------------------------------------------------------------------------------------------------------------------------
Can someone help me fix why it says there is no block id when i use .setunlocalizedname
You forgot to add it to the creative tab