You are viewing our Forum Archives. To view or take place in current topics click here.

Are these good tutorials? Sticky?

Yes deserves a sticky!
66.34% (67 votes)
There good but not sticky worthy
13.86% (14 votes)
There not good
19.80% (20 votes)

Total Votes: 101

How to make Mods [ModLoader][26 tutorials][1.3.1 and 1.2.5]
Posted:

How to make Mods [ModLoader][26 tutorials][1.3.1 and 1.2.5]Posted:

Odin
  • TTG Addict
Status: Offline
Joined: Dec 23, 201013Year Member
Posts: 2,446
Reputation Power: 80
Status: Offline
Joined: Dec 23, 201013Year Member
Posts: 2,446
Reputation Power: 80
Modding tutorials for Minecraft 1.3.1 and 1.2.5

README ALL

I created this tutorial for Minecraft 1.1 when it first came out and there were little to no tutorials. Then I later updated it to 1.2.5 which was a confusing step (like updating from 1.8-1.0 to 1.1). Now I am updating to 1.3.1 which has changed almost all advanced tutorials that I was going to give but the post got knocked to the ~100th page in a week when TTG merged all PC related Minecraft forums into one. Now I have spent a lot of time working on these tutorials for you guys only to have it buried by retarded stuff. Please do not allow that to happen again, if it does I will just remove the tutorial completely and I apologize ahead of time for the ones that have bookmarked this and use(d) it


Requirements:
Java Development Kit (JDK) - [ Register or Signin to view external links. ]
Java Runtime Environments (JRE) - [ Register or Signin to view external links. ]
Eclipse (not required but helps so much) - [ Register or Signin to view external links. ] [choose the first link]
Minecraft Coder Pack (MCP) - [ Register or Signin to view external links. ]

---------------------------------

My Goals

[X] 5 Comments
[X] 10 Comments
[X] 15 Comments
[X] 25 Comments
[X] 50 Comments
[X] 75 Comments
[X] 100 Comments

[] 125+ Comments

[X] 50 Views
[X] 100 Views
[X] 200 Views
[X] 500 Views
[X] 1000 Views
[X] 1500 Views
[X] 2000 Views
[X] 2500 Views
[X] 3000 Views
[X] 3500 Views
[X] 4000 Views
[X] 4500 Views
[X] 5000 Views
[X] 7500 Views
[X] 10K+ Views


[] Sticky



How to install mods

Are you on a Mac? Well you're paying to much for an average computer...


Are you on a Windows Computer? aa)
here is your tutorial:

first press Windows Key + R
type
%appdata%\.minecraft\bin\


now get a archiving program that can open the .jar file, I recommend WinRAR but 7zip and WinZIP work too.

copy the Minecraft.jar and save it as Minecraft -Backup.jar or whatever you want (this is a backup just incase you screw up)

Now open the Minecraft.jar file with your archiving program and delete the META-INF folder.

Now drag the mod files that you downloaded. Let it overwrite the files because it will save the changes that way.


Fixing ModLoader Errors

just put that in your mod_Namehere

public String getVersion()
   {
     // TODO Auto-generated method stub
     return null;
   }
 
   public void load()
   {
     // TODO Auto-generated method stub
 
   }




WHAT VERSION OF MINECRAFT THAT THE TUTORIAL WORKS WITH

List of tutorials that work for both 1.3.1 and 1.2.5:
Block tutorial
Item tutorial
Food tutorial
Giving Food Potion Effects tutorial
Item that spawns a mob tutorial
Advanced Block tutorial

List of tutorials that MAYBE work for both 1.3.1 and 1.2.5:
Transparent tutorial
Slab Block tutorial
Creating a flower tutorial
Making a sword catch mobs on fire tutorial
Generating Ore tutorial
Editing the Start Menu tutorial
Sugar-Cane Like Block tutorial

These tutorials work only for 1.2.5:
All the video tutorials

These are the tutorials that don't work are going to be updated whether it is fixing spelling or making or more understandable so expect to no see anything in the spoiler:
Custom Tools
Creating Armor
Adding Armor Effects
Human NPC Sorry for the pitiful explanation for this, I am completely redoing it and making it much better


Creating Your First Block


BlockNamehere.java

package net.minecraft.src;

import java.util.Random;

public class BlockNamehere extends Block
{

    public BlockNamehere(int i, int j)
    {
        super(i, j, Material.ground);           
    }
    public int idDropped(int i, Random random)
    {
       return mod_Namehere.Namehere.blockID;
    }
    public int quantityDropped(Random random)
    {
            return 3;
    }
}


mod_Namehere.java

package net.minecraft.src;

public class mod_Block extends BaseMod
{
public static final Block Namehere = new BlockName(160, 0).setBlockName("anynamehere").setHardness(3F).setResistance(4F).setLightValue(1F);

    public void load()
    {
        Namehere.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/pathtoyourfile/image.png");
        ModLoader.registerBlock(Namehere);
        ModLoader.addName(Namehere, "In-Game Name Here");
        ModLoader.addRecipe(new ItemStack(Namehere, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt});
    }

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


HELP: BlockNamehere.java

At return mod_Namehere.Namehere.blockID;
This is what the block drops, Change mod_Namehere.Namehere not the .blockID
examples

return Block.grass.blockID;
return Item.clay.shiftedIndex;


HELP: mod_Namehere

At new BlockNamehere(190,
change 190, that is the block ID be careful not to use the same ID again

At .setHardness(1.0F)
change the 1.0, dirt is 0.5; stone is 1.5; 10 is unbreakable

At .setResistance(2500.0F)
this is how resistant the block is to Explosives
change the 2500.0, obsidian is 2000.0F all other blocks are 5.0F

At .setLightValue(1.0F)
this is how bright your block is
1.0F is as high as it goes, Torches are 0.9375F and redstone is 0.5F

At ModLoader.AddName(Namehere, "Nameingamehere");
this is the ingame name, so change Namehere to the block name (in mod_Namehere) and change Nameingamehere to whatever you want it to say ingame

At Namehere.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Namehere.png");
this is the texture, change the Namehere.blockIndexInTexture and in the () change "/Namehere.png" ex. "/Mod/Fireblock.png" the /Mod/ is a folder and the Fireblock.png is the image file



Creating your First Item

Again use the template to your advantage

ItemNamehere.java

package net.minecraft.src;

import java.util.Random;

public class ItemNamehere extends Item
{

        public ItemNamehere (int i)
        {
                super(i);
                maxStackSize = 64;
        }
}


mod_Namehere.java

package net.minecraft.src;

public class mod_Item extends BaseMod
{
        public static final Item Namehere = new ItemNamehere(5000).setItemName("anynamehere");
       
        public void load()
        {
                Namehere.iconIndex = ModLoader.addOverride("/gui/items.png", "/pathtoyourfile/image.png");
                ModLoader.AddName(Namehere, "In-Game Name Here");
                ModLoader.AddRecipe(new ItemStack(Namehere, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt});
        }
       
        public String getVersion()
        {
                return "1.1";
        }
}


HELP: mod_Namehere.java

At setItemName
this is the coding name not the ingame name



Creating a Food

This is the same as the item tutorial with some small tweaks

mod_Namehere

package net.minecraft.src;

public class mod_Namehere extends BaseMod
{
   public static Item Namehere;
   
   public String Version()
   {
      return "1.0.0";
   }
   
   public mod_Namehere()
   {
           
      Namehere.iconIndex = ModLoader.addOverride("/gui/items.png", "/Items/Namehere.png");
           
      ModLoader.AddName(Namehere, "Namehere");
   }
   
   static
   {
           new ItemFood(1000, 10, 1F, true).setItemName("1");
   }
}


HELP:
At new ItemFood(1000, 10, 1F, true
1000 is the id
10 is the amount of half hunger bars it fills
1F is the saturation level. It determines how long until your hunger bar will start to go down.
The boolean at the end is whether or not a wolf can eat it. Putting a 'true' here will allow it to be eaten by a wolf.



An Item That Spawns a Mob!


ItemNamehere

package net.minecraft.src;

import java.util.*;

public class ItemNamehere extends Item
{
    private World worldObj;
       
        public ItemNamehere (int i)
        {
                super(i);
                maxStackSize = 1;
        }
        public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k, int l)
    {
        if(!world.multiplayerWorld)
        {
                    ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Summoned a pig!");
            EntityLiving entityliving = (EntityLiving)EntityList.createEntityInWorld("Pig", entityplayer.worldObj);
                       
                        entityliving.setLocationAndAngles(i, j + 1, k, 0F, 0F);
            entityplayer.worldObj.entityJoinedWorld(entityliving);
                        entityplayer.swingItem();
        }
        return true;
    }
}


mod_Namehere

package net.minecraft.src;

public class mod_Namehere extends BaseMod
{
   public static Item Namehere;
   
   public String Version()
   {
      return "1.0.0";
   }
   
   public mod_Namehere()
   {
           
      Namehere.iconIndex = ModLoader.addOverride("/gui/items.png", "/Items/Namehere.png");
           
      ModLoader.AddName(Namehere, "Namehere");
           
      ModLoader.AddRecipe(new ItemStack(Namehere, 1), new Object[] {"###", "###", "###", Character.valueOf('#'), Item.seeds});
   }
   
   static
   {
           new Item(1000).setItemName("1");
   }
}


NOTE** The mod_Namehere isn't different then the Item tutorial only the ItemNamehere.java file is being altered

HELP: ItemNamehere.java

At ModLoader.getMinecraftInstance().thePlayer.addChatMessage("A pig has Spawned!")
this is the function that makes a message pop up on the screen


Advanced Block

This tutorial edits the BlockNamehere.java file

slipperiness = 1.5F;

it would go under
super(i, j, Material.ground);

Makes you run faster as long as your on that specific block, great for long distance travel

A Bouncy Block
public void onEntityWalking(World world, int x, int y, int z, Entity entity)
    {
            entity.motionY += 2.0;
    }


goes here
public int idDropped(int i, Random random)
    {
       return mod_Namehere.Namehere.blockID;
    }
        public void onEntityWalking(World world, int x, int y, int z, Entity entity)
    {
            entity.motionY += 2.0;
    }
    public int quantityDropped(Random random)
    {
            return 1;
    }
}




Transparent Block

        public boolean isOpaqueCube()
        {
                return true;
        }


set return true to false if you want the object transparent. Aka without you being able to see down into the rest of the world.



Slab Block

the mod_Namehere class will not be altered in this tutorial.

BlockNamehere

package net.minecraft.src;

import java.util.Random;

public class BlockNamehereSlab extends Block
{

protected BlockNamehereSlab(int i, int j)
{
super(i, j, Material.wood);
                setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
                setLightOpacity(255);
}

        public boolean isOpaqueCube()
        {
                return false;
        }

        public int idDropped(int i, Random random, int j)
        {
                return mod_Slab.Namehere.blockID;
        }

        public int quantityDropped(Random random)
        {
                return 1;
        }

        public boolean renderAsNormalBlock()
        {
                return false;
        }

        public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l)
        {
                if (this != Block.stairSingle)
                {
                        super.shouldSideBeRendered(iblockaccess, i, j, k, l);
                }
                if (l == 1)
                {
                        return true;
                }
                if (!super.shouldSideBeRendered(iblockaccess, i, j, k, l))
                {
                        return false;
                }
                if (l == 0)
                {
                        return true;
                }
                else
                {
                        return iblockaccess.getBlockId(i, j, k) != blockID;
                }
        }

}


setBlockBounds in the constructor of the block class is what makes you able to walk over it. 1F, 0.5F, and 1F are the length, height and width of the block, respectively.

The shouldSideBeRendered method is one that I can't seem to figure out. I have used the block with and without this code, next to stairs and such, but it doesn't seem to make a difference. I have left it in the tutorial in case someone does run into a few lighting issues when the block is next to stairs.



Creating a flower

The mod_Namehere file will not be altered, only the BlockNamehere.

BlockNamehere.java
add

public boolean isOpaqueCube()
        {
                return false;
        }

        public boolean renderAsNormalBlock()
        {
                return false;
        }

        public int getRenderType()
        {
                return 1;
        }


at the bottom of the block class, and then at the top where it extends make it extend BlockFlower.



Creating Armor

mod_Namehere

package net.minecraft.src;

import net.minecraft.client.Minecraft;

public class mod_Namehere extends BaseMod
{

    public mod_Namehere()
    {
        NamehereHelmet.iconIndex = ModLoader.addOverride("/gui/items.png", "/Armor/Nameherehelmet.png");
        NamehereBody.iconIndex = ModLoader.addOverride("/gui/items.png", "/Armor/Nameherebody.png");
        NamehereLegs.iconIndex = ModLoader.addOverride("/gui/items.png", "/Armor/Nameherelegs.png");
        NamehereBoots.iconIndex = ModLoader.addOverride("/gui/items.png", "/Armor/Namehereboots.png");
       
        ModLoader.AddName(NamehereHelmet, "Namehere Helmet");
        ModLoader.AddName(NamehereBody, "Namehere Chestplate");
        ModLoader.AddName(NamehereLegs, "Namehere Leggings");
        ModLoader.AddName(NamehereBoots, "Namehere Boots");
       
        ModLoader.AddRecipe(new ItemStack(NamehereHelmet, 1), new Object[] {"sss", "s s", "   ", Character.valueOf('s'), Item.seeds});
        ModLoader.AddRecipe(new ItemStack(NamehereBody, 1), new Object[] {"s s", "sss", "sss", Character.valueOf('s'), Item.seeds});
        ModLoader.AddRecipe(new ItemStack(NamehereLegs, 1), new Object[] {"sss", "s s", "s s", Character.valueOf('s'), Item.seeds});
        ModLoader.AddRecipe(new ItemStack(NamehereBoots, 1), new Object[] {"   ", "s s", "s s", Character.valueOf('s'), Item.seeds});
    }
   
    static
    {
        new ItemArmor(1000, 3, ModLoader.AddArmor("NamehereArmor"), 0).setItemName("1");
        new ItemArmor(1001, 3, ModLoader.AddArmor("NamehereArmor"), 1).setItemName("2");
        new ItemArmor(1002, 3, ModLoader.AddArmor("NamehereArmor"), 2).setItemName("3");
        new ItemArmor(1003, 3, ModLoader.AddArmor("NamehereArmor"), 3).setItemName("4");
    }

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

    public static Item NamehereHelmet;
    public static Item NamehereBody;
    public static Item NamehereLegs;
    public static Item NamehereBoots;

}


HELP:
At ("NamehereArmor"), 0))
the 0 is the type of armor

types 0-Helmet 1-Body 2-Legs 3-Boots



Adding Armor effects

put
ModLoader.SetInGameHook(this, true, false);
under all your recipes

add
public boolean OnTickInGame(Minecraft minecraft)
    {
        ItemStack boots = minecraft.thePlayer.inventory.armorInventory[0];
        ItemStack legs = minecraft.thePlayer.inventory.armorInventory[1];
        ItemStack chest = minecraft.thePlayer.inventory.armorInventory[2];
        ItemStack helm = minecraft.thePlayer.inventory.armorInventory[3];

        if(boots == null || legs == null || chest == null || helm == null)
        {
            return true;
        }
        if(boots.itemID == NamehereBoots.shiftedIndex && legs.itemID == NamehereLegs.shiftedIndex && chest.itemID == NamehereBody.shiftedIndex && helm.itemID == NamehereHelmet.shiftedIndex)
        {
           minecraft.thePlayer.air = minecraft.thePlayer.maxAir;
        }
                return true;
    }

into

ModLoader.AddRecipe(new ItemStack(NamehereBoots, 1), new Object[] {
            "   ", "r r", "r r", Character.valueOf('r'), Item.redstone
        });
                ModLoader.SetInGameHook(this, true, false);
    }
       
        public boolean OnTickInGame(Minecraft minecraft)
    {
        ItemStack boots = minecraft.thePlayer.inventory.armorInventory[0];
        ItemStack legs = minecraft.thePlayer.inventory.armorInventory[1];
        ItemStack chest = minecraft.thePlayer.inventory.armorInventory[2];
        ItemStack helm = minecraft.thePlayer.inventory.armorInventory[3];

        if(boots == null || legs == null || chest == null || helm == null)
        {
            return true;
        }
        if(boots.itemID == NamehereBoots.shiftedIndex && legs.itemID == NamehereLegs.shiftedIndex && chest.itemID == NamehereBody.shiftedIndex && helm.itemID == NamehereHelmet.shiftedIndex)
        {
           minecraft.thePlayer.air = minecraft.thePlayer.maxAir;
        }
                return true;
    }


at the bottom where it says minecraft.thePlayer.air = minecraft.thePlayer.maxAir;
you can change it to minecraft.thePlayer.isImmuneToFire = true;



Human NPC

EntityNamehere
package net.minecraft.src;

import java.util.Random;

public class EntityNamehere extends EntityCreature
{
    public EntityNamehere(World world)
    {
        super(world);
        texture = "/image.png";
        moveSpeed = 0.5F;
        attackStrength = 4; //take this line out if this class doesn't extend EntityMob.
    }

    public int getMaxHealth()
    {
        return 20;
    }

    protected String getLivingSound()
    {
        return "mob.villager.default";
    }

    protected String getHurtSound()
    {
        return "mob.villager.defaulthurt";
    }

    protected String getDeathSound()
    {
        return "mob.villager.defaultdeath";
    }

    protected int getDropItemId()
    {
        return Item.ingotIron.shiftedIndex;
    }
       
        protected boolean canDespawn()
        {
                return false;
        }

}



mod_Namehere
package net.minecraft.src;

import java.util.Map;

public class mod_HumanNPC extends BaseMod
{
       
        public void load()
        {       
                ModLoader.RegisterEntityID(EntityNamehere.class, "In-gameEntityName", ModLoader.getUniqueEntityId());
        ModLoader.AddSpawn(EntityNamehere.class, 12, 14, 18, EnumCreatureType.creature);
        }
       
        public void AddRenderer(Map map)
    {
                map.put(EntityNamehere.class, new RenderBiped(new ModelBiped(), 0.5F));
    }
       
        public String getVersion()
        {
                return "1.1";
        }

}


[color=green



Sugar-Cane Like block

This tutorial is more difficult and i'm not the best with these kinds of mods I might not be able to help as much
mod_Namehere

package net.minecraft.src;

import java.util.Random;

public class mod_Namehere extends BaseMod
{

    public mod_Namehere()
    {
        ModLoader.RegisterBlock(Namehere);
        ModLoader.AddName(Namehere, "Namehere");
        ModLoader.AddRecipe(new ItemStack(Item.redstone, 3), new Object[] {
            "#", Character.valueOf('#'), Namehere
        });
    }

    public void GenerateSurface(World world, Random random, int i, int j)
    {
        if(random.nextInt(20) == 0)
        {
            for(int k = 0; k < 16; k++)
            {
                for(int l = 0; l < 16; l++)
                {
                    int i1 = random.nextInt(200);
                    if(world.getBlockId(i + l, i1, j + k) != Block.grass.blockID || !world.isAirBlock(i + l, i1 + 1, j + k))
                    {
                        continue;
                    }
                    int j1 = random.nextInt(2);
                    if(j1 == 0)
                    {
                        world.setBlock(i + l, i1 + 1, j + k, Namehere.blockID);
                    }
                    if(j1 == 1)
                    {
                        world.setBlock(i + l, i1 + 1, j + k, Namehere.blockID);
                        world.setBlock(i + l, i1 + 2, j + k, Namehere.blockID);
                    }
                    if(j1 == 2)
                    {
                        world.setBlock(i + l, i1 + 1, j + k, Namehere.blockID);
                        world.setBlock(i + l, i1 + 2, j + k, Namehere.blockID);
                        world.setBlock(i + l, i1 + 3, j + k, Namehere.blockID);
                    }
                                        if(j1 == 3)
                    {
                        world.setBlock(i + l, i1 + 1, j + k, Namehere.blockID);
                        world.setBlock(i + l, i1 + 2, j + k, Namehere.blockID);
                        world.setBlock(i + l, i1 + 3, j + k, Namehere.blockID);
                                                world.setBlock(i + l, i1 + 4, j + k, Namehere.blockID);
                    }
                }

            }

        }
    }

    public String Version()
    {
        return "1.7.3";
    }

    public static Block Namehere = (new BlockNamehere(124, ModLoader.addOverride("/terrain.png", "/Namehere.png"))).setHardness(0.0F).setResistance(0.0F).setBlockName("Namehere");

}


BlockNamehere

package net.minecraft.src;

import java.util.Random;

public class BlockNamehere extends Block
{

    protected BlockNamehere(int i, int j)
    {
        super(i, Material.plants);
        blockIndexInTexture = j;
        float f = 0.375F;
        setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 1.0F, 0.5F + f);
        setTickOnLoad(true);
    }

    public void updateTick(World world, int i, int j, int k, Random random)
    {
        if(world.isAirBlock(i, j + 1, k))
        {
            int l;
            for(l = 1; world.getBlockId(i, j - l, k) == blockID; l++) { }
            if(l < 3)
            {
                int i1 = world.getBlockMetadata(i, j, k);
                if(i1 == 15)
                {
                    world.setBlockWithNotify(i, j + 1, k, blockID);
                    world.setBlockMetadataWithNotify(i, j, k, 0);
                } else
                {
                    world.setBlockMetadataWithNotify(i, j, k, i1 + 1);
                }
            }
        }
    }

    public boolean canPlaceBlockAt(World world, int i, int j, int k)
    {
        int l = world.getBlockId(i, j - 1, k);
        if(l == blockID)
        {
            return true;
        }
        return l == Block.grass.blockID || l == Block.dirt.blockID;
    }

    public void onNeighborBlockChange(World world, int i, int j, int k, int l)
    {
        checkBlockCoordValid(world, i, j, k);
    }

    protected final void checkBlockCoordValid(World world, int i, int j, int k)
    {
        if(!canBlockStay(world, i, j, k))
        {
            dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k));
            world.setBlockWithNotify(i, j, k, 0);
        }
    }

    public boolean canBlockStay(World world, int i, int j, int k)
    {
        return canPlaceBlockAt(world, i, j, k);
    }

    public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k)
    {
        return null;
    }

    public int idDropped(int i, Random random)
    {
        return mod_Namehere.Namehere.blockID;
    }

    public boolean isOpaqueCube()
    {
        return false;
    }

    public boolean renderAsNormalBlock()
    {
        return false;
    }

    public int getRenderType()
    {
        return 1;
    }
}


Help: mod_Namehere

At
 if(j1 == 1)
                    {
                        world.setBlock(i + l, i1 + 1, j + k, Namehere.blockID);
                        world.setBlock(i + l, i1 + 2, j + k, Namehere.blockID);
                    } 

if you want it to grow more then add extra lines and just +1 more
like this

 world.setBlock(i + l, i1 + 3, j + k, Namehere.blockID);
world.setBlock(i + l, i1 + 4, j + k, Namehere.blockID);


Help: BlockNamehere

At
public boolean canPlaceBlockAt(World world, int i, int j, int k)
    {
        int l = world.getBlockId(i, j - 1, k);
        if(l == blockID)
        {
            return true;
        }
        return l == Block.grass.blockID || l == Block.dirt.blockID;


you can change or add more blocks that it can spawn on



Custom Tools!

mod_Namehere

package net.minecraft.src;

import net.minecraft.client.Minecraft;

public class mod_Namehere extends BaseMod
{

    public mod_Namehere()
    {
        NameherePickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/Tools/Nameherepick.png");
        NamehereShovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/Tools/Nameherespade.png");
        NamehereAxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/Tools/Namehereaxe.png");
        NamehereHoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/Tools/Nameherehoe.png");
        NamehereSword.iconIndex = ModLoader.addOverride("/gui/items.png", "/Tools/Nameheresword.png");
       
        ModLoader.AddName(NameherePickaxe, "Namehere Pickaxe");
        ModLoader.AddName(NamehereShovel, "Namehere Shovel");
        ModLoader.AddName(NamehereAxe, "Namehere Axe");
        ModLoader.AddName(NamehereHoe, "Namehere Hoe");
        ModLoader.AddName(NamehereSword, "Namehere Sword");
       
        ModLoader.AddRecipe(new ItemStack(NameherePickaxe, 1), new Object[] {"sss", " | ", " | ", Character.valueOf('s'), Item.seeds, Character.valueOf('|'), Item.stick});
        ModLoader.AddRecipe(new ItemStack(NamehereShovel, 1), new Object[] {" s ", " | ", " | ", Character.valueOf('s'), Item.seeds, Character.valueOf('|'), Item.stick});
        ModLoader.AddRecipe(new ItemStack(NamehereAxe, 1), new Object[] {"ss ", "s| ", " | ", Character.valueOf('s'), Item.seeds, Character.valueOf('|'), Item.stick});
        ModLoader.AddRecipe(new ItemStack(NamehereHoe, 1), new Object[] {"ss ", " | ", " | ", Character.valueOf('s'), Item.seeds, Character.valueOf('|'), Item.stick});
        ModLoader.AddRecipe(new ItemStack(NamehereSword, 1), new Object[] {" s ", " s ", " | ", Character.valueOf('s'), Item.seeds, Character.valueOf('|'), Item.stick});
        }
    static
    {
        new ItemPickaxe(1000, EnumToolMaterial.EMERALD).setItemName("1");
        new ItemSpade(1001, EnumToolMaterial.EMERALD).setItemName("2");
        new ItemAxe(1002, EnumToolMaterial.EMERALD).setItemName("3");
        new ItemHoe(1003, EnumToolMaterial.EMERALD).setItemName("4");
        new ItemSword(1004, EnumToolMaterial.EMERALD).setItemName("5");
    }

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

    public static Item NameherePickaxe;
    public static Item NamehereShovel;
    public static Item NamehereAxe;
    public static Item NamehereHoe;
    public static Item NamehereSword;

}

This is just like making an item except you dont need to make ItemNamehere.java files!

now for the only difficult part. find EnumToolMaterial.java file and open it up

at the top where it says
WOOD("WOOD", 0, 0, 59, 2.0F, 0, 15),
STONE("STONE", 1, 1, 131, 4F, 1, 5),
IRON("IRON", 2, 2, 250, 6F, 2, 14),
EMERALD("EMERALD", 3, 3, 1561, 8F, 3, 10),
GOLD("GOLD", 4, 0, 32, 12F, 0, 22);


delete the ; after the Gold line and put a comma there

for a new material
Namehere("NAMEHERE", 5, #, ##, #F, #, ###);
# = 0 means it can only mine stone/coal, 1 means iron, 2 means gold/diamond/redstone/lupis, 3 means obsidian
## = how many uses
#F = How strong it is against ores
### = not sure XD put the same number as emerald (aka diamond)


Making a Sword Catch Mobs on Fire!
Add
public boolean hitEntity(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1)
    {
        entityliving.fire=300;
          return false;
    }

to you ItemNamehere.java file


Making an Ore Generate

mod_Namehere
public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
    {
        for(int i = 0; i < Rarity; i++)
        {
            int randPosX = chunkX + rand.nextInt(16);
            int randPosY = rand.nextInt(Height);
            int randPosZ = chunkZ + rand.nextInt(16);
            (new WorldGenMinable(mod_Namehere.Namehere.blockID, Vein Size)).generate(world, rand, randPosX, randPosY, randPosZ);
        }
    } 

goes in after
public String Version()
{
return "1.0.0";
}




How to give foods a potion effect

Applying a potion effect to a food. This is very easy to do. You simply make a food(follow the tutorial above), and add this bit of code to it
.setPotionEffect(Potion.hunger.id, 30, 0, 0.8F)


so it would fit in like this:
public static final Item Namehere = new ItemFood(5001, 4, 1F, false).setPotionEffect(Potion.hunger.id, 30, 0, 1F).setItemName("anynamehere");


Note that .setPotionEffect MUST go before .setItemName otherwise you will get recompilation errors. I use the hunger potion in this example, which is what is used in rotten flesh. You can use any potion effect when doing this. They are all listed in Potion.java. I'm not sure what the 0 means, but the 30 is the time the effect lasts for. An int of 20 here lasts for 6 seconds, so 30 is about 9 seconds. The float(1F) is the chance of the potion being successful. Rotten flesh has 0.8F here, and it has an 80% chance of giving you food poisoning. Having 1F in this position should be a 100% success rate.



Editing the Start Menu


Do you want to make your Minecraft Menu look like this?
[ Register or Signin to view external links. ]

1. Open Minecraft.jar and open the lang folder and open en_US.lang

gui.done=Done
gui.cancel=Cancel
gui.toMenu=Back to title screen
gui.up=Up
gui.down=Down
gui.yes=Yes
gui.no=No

menu.singleplayer=Singleplayer
menu.multiplayer=Multiplayer
menu.mods=Texture Packs
menu.options=Options...
menu.quit=Quit


Now you can edit the text after the .

and for the text color [ Register or Signin to view external links. ]

use
4 for Red
c for Rose
6 for Gold
e for Yellow
2 for Green
a for Lightgreen
b for Lightblue
3 for Cyan
1 for Navy
9 for Blue
d for Lightpurple
5 for Purple
f for White
7 for Lightgray
8 for Gray
0 for Black


Credit to Lot and his post Forums/t=2630396/how-to-edit-the-...t-tut.html

I have permission for putting taking his tutorial



Video Tutorials

Credit to TheInstituion for the videos

Create a Biome


Potion Effected Food


Make A New Liquid


Structure Generation


Create/Generate A Tree


Create A New Sapling


Nether Generation



PLEASE COMMENT AND RATE


Last edited by Odin ; edited 66 times in total

The following 11 users thanked Odin for this useful post:

AR15 (02-20-2013), oTTGwKo (08-16-2012), FUT-Reiss (05-27-2012), mitchh2012 (04-26-2012), Scratched (04-26-2012), Mythic- (04-10-2012), jackis2cool (02-23-2012), vitalikb1 (02-21-2012), 311 (02-17-2012), Extricate (02-01-2012), Nicomang (12-03-2011)
#2. Posted:
Odin
  • TTG Addict
Status: Offline
Joined: Dec 23, 201013Year Member
Posts: 2,446
Reputation Power: 80
Status: Offline
Joined: Dec 23, 201013Year Member
Posts: 2,446
Reputation Power: 80
no feedback? took like an hour to type everything... positive feedback would be appreciated
#3. Posted:
TTG-QuuZ
  • New Member
Status: Offline
Joined: May 31, 201113Year Member
Posts: 34
Reputation Power: 1
Status: Offline
Joined: May 31, 201113Year Member
Posts: 34
Reputation Power: 1
Nice work 1 less skid in the world
#4. Posted:
-Afro-
  • TTG Addict
Status: Offline
Joined: Aug 11, 201113Year Member
Posts: 2,028
Reputation Power: 111
Status: Offline
Joined: Aug 11, 201113Year Member
Posts: 2,028
Reputation Power: 111
TTG-QuuZ wrote Nice work 1 less skid in the world


Hmm someone who is a skid taking my line? strange.

Anyway Sack you seem pretty chill, know what you are talking about ill add you <3 Do you have skype?
#5. Posted:
Odin
  • Christmas!
Status: Offline
Joined: Dec 23, 201013Year Member
Posts: 2,446
Reputation Power: 80
Status: Offline
Joined: Dec 23, 201013Year Member
Posts: 2,446
Reputation Power: 80
-Afro- wrote
TTG-QuuZ wrote Nice work 1 less skid in the world


Hmm someone who is a skid taking my line? strange.

Anyway Sack you seem pretty chill, know what you are talking about ill add you <3 Do you have skype?

yea IOwnAPC and thanks
#6. Posted:
Odin
  • Christmas!
Status: Offline
Joined: Dec 23, 201013Year Member
Posts: 2,446
Reputation Power: 80
Status: Offline
Joined: Dec 23, 201013Year Member
Posts: 2,446
Reputation Power: 80
UPDATE* Added Tools, Armor Effects, Armor and Advanced blocks

Working on Generating Ore and Tree
#7. Posted:
Odin
  • TTG Addict
Status: Offline
Joined: Dec 23, 201013Year Member
Posts: 2,446
Reputation Power: 80
Status: Offline
Joined: Dec 23, 201013Year Member
Posts: 2,446
Reputation Power: 80
so no one wants to make mods or anything? Should i stop making more tuts?
#8. Posted:
Comb
  • Resident Elite
Status: Offline
Joined: Jul 28, 200915Year Member
Posts: 260
Reputation Power: 5
Status: Offline
Joined: Jul 28, 200915Year Member
Posts: 260
Reputation Power: 5
would ore generation work in smp?
#9. Posted:
Odin
  • Christmas!
Status: Offline
Joined: Dec 23, 201013Year Member
Posts: 2,446
Reputation Power: 80
Status: Offline
Joined: Dec 23, 201013Year Member
Posts: 2,446
Reputation Power: 80
Comb wrote would ore generation work in smp?

no you cant make custom items/blocks/ore pop up in SMP from what i know (might have changed since i last checked)

check bukkit.org plugins then might have a plugin for it
#10. Posted:
Nicomang
  • New Member
Status: Offline
Joined: Dec 02, 201112Year Member
Posts: 5
Reputation Power: 0
Status: Offline
Joined: Dec 02, 201112Year Member
Posts: 5
Reputation Power: 0
I tried to create a new block called a crate, just to try out a tutorial of yours. It got an error that I don't understand:
...mod_newCrates is not abstract and does not override abstract method load() in BaseMod public class mod_newCrates extends BaseMod.
The code for the .java file in src called mod_newCrates:

package net.minecraft.src;

public class mod_newCrates extends BaseMod
{
public static Block Crate = new BlockCrate(7254, 0).setHardness(1.0F).setResistance(9.0F).setLightValue(0.0F).setBlockName("Crate");

public String Version()
{
return "1.0";
}

public mod_newCrates()
{
ModLoader.RegisterBlock(Crate);
Crate.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/crate.png");
ModLoader.AddName(Crate, "Crate");
ModLoader.AddRecipe(new ItemStack(Crate, 1), new Object[] {
"##", "##", Character.valueOf('#'), Block.wood
});
}
}

The code for the BlockCrate .java file:
package net.minecraft.src;

import java.util.Random;

public class BlockCrate extends Block
{

public BlockCrate(int i, int j)
{
super(i, j, Material.wood);
}
public int idDropped(int i, Random random)
{
return mod_newCrates.Crate.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
}

I was hoping maybe you could help me with this error. These tutorials look awesome, and I can't wait to get some to work. I haven't found any up to date 1.0 tutorials that are decent besides these; if I get this to work. The other tutorials I've found aren't as up-to-date. I hope you can help, and keep making tutorials. If you do, I'll show a few of my friends this so we can make some cool mods. I really do hope you keep creating them, I just think people haven't seen this post. Try putting this on Minecraft forums or planet Minecraft? Also, I am wondering if you could make a mob tutorial, or maybe something for the nether? Maybe even another dimension? I have trouble with Java, because I am pretty new, so I can't really create my own mods. I hope you take one of these things into consideration!

-Thanks
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.