HelpNation Tutorials

Would you like to react to this message? Create an account in a few clicks or log in to continue.
HelpNation Tutorials

Learn how to mod, make, read, or just review modding tutorials and mods!


    [Creating Mods]Items Tutorial*WINDOWS*[1.0.0]

    Or1g1n_Of_Death
    Or1g1n_Of_Death
    Forum Founder
    Forum Founder


    Posts : 24
    Join date : 2011-11-05
    Location : My Computer

    [Creating Mods]Items Tutorial*WINDOWS*[1.0.0] Empty [Creating Mods]Items Tutorial*WINDOWS*[1.0.0]

    Post  Or1g1n_Of_Death Sun Dec 11, 2011 10:41 pm

    Modding Disclaimer:

    I, Or1g1n_Of_Death, do not take any responsibility for anything that might happen to your computer or any device you use while making code that may be unwanted. Anything saying I will be sued, etc. Will be deleted and you will be told to review this section.

    Just in case you didn't exactly get what I first said...

    Or1g1n_Of_Death is not responsible for anything that happens to your device you use to mod with, that you may not want. Thank you, have a nice day.

    Signed,
    ~Or1g1n; The King king


    Back To Modding!

    Ok, I know I haven't gotten around to the items tutorial yet, so, here it is!

    Well, this is quite amazingly easy. You're going to have to make another mod_ItemName file, and then an ItemItemName.java file. Just to make this a bit short, here's what everything should look like:

    ItemItemName.java

    Code:
    package net.minecraft.src;    //Referenced package

    import java.util.Random;        //Importing Java

    public class ItemItemName extends Item      //What the Item extends
    {

      public ItemItemName (int i)
      {
          super(i);
          maxStackSize = 64;  //States max amount of item in a stack.. Duh :P
      }
    }

    mod_ItemNameHere.java

    Code:
    package net.minecraft.src;

    public class mod_ItemNameHere extends BaseMod    //Extends BaseMod
    {
      public static final Item ItemNameHere = new Item(7502).setItemName("DiamondNugget");  //7502 is the Item ID.

     public void load() {    //public void load now replaces public class in ModLoader since 1.0
    {
      ItemNameHere.iconIndex = ModLoader.addOverride("/gui/items.png", "folder/ItemNameHere.png");
      ModLoader.AddName(ItemNameHere, "ItemNameHere");
      ModLoader.AddRecipe(new ItemStack(Item.ItemNameHere, 3), new Object[] {
        " # ", Character.valueOf('#'), Item.diamond
        });
    }

    public String getVersion()
    {
      return "1.0.0";
    }

    ~Or1g1n; The King king

      Current date/time is Thu May 09, 2024 11:31 am