I've been working on a mod that is so early in development that the name isn't even final. I'm adding some weapons into the game and I only have one made currently. My issue is that I have everything working, but the recipe isn't what it should be. I'm having some issues trying to figure out what was wrong, and so I was thinking maybe the forums could help!
Code:
package net.minecraft.src;
import java.util.Random;
public class mod_warcraftcraft extends BaseMod
{
//Tools
public static final Item Sword = new ItemSword(1380, EnumToolMaterial.EMERALD).setItemName("ashbringer");
public mod_warcraftcraft()
{
//Textures
Sword.iconIndex = ModLoader.addOverride("/gui/items.png", "/gui/Ashbringer.png");
//Here are allof the item names
ModLoader.addName(Sword, "The Ashbringer");
//Here are all the recipes for each item
ModLoader.addRecipe(new ItemStack(Sword, 1), new Object[] {
" **","**%","@ ", Character.valueOf('*'), Item.ingotGold, Character.valueOf('%'), Item.enderPearl, Character.valueOf('@'), Item.blazeRod
});
}
public String getVersion()
{
return "3.14159265";
}
public void load()
{
}
}
Doing that should register the item, anywhere you see "lapis" you should add in the name of your item. In this case I was making lapis dust! Okay and for the second file, call it something like "Item(Your Item Name).java" and all you need in is:
package net.minecraft.src;
import java.util.Random;
public class Itemlapis extends Item
{
public Itemlapis(int i)
{
super(i);
maxStackSize = 64;
}
}
Basically it defines your item, and this is where you would put in any kind of property it has. For something that has no function other than crafting, all you need is the "super(i) and the maxstacksize! Again don't forget to change the Lapis.
So if you wanted to add it in a crafting recipe, that should be easy now, it would just be "Item.itemLapis" because that is what you called it as a variable "public static final Item itemLapis..."
If you weren't asking for a mini-howto make an item tutorial, well you just got one If you already made one then just use what I said right above this.
I hope that made sense, and if you didn't understand it, or the code doesn't make sense, feel free to ask! Good luck!
Code:
So the fix is really simple, and you'll be face palming after this one I did some testing with it, and here is your problem:
What you have:
The Fix:
See the difference? You left out a space in the bottom row of the crafting recipe! Haha, sometimes it's just that simple
Good luck!
Haha no problem, glad I could help
And don't worry, I've done things like this enough times myself!
For this you will need to make another .java file, but in your "mod_warcraftCraft.java" file, you will need to add this to declare the item:
And then in the section of 'public mod_warcraftCraft' you need to give it a name and register it:
Doing that should register the item, anywhere you see "lapis" you should add in the name of your item. In this case I was making lapis dust! Okay and for the second file, call it something like "Item(Your Item Name).java" and all you need in is:
Basically it defines your item, and this is where you would put in any kind of property it has. For something that has no function other than crafting, all you need is the "super(i) and the maxstacksize! Again don't forget to change the Lapis.
So if you wanted to add it in a crafting recipe, that should be easy now, it would just be "Item.itemLapis" because that is what you called it as a variable "public static final Item itemLapis..."
If you weren't asking for a mini-howto make an item tutorial, well you just got one If you already made one then just use what I said right above this.
I hope that made sense, and if you didn't understand it, or the code doesn't make sense, feel free to ask! Good luck!
No problem, always happy to help! I'm still a beginner too, but feel free to ask! Just send me a Private Message if you need anything