Ok we will need the basic mod_Namehere and the EntityNamehere from the basic human mob tutorial but change them a bit. So mod_Namehere would change to:
package net.minecraft.src;
public class mod_Namehere extends BaseMod
{
public String getVersion()
{
return "1.0.0";
}
public mod_Namehere()
{
ModLoader.RegisterEntityID(EntityNamehere.class, "Namehere", 117);
}
public void load()
{
}
public void AddRenderer(Map map)
{
map.put(EntityNamehere.class, new RenderNamehere(new ModelNamehere(), 0.5F));
}
}
So what you want to do is change all of the Namehere's to the name of your mod n mob stuff, and do most of the things you did in the human mob tutorial.
The EntityNamehere stays the same from the first tutorial so heres the code for it:
package net.minecraft.src;
public class EntityNameHere extends EntityAnimal
{
public EntityNamehere(World world)
{
super(world);
texture = "/tutorial/Namehere.png";
moveSpeed = 0.5F;
}
public void writeEntityToNBT(NBTTagCompound nbttagcompound)
{
super.writeEntityToNBT(nbttagcompound); // this saves the mob to disk, so it can be loaded later
}
public void readEntityFromNBT(NBTTagCompound nbttagcompound)
{
super.readEntityFromNBT(nbttagcompound); // this retrieves saved data about the mob from the hard drive
}
protected boolean canDespawn()
{
return false;
}
protected int getDropItemId()
{
return 0;
}
public int getMaxHealth()
{
return 12;
}
protected EntityAnimal func_40145_a(EntityAnimal entityanimal)
{
return new EntityNamehere(worldObj);
}
}
Do the same as you did in the human mob tutorial.
Now we need a RenderNamehere and a ModelNamehere, we can generate the ModelNamehere from our techne model, so load up your save in techne, goto file - export as - java and export it to somewhere where you know you can find it, then move it in with the rest of your files.
Warning: The exporting may not be perfect so go into the Model file and see if theres any errors.
My Model file would be:
// Date: 2/14/2012 8:58:40 AM
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX
package net.minecraft.src;
public class ModelNamehere extends ModelBase
{
//fields
ModelRenderer head;
ModelRenderer body;
ModelRenderer rightleg;
ModelRenderer leftleg;
ModelRenderer neck;
ModelRenderer beak1;
ModelRenderer neck;
ModelRenderer beak1;
ModelRenderer tail;
ModelRenderer eye1;
ModelRenderer eye1;
public ModelNamehere()
{
textureWidth = 64;
textureHeight = 32;
head = new ModelRenderer(this, 0, 0);
head.addBox(-4F, -8F, -4F, 5, 5, 5);
head.setRotationPoint(1.5F, 1F, -12F);
head.setTextureSize(64, 32);
head.mirror = true;
setRotation(head, 0F, 0F, 0F);
body = new ModelRenderer(this, 22, 12);
body.addBox(-4F, 0F, -2F, 9, 8, 12);
body.setRotationPoint(-0.5F, 4F, -7.5F);
body.setTextureSize(64, 32);
body.mirror = true;
setRotation(body, 0F, 0F, 0F);
rightleg = new ModelRenderer(this, 0, 16);
rightleg.addBox(-2F, 0F, -2F, 3, 12, 3);
rightleg.setRotationPoint(-2F, 12F, -2F);
rightleg.setTextureSize(64, 32);
rightleg.mirror = true;
setRotation(rightleg, 0F, 0F, 0F);
leftleg = new ModelRenderer(this, 0, 16);
leftleg.addBox(-2F, 0F, -2F, 3, 12, 3);
leftleg.setRotationPoint(3F, 12F, -2F);
leftleg.setTextureSize(64, 32);
leftleg.mirror = true;
setRotation(leftleg, 0F, 0F, 0F);
neck = new ModelRenderer(this, 36, 0);
neck.addBox(0F, 0F, 0F, 4, 4, 6);
neck.setRotationPoint(-2F, 0F, -10.8F);
neck.setTextureSize(64, 32);
neck.mirror = true;
setRotation(neck, -0.7853982F, 0F, 0F);
beak1 = new ModelRenderer(this, 0, 10);
beak1.addBox(0F, 0F, 0F, 3, 1, 3);
beak1.setRotationPoint(-1.5F, -4F, -19F);
beak1.setTextureSize(64, 32);
beak1.mirror = true;
setRotation(beak1, 0F, 0F, 0F);
neck = new ModelRenderer(this, 20, 0);
neck.addBox(0F, 0F, 0F, 4, 6, 4);
neck.setRotationPoint(-2F, -2.4F, -15.7F);
neck.setTextureSize(64, 32);
neck.mirror = true;
setRotation(neck, 0.3926991F, 0F, 0F);
beak1 = new ModelRenderer(this, 0, 10);
beak1.addBox(0F, 0F, 0F, 3, 1, 3);
beak1.setRotationPoint(-1.5F, -3.2F, -19F);
beak1.setTextureSize(64, 32);
beak1.mirror = true;
setRotation(beak1, -0.0349066F, 0F, 0F);
tail = new ModelRenderer(this, 12, 10);
tail.addBox(0F, 0F, 0F, 8, 7, 3);
tail.setRotationPoint(-4F, 4.8F, 2F);
tail.setTextureSize(64, 32);
tail.mirror = true;
setRotation(tail, 0F, 0F, 0F);
eye1 = new ModelRenderer(this, 56, 0);
eye1.addBox(-1F, -1F, -0.5F, 2, 2, 1);
eye1.setRotationPoint(-1.3F, -5F, -15.8F);
eye1.setTextureSize(64, 32);
eye1.mirror = true;
setRotation(eye1, 0F, 0.1963495F, 0F);
eye1 = new ModelRenderer(this, 56, 0);
eye1.addBox(-1F, -1F, -0.5F, 2, 2, 1);
eye1.setRotationPoint(1.3F, -5F, -15.8F);
eye1.setTextureSize(64, 32);
eye1.mirror = true;
setRotation(eye1, 0F, -0.1963495F, 0F);
}
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
{
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5);
head.render(f5);
body.render(f5);
rightleg.render(f5);
leftleg.render(f5);
neck.render(f5);
beak1.render(f5);
neck.render(f5);
beak1.render(f5);
tail.render(f5);
eye1.render(f5);
eye1.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
{
super.setRotationAngles(f, f1, f2, f3, f4, f5);
}
}
The RenderNamehere is simple, ill give it to you:
public class RenderNamehere extends RenderLiving
{
public RenderNamehere(ModelBase modelbase, float f)
{
super(modelbase, f);
}
public void renderCow(EntityNamehere entitynamehere, double d, double d1, double d2,
float f, float f1)
{
super.doRenderLiving(entitynamehere, d, d1, d2, f, f1);
}
public void doRenderLiving(EntityLiving entityliving, double d, double d1, double d2,
float f, float f1)
{
renderCow((EntityNamehere)entityliving, d, d1, d2, f, f1);
}
public void doRender(Entity entity, double d, double d1, double d2,
float f, float f1)
{
renderCow((EntityNamehere)entity, d, d1, d2, f, f1);
}
}
All you have to do is change the Namehere's and nothing else.
That should give you a working custom mob, thats for taking the time to view this tutorial.