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
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!
Nice work! I've never delved into the world of modding in Minecraft and even I could understand most of that coding! I'm sure this will create a massive increase in mob mods!
Added a fix for the EntityList problem. addMapping is a private function in the source, so I made it public. Make sure to copy that over or you'll have problems compiling.
Hello, thank you very much for the guide, I understand the code used, but I want to know if exist any tool to edit the image, I do not understand how to edit the parts for a new mob bigger or smaller, can you help me? thanks.
1- Recompiling. Do I use the recompile.bat file from MCP? If so, where are my three new classes?
2- Do I need to run reobf.bat to re-obfuscate the classes? I did try that and entered the class names in the conf\client_obfuscation.txt file, but i didn't get any class output in the final_out folder
I have decompiled a virgin 1.2.6 minecraft.jar file as you said before going through your tutorial - please help this n0000b!
First of all, run recompile.bat. After that, run reobf.bat. If it says stuff below "Obfuscating client" other than "Obfuscating server", check your minecraft_compile.log and search for "^".
Ok, I decided to make a new skin for the mob, but I have no idea as to where I need to put it. Do I just leave it in the '\Texture for Minecraft.jar\mob\mymob.png' but in the src folder? Or do I need to put it elsewhere?
Ok, I decided to make a new skin for the mob, but I have no idea as to where I need to put it. Do I just leave it in the '\Texture for Minecraft.jar\mob\mymob.png' but in the src folder? Or do I need to put it elsewhere?
You put the png into your "mob" folder in minecraft.jar.
You don't need to do anything special to make it work with MCP.
Looks awesome.
Could you edit this slightly to be useful to persons without much knowledge of Java. I think that I could probably get on well if you explained the beginning part more thoroughly because I am trying to learn Java and I think that this could help. Edit: specifically the decompiling part, but other parts too.
Also, qq:
Will you be making more of these such as ones that show how to model, increasing in difficulty? that would be awesome.
This is what I did: I don't get where I was supposed to put my new 'boxman.png' (Boxman was going to be my mob, based on my skin) so I guessed I could put it in minecraft.jar after I'd compiled. What I did so far then: 1. Take .java files from tutorial thing and put them in sources\minecraft\net\minecraft\src in my MCP folder after decompiling. 2. Change every pigman text to boxman!
I then went to recompile (don't worry, I had JDK :Sheep:) but it complained about not being able to find javac.exe :sad.gif: I had it in path and stuff, but I tried everything like putting javac.exe in the MCP folder, running as admin and stuff.
Do you also have the PATH variable set, and JRE installed with its PATH variable set?
This is what I did: I don't get where I was supposed to put my new 'boxman.png' (Boxman was going to be my mob, based on my skin) so I guessed I could put it in minecraft.jar after I'd compiled. What I did so far then: 1. Take .java files from tutorial thing and put them in sources\minecraft\net\minecraft\src in my MCP folder after decompiling. 2. Change every pigman text to boxman!
I then went to recompile (don't worry, I had JDK :Sheep:) but it complained about not being able to find javac.exe :sad.gif: I had it in path and stuff, but I tried everything like putting javac.exe in the MCP folder, running as admin and stuff.
Do you also have the PATH variable set, and JRE installed with its PATH variable set?
This is what I did: I don't get where I was supposed to put my new 'boxman.png' (Boxman was going to be my mob, based on my skin) so I guessed I could put it in minecraft.jar after I'd compiled. What I did so far then: 1. Take .java files from tutorial thing and put them in sources\minecraft\net\minecraft\src in my MCP folder after decompiling. 2. Change every pigman text to boxman!
I then went to recompile (don't worry, I had JDK :Sheep:) but it complained about not being able to find javac.exe :sad.gif: I had it in path and stuff, but I tried everything like putting javac.exe in the MCP folder, running as admin and stuff.
Do you also have the PATH variable set, and JRE installed with its PATH variable set?
Well, if JRE is the same as JDK,yes, I had Java Runtime Environment, which is just plain java right? I set path by right clicking 'computer' on the start menu, then 'properties', then 'Advanced system settings', then 'Environment Variables' then scrolled to 'path' above 'pathext' and clicked it, then clicked 'edit' and added this at the end: Wait, it's gone? I thought I had it there..... Anyway, I added ;C:\Program Files\Java\jdk1.6.0_23\bin\javac.exe and then hit OK, OK, and OK. It'll probably work now, or it will delete ;C:\Program Files\Java\jdk1.6.0_23\bin\javac.exe again.
EDIT: Forgot to mention that at first it said 'C:/users/******/minecraft' isn't a something (something like command or program), so I copied minecraft.exe there and now it boots minecraft when I run it before the error....
Was having the same problem but I figured it out. Just link to the bin, not the javac.exe
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.
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...
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.
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:
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!
With this and the help of spawnlists, we can now have many new mobs added to the game
Sorry for my bad english >_<!
1- Recompiling. Do I use the recompile.bat file from MCP? If so, where are my three new classes?
2- Do I need to run reobf.bat to re-obfuscate the classes? I did try that and entered the class names in the conf\client_obfuscation.txt file, but i didn't get any class output in the final_out folder
I have decompiled a virgin 1.2.6 minecraft.jar file as you said before going through your tutorial - please help this n0000b!
EDIT:Uh... NVM... It's working now...
wtf
You put the png into your "mob" folder in minecraft.jar.
You don't need to do anything special to make it work with MCP.
Could you edit this slightly to be useful to persons without much knowledge of Java. I think that I could probably get on well if you explained the beginning part more thoroughly because I am trying to learn Java and I think that this could help.
Edit: specifically the decompiling part, but other parts too.
Also, qq:
Will you be making more of these such as ones that show how to model, increasing in difficulty? that would be awesome.
Thanks,
<stringofnumbers>
Now, how did the person make it compatible with Mo' Creatures? Can you do a short tutorial specifically on that? I'm not so good with it.
Do you also have the PATH variable set, and JRE installed with its PATH variable set?
In the quote he says he does. he does.
Was having the same problem but I figured it out. Just link to the bin, not the javac.exe