Guide to make a simple mob (MCP)

PLEASE NOTICE: Wow, this simple tutorial has brought the whole Minecraft modding community to a new generation full of human mobs. Every time I look back at this, I see how much I have changed the community, and I feel very happy. This tutorial is very outdated, however. But now, look around, everyone knows how to create a human mob. Get help from one of today's modders on how to make a human mob. I have quit modding since, and I thank everybody for their support while I was a modder. I might never return to modding, but who knows? I probably will in 1.7! ~Club559 (June 21, 2011)
Before testing your results, download (required):
Risugami's ModLoader
303's SpawnList
Tutorial files (required)
In this tutorial I will teach you how to make a simple mob in the shape of a person. This tutorial will not include how to model, neither does it use a model.
First, download all of the listed above. Get out your tutorial folder and go to the sources. Copy all of the sources over to your MCP source folder (decompile unmodified minecraft.jar before doing this). The EntityList is just a fix for the private function MCP converts it to, so copy that to your sources too.
Open up EntityPigman.java.
package net.minecraft.src;
public class EntityPigman extends EntityCreature
{
public EntityPigman(World world)
{
super(world);
//This is the texture for your mob
texture = "/mob/mymob.png";
}
protected int getDropItemId()
{
//This is the item your mob will drop
return Item.porkCooked.shiftedIndex;
}
}
Replace all "Pigman" with the name of your mob. Then, replace "mymob" with the name of your mob. After that, change "porkCooked" to the new name of your item. If you want it to drop a block...
return Block.nameofblock.blockID;Replace "nameofblock" with the name of the block. NOTE: You will have to look inside Item.java and Block.java to see the names of these.
Rename EntityPigman.java to fit your new mob.
Open up mod_Pigman.java.
package net.minecraft.src;
import java.lang.reflect.Method;
public class mod_Pigman extends BaseMod
{
public mod_Pigman()
{
}
public String Version()
{
return "1.2_02";
}
public void AddEntityID()
{
//This defines your entity. Class name, entity
name, and then the entity ID.
EntityList.addMapping(EntityPigman.class,
"Pigman", ModLoader.getUniqueEntityId());
//This adds your mob to the spawn list.
spawnlist.addCreaturesToSpawnList("Surface
biomes", EntityPigman.class);
}
}
Again, replace all "Pigman" with the name of your mob, and replace "Surface biomes" with the biome of your needs. For everywhere (like a normal mob), use Surface biomes. If you want a different one, check spawnlist.java for the list of biomes available.
Rename mod_Pigman to suit your new mob.
You are close to being done. Now just open the folder "Texture for minecraft.jar" in your tutorial files, open "mob", and replace mymob.png with the player skin that you would like. Also rename it to what you did on EntityPigman on this line:
texture = "/mob/mymob.png"
Once you have done that, compile the following:
mod_[MobName]
Entity[MobName]
After that, you are done with your mob!
If you get an error, make sure you did everything correctly.
EDIT: Thanks to everyone who told me to move the spawning to mod_Pigman instead of adding mod_SpawnPigman, and someone also confirms this makes it compatible with Mo' Creatures. If you followed this tutorial before, update your mods!
















