MC Modding
Please register and join the community!

[1.8.1] Custom Mob

View previous topic View next topic Go down

[1.8.1] Custom Mob

Post by Strengthowns on Sun Oct 16, 2011 7:10 am

Custom Mob
For this tutorial, you will need to use a program called "Techne" which generates the hardest files for you. See other tutorials on how to use techne.
Spoiler:

mod_Namehere
Code:
package net.minecraft.src;
 
import java.lang.reflect.Method;
import java.util.*;
 
public class mod_Namehere extends BaseMod

    public mod_Namehere()
    {
        ModLoader.RegisterEntityID(EntityNamehere.class, "Namehere", ModLoader.getUniqueEntityId());         
        ModLoader.AddSpawn(net.minecraft.src.EntityNamehere.class, 9, 10, 20, EnumCreatureType.creature);
    }
   
    public void AddRenderer(Map map)
    {
        map.put(net.minecraft.src.EntityNamehere.class, new RenderNamehere(new ModelNamehere(), 0.5F));
    }
 
    public String Version()
    {
        return "1.8.1";
    }
 
}


EntityNamehere
Code:
package net.minecraft.src;
 
public class EntityNamehere extends EntityCreature
{
 
    public EntityNamehere(World world)
    {
        super(world);
        texture = "/mob/Namehere.png";
        setSize(1.5F, 1.9F);
    }
 
    public void writeEntityToNBT(NBTTagCompound nbttagcompound)
    {
        super.writeEntityToNBT(nbttagcompound);
    }
 
    public void readEntityFromNBT(NBTTagCompound nbttagcompound)
    {
        super.readEntityFromNBT(nbttagcompound);
    }
 
    protected String getLivingSound()
    {
        return null;
    }
 
    protected String getHurtSound()
    {
        return null;
    }
 
    protected String getDeathSound()
    {
        return null;
    }
 
    protected float getSoundVolume()
    {
        return 0.4F;
    }
 
    protected int getDropItemId()
    {
        return 54;
    }
}


RenderNamehere
Code:
package net.minecraft.src;

public class RenderNamehere extends RenderLiving
{
 
    public RenderNamehere(ModelBase modelbase, float f)
    {
        super(modelbase, f);
    }
 
    public void renderNamehere(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)
    {
        renderNamehere((EntityNamehere)entityliving, d, d1, d2, f, f1);
    }
 
    public void doRender(Entity entity, double d, double d1, double d2, float f, float f1)
    {
        renderNamehere((EntityNamehere)entity, d, d1, d2, f, f1);
    }
}


ModelNamehere
Code:
package net.minecraft.src;

public class ModelNamehere extends ModelBase
{
      public ModelNamehere()
      {
        Body = new ModelRenderer(this, 0, 0);
        Body.addBox(-8F, -8F, -8F, 16, 16, 16);
        Body.setRotationPoint(0F, 16F, 0F);
        Body.rotateAngleX = 0F;
        Body.rotateAngleY = 0F;
        Body.rotateAngleZ = 0F;
        Body.mirror = false;
      }

      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);
        Body.render(f5);
      }

      public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
      {
        super.setRotationAngles(f, f1, f2, f3, f4, f5);
      }

        ModelRenderer Body;
}

Help: mod_Namehere

1. Same as normal, read the "Human NPC" tutorial for more information on this sort of mod.

Help: EntityNamehere

1. Same as normal, read the "Human NPC" tutorial for more information on this sort of mod.

2. If you want it to make a sound change the "null" parts at the bottom to whatever you want. See other Entity* mob files for more help on the sounds.

Help: RenderNamehere

I don't recommend using the Render file that techne makes for you as it is a bit broken.

1. Nothing but name-changing here.

Help: ModelNamehere

1. You don't need to change anything but names here as techne generates it for you with everything you wanted.

avatar
Strengthowns
Admin

Posts : 79
Join date : 2011-06-14
Location : Right here!

View user profile http://www.mcmodding.4umer.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum