Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

mob has body parts moving randomly


2FastAssassin
 Share

Recommended Posts

the body of my mob is opening and closing like a door and it wont stay in one place

 

 

model code:

 

 

package wearethewarriorsmod.mob;

 

import net.minecraft.client.model.ModelBase;

import net.minecraft.client.model.ModelRenderer;

import net.minecraft.entity.Entity;

import net.minecraft.util.MathHelper;

 

public class EarthElemental extends ModelBase

{

  //fields

    ModelRenderer arm2top;

    ModelRenderer body1;

    ModelRenderer arm1top;

    ModelRenderer arm2bot;

    ModelRenderer arm1bot;

    ModelRenderer leg1top;

    ModelRenderer leg2top;

    ModelRenderer leg1bot;

    ModelRenderer leg2bot;

    ModelRenderer head;

    ModelRenderer arm2rock;

    ModelRenderer leg2butt;

    ModelRenderer arm1backrock;

    ModelRenderer arm2backrock;

    ModelRenderer leg1knee;

    ModelRenderer leg1butt;

    ModelRenderer arm2fing1;

    ModelRenderer arm2fing2;

    ModelRenderer arm2fing3;

    ModelRenderer arm2fing4;

    ModelRenderer arm2fing5;

    ModelRenderer arm1fing1;

    ModelRenderer body2;

    ModelRenderer arm1fing2;

    ModelRenderer arm1fing3;

    ModelRenderer arm1fing4;

    ModelRenderer body3;

    ModelRenderer body4;

    ModelRenderer body5;

    ModelRenderer body6;

    ModelRenderer arm1rock;

    ModelRenderer leg2knee;

    ModelRenderer leg2foot;

    ModelRenderer leg1foot;

    ModelRenderer spike1;

    ModelRenderer spike2;

    ModelRenderer spike3;

    ModelRenderer spike4;

    ModelRenderer spike5;

    ModelRenderer spike6;

    ModelRenderer spike7;

    ModelRenderer spike8;

    ModelRenderer spike9;

    ModelRenderer spike10;

    ModelRenderer Spike11;

    ModelRenderer spike12;

 

  public EarthElemental()

  {

    textureWidth = 128;

    textureHeight = 32;

   

      arm2top = new ModelRenderer(this, 26, 0);

      arm2top.addBox(0F, 0F, 0F, 4, 10, 4);

      arm2top.setRotationPoint(3F, -3F, 1F);

      arm2top.setTextureSize(128, 32);

      arm2top.mirror = true;

      setRotation(arm2top, -0.1570796F, 0F, -0.122173F);

      body1 = new ModelRenderer(this, 0, 0);

      body1.addBox(0F, 0F, 0F, 7, 12, 5);

      body1.setRotationPoint(-4F, -3F, 0F);

      body1.setTextureSize(128, 32);

      body1.mirror = true;

      setRotation(body1, 0.1745329F, 0F, 0F);

      arm1top = new ModelRenderer(this, 26, 0);

      arm1top.addBox(0F, 0F, 0F, 4, 10, 4);

      arm1top.setRotationPoint(-8F, -3F, 1F);

      arm1top.setTextureSize(128, 32);

      arm1top.mirror = true;

      setRotation(arm1top, -0.1570796F, 0F, 0.122173F);

      arm2bot = new ModelRenderer(this, 26, 0);

      arm2bot.addBox(0F, 0F, 0F, 4, 8, 4);

      arm2bot.setRotationPoint(4F, 5F, -0.5F);

      arm2bot.setTextureSize(128, 32);

      arm2bot.mirror = true;

      setRotation(arm2bot, -0.1570796F, 0F, 0.122173F);

      arm1bot = new ModelRenderer(this, 26, 0);

      arm1bot.addBox(0F, 0F, 0F, 4, 8, 4);

      arm1bot.setRotationPoint(-9.2F, 6F, 0F);

      arm1bot.setTextureSize(128, 32);

      arm1bot.mirror = true;

      setRotation(arm1bot, -0.1570796F, 0F, -0.122173F);

      leg1top = new ModelRenderer(this, 26, 0);

      leg1top.addBox(0F, 0F, 0F, 4, 8, 4);

      leg1top.setRotationPoint(-4F, 8F, 3F);

      leg1top.setTextureSize(128, 32);

      leg1top.mirror = true;

      setRotation(leg1top, -0.2617994F, 0F, 0.1396263F);

      leg2top = new ModelRenderer(this, 26, 0);

      leg2top.addBox(0F, 0F, 0F, 4, 8, 4);

      leg2top.setRotationPoint(-1F, 8F, 3F);

      leg2top.setTextureSize(128, 32);

      leg2top.mirror = true;

      setRotation(leg2top, -0.2792527F, 0F, -0.1745329F);

      leg1bot = new ModelRenderer(this, 26, 0);

      leg1bot.addBox(0F, 0F, 0F, 4, 10, 4);

      leg1bot.setRotationPoint(-5F, 14F, 1F);

      leg1bot.setTextureSize(128, 32);

      leg1bot.mirror = true;

      setRotation(leg1bot, 0.1570796F, 0F, 0.0872665F);

      leg2bot = new ModelRenderer(this, 26, 0);

      leg2bot.addBox(0F, 0F, 0F, 4, 10, 4);

      leg2bot.setRotationPoint(0F, 15F, 0.7F);

      leg2bot.setTextureSize(128, 32);

      leg2bot.mirror = true;

      setRotation(leg2bot, 0.1570796F, 0F, -0.1570796F);

      head = new ModelRenderer(this, 51, 0);

      head.addBox(0F, 0F, 0F, 7, 7, 7);

      head.setRotationPoint(-4F, -10F, -2.5F);

      head.setTextureSize(128, 32);

      head.mirror = true;

      setRotation(head, 0.1047198F, 0F, 0F);

      arm2rock = new ModelRenderer(this, 80, 0);

      arm2rock.addBox(0F, 0F, 0F, 2, 3, 3);

      arm2rock.setRotationPoint(6F, 0F, 0F);

      arm2rock.setTextureSize(128, 32);

      arm2rock.mirror = true;

      setRotation(arm2rock, 0F, 0F, 0F);

      leg2butt = new ModelRenderer(this, 80, 0);

      leg2butt.addBox(0F, 0F, 0F, 4, 3, 3);

      leg2butt.setRotationPoint(-1F, 7F, 4F);

      leg2butt.setTextureSize(128, 32);

      leg2butt.mirror = true;

      setRotation(leg2butt, 0F, 0F, -0.0872665F);

      arm1backrock = new ModelRenderer(this, 80, 0);

      arm1backrock.addBox(0F, 0F, 0F, 2, 3, 3);

      arm1backrock.setRotationPoint(-5F, -2.066667F, 2F);

      arm1backrock.setTextureSize(128, 32);

      arm1backrock.mirror = true;

      setRotation(arm1backrock, 0F, 0F, 0F);

      arm2backrock = new ModelRenderer(this, 80, 0);

      arm2backrock.addBox(0F, 0F, 0F, 2, 3, 3);

      arm2backrock.setRotationPoint(2F, -3F, 2F);

      arm2backrock.setTextureSize(128, 32);

      arm2backrock.mirror = true;

      setRotation(arm2backrock, 0F, 0F, 0F);

      leg1knee = new ModelRenderer(this, 80, 0);

      leg1knee.addBox(0F, 0F, 0F, 4, 3, 3);

      leg1knee.setRotationPoint(-4.8F, 13F, 1F);

      leg1knee.setTextureSize(128, 32);

      leg1knee.mirror = true;

      setRotation(leg1knee, -0.0523599F, 0F, 0.122173F);

      leg1butt = new ModelRenderer(this, 80, 0);

      leg1butt.addBox(0F, 0F, 0F, 4, 3, 3);

      leg1butt.setRotationPoint(-4F, 7F, 4F);

      leg1butt.setTextureSize(128, 32);

      leg1butt.mirror = true;

      setRotation(leg1butt, 0F, 0F, 0.0872665F);

      arm2fing1 = new ModelRenderer(this, 80, 0);

      arm2fing1.addBox(0F, 0F, 0F, 3, 3, 3);

      arm2fing1.setRotationPoint(4F, 8F, -2F);

      arm2fing1.setTextureSize(128, 32);

      arm2fing1.mirror = true;

      setRotation(arm2fing1, -0.0872665F, 0F, 0F);

      arm2fing2 = new ModelRenderer(this, 80, 0);

      arm2fing2.addBox(0F, 0F, 0F, 2, 3, 3);

      arm2fing2.setRotationPoint(3F, 10F, -2F);

      arm2fing2.setTextureSize(128, 32);

      arm2fing2.mirror = true;

      setRotation(arm2fing2, 0F, 0F, 0F);

      arm2fing3 = new ModelRenderer(this, 80, 0);

      arm2fing3.addBox(0F, 0F, 0F, 2, 3, 3);

      arm2fing3.setRotationPoint(6F, 9F, -2F);

      arm2fing3.setTextureSize(128, 32);

      arm2fing3.mirror = true;

      setRotation(arm2fing3, -0.0349066F, -0.0523599F, 0.2617994F);

      arm2fing4 = new ModelRenderer(this, 80, 0);

      arm2fing4.addBox(0F, 0F, 0F, 2, 3, 3);

      arm2fing4.setRotationPoint(6F, 9F, 0F);

      arm2fing4.setTextureSize(128, 32);

      arm2fing4.mirror = true;

      setRotation(arm2fing4, 0F, 0F, 0.0698132F);

      arm2fing5 = new ModelRenderer(this, 80, 0);

      arm2fing5.addBox(0F, 0F, 0F, 2, 3, 3);

      arm2fing5.setRotationPoint(5F, 10.5F, -1.8F);

      arm2fing5.setTextureSize(128, 32);

      arm2fing5.mirror = true;

      setRotation(arm2fing5, -0.2268928F, -0.0174533F, -0.0698132F);

      arm1fing1 = new ModelRenderer(this, 80, 0);

      arm1fing1.addBox(0F, 0F, 0F, 3, 3, 3);

      arm1fing1.setRotationPoint(-7F, 11F, -1.1F);

      arm1fing1.setTextureSize(128, 32);

      arm1fing1.mirror = true;

      setRotation(arm1fing1, -0.0872665F, 0F, 0F);

      body2 = new ModelRenderer(this, 80, 0);

      body2.addBox(0F, 0F, 0F, 3, 7, 3);

      body2.setRotationPoint(0.1F, -3F, -0.5F);

      body2.setTextureSize(128, 32);

      body2.mirror = true;

      setRotation(body2, 0.1745329F, 0F, 0F);

      arm1fing2 = new ModelRenderer(this, 80, 0);

      arm1fing2.addBox(0F, 0F, 0F, 2, 3, 3);

      arm1fing2.setRotationPoint(-9F, 9F, -1F);

      arm1fing2.setTextureSize(128, 32);

      arm1fing2.mirror = true;

      setRotation(arm1fing2, -0.2268928F, -0.0174533F, -0.1919862F);

      arm1fing3 = new ModelRenderer(this, 80, 0);

      arm1fing3.addBox(0F, 0F, 0F, 2, 3, 3);

      arm1fing3.setRotationPoint(-6F, 8F, -1F);

      arm1fing3.setTextureSize(128, 32);

      arm1fing3.mirror = true;

      setRotation(arm1fing3, 0F, 0F, 0.0698132F);

      arm1fing4 = new ModelRenderer(this, 80, 0);

      arm1fing4.addBox(0F, 0F, 0F, 2, 3, 3);

      arm1fing4.setRotationPoint(-8F, 11F, -1.2F);

      arm1fing4.setTextureSize(128, 32);

      arm1fing4.mirror = true;

      setRotation(arm1fing4, -0.0349066F, -0.0523599F, 0.2617994F);

      body3 = new ModelRenderer(this, 80, 0);

      body3.addBox(0F, 0F, 0F, 3, 7, 3);

      body3.setRotationPoint(-2.2F, -5F, -0.5F);

      body3.setTextureSize(128, 32);

      body3.mirror = true;

      setRotation(body3, 0.1745329F, 0.0349066F, 0F);

      body4 = new ModelRenderer(this, 80, 0);

      body4.addBox(0F, 0F, 0F, 2, 7, 3);

      body4.setRotationPoint(-4.1F, -3F, -0.5F);

      body4.setTextureSize(128, 32);

      body4.mirror = true;

      setRotation(body4, 0.1745329F, 0F, 0F);

      body5 = new ModelRenderer(this, 80, 0);

      body5.addBox(0F, 0F, 0F, 2, 3, 3);

      body5.setRotationPoint(1.1F, 3F, 0.7F);

      body5.setTextureSize(128, 32);

      body5.mirror = true;

      setRotation(body5, 0.1745329F, 0F, 0F);

      body6 = new ModelRenderer(this, 80, 0);

      body6.addBox(0F, 0F, 0F, 1, 2, 1);

      body6.setRotationPoint(2.1F, 5F, 1.1F);

      body6.setTextureSize(128, 32);

      body6.mirror = true;

      setRotation(body6, 0.1745329F, 0F, 0F);

      arm1rock = new ModelRenderer(this, 80, 0);

      arm1rock.addBox(0F, 0F, 0F, 2, 3, 3);

      arm1rock.setRotationPoint(-8F, -3F, 0F);

      arm1rock.setTextureSize(128, 32);

      arm1rock.mirror = true;

      setRotation(arm1rock, -0.122173F, 0F, 0.2268928F);

      leg2knee = new ModelRenderer(this, 80, 0);

      leg2knee.addBox(0F, 0F, 0F, 4, 3, 3);

      leg2knee.setRotationPoint(0F, 13F, 0.8F);

      leg2knee.setTextureSize(128, 32);

      leg2knee.mirror = true;

      setRotation(leg2knee, -0.0523599F, 0F, -0.122173F);

      leg2foot = new ModelRenderer(this, 80, 0);

      leg2foot.addBox(0F, 0F, 0F, 4, 2, 6);

      leg2foot.setRotationPoint(1.3F, 22F, 0F);

      leg2foot.setTextureSize(128, 32);

      leg2foot.mirror = true;

      setRotation(leg2foot, 0F, 0F, 0F);

      leg1foot = new ModelRenderer(this, 80, 0);

      leg1foot.addBox(0F, 0F, 0F, 4, 2, 6);

      leg1foot.setRotationPoint(-6F, 22F, 0F);

      leg1foot.setTextureSize(128, 32);

      leg1foot.mirror = true;

      setRotation(leg1foot, 0F, 0F, 0F);

      spike1 = new ModelRenderer(this, 102, 22);

      spike1.addBox(0F, 0F, 0F, 1, 1, 3);

      spike1.setRotationPoint(1F, -2F, 4F);

      spike1.setTextureSize(128, 32);

      spike1.mirror = true;

      setRotation(spike1, 0.1745329F, 0.1919862F, -0.0523599F);

      spike2 = new ModelRenderer(this, 102, 22);

      spike2.addBox(0F, 0F, 0F, 1, 1, 3);

      spike2.setRotationPoint(-1F, -2F, 6F);

      spike2.setTextureSize(128, 32);

      spike2.mirror = true;

      setRotation(spike2, 0.1745329F, 0.1919862F, -0.0523599F);

      spike3 = new ModelRenderer(this, 102, 22);

      spike3.addBox(0F, 0F, 0F, 1, 1, 3);

      spike3.setRotationPoint(-1F, -0.5F, 6F);

      spike3.setTextureSize(128, 32);

      spike3.mirror = true;

      setRotation(spike3, -0.0523599F, -0.0698132F, 0.0174533F);

      spike4 = new ModelRenderer(this, 102, 22);

      spike4.addBox(0F, 0F, 0F, 1, 1, 3);

      spike4.setRotationPoint(-2F, -2F, 4F);

      spike4.setTextureSize(128, 32);

      spike4.mirror = true;

      setRotation(spike4, 0.2792527F, -0.0698132F, -0.0523599F);

      spike5 = new ModelRenderer(this, 102, 22);

      spike5.addBox(0F, 0F, 0F, 1, 1, 3);

      spike5.setRotationPoint(1F, 0F, 4.533333F);

      spike5.setTextureSize(128, 32);

      spike5.mirror = true;

      setRotation(spike5, 0.122173F, 0.2094395F, 0F);

      spike6 = new ModelRenderer(this, 102, 22);

      spike6.addBox(0F, 0F, 0F, 1, 1, 3);

      spike6.setRotationPoint(0F, 0F, 6F);

      spike6.setTextureSize(128, 32);

      spike6.mirror = true;

      setRotation(spike6, -0.0872665F, 0.0872665F, -0.0174533F);

      spike7 = new ModelRenderer(this, 102, 22);

      spike7.addBox(0F, 0F, 0F, 1, 1, 3);

      spike7.setRotationPoint(-2F, 0F, 5F);

      spike7.setTextureSize(128, 32);

      spike7.mirror = true;

      setRotation(spike7, 0.0349066F, -0.1570796F, -0.0523599F);

      spike8 = new ModelRenderer(this, 102, 22);

      spike8.addBox(0F, 0F, 0F, 1, 1, 3);

      spike8.setRotationPoint(0F, -1F, 5F);

      spike8.setTextureSize(128, 32);

      spike8.mirror = true;

      setRotation(spike8, 0.1919862F, 0.0523599F, -0.0523599F);

      spike9 = new ModelRenderer(this, 102, 22);

      spike9.addBox(0F, 0F, 0F, 1, 1, 3);

      spike9.setRotationPoint(-2F, -1F, 4F);

      spike9.setTextureSize(128, 32);

      spike9.mirror = true;

      setRotation(spike9, 0.1919862F, -0.2268928F, -0.0174533F);

      spike10 = new ModelRenderer(this, 102, 22);

      spike10.addBox(0F, 0F, 0F, 1, 1, 3);

      spike10.setRotationPoint(-1.5F, -3F, 4F);

      spike10.setTextureSize(128, 32);

      spike10.mirror = true;

      setRotation(spike10, 0.1745329F, 0.1570796F, -0.0523599F);

      Spike11 = new ModelRenderer(this, 102, 22);

      Spike11.addBox(0F, 0F, 0F, 1, 1, 3);

      Spike11.setRotationPoint(1F, -1F, 5F);

      Spike11.setTextureSize(128, 32);

      Spike11.mirror = true;

      setRotation(Spike11, 0.1745329F, 0.1919862F, -0.0523599F);

      spike12 = new ModelRenderer(this, 102, 22);

      spike12.addBox(0F, 0F, 0F, 1, 1, 3);

      spike12.setRotationPoint(-3F, -2F, 5F);

      spike12.setTextureSize(128, 32);

      spike12.mirror = true;

      setRotation(spike12, 0.1745329F, -0.2443461F, -0.0349066F);

  }

 

  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, entity);

    arm2top.render(f5);

    body1.render(f5);

    arm1top.render(f5);

    arm2bot.render(f5);

    arm1bot.render(f5);

    leg1top.render(f5);

    leg2top.render(f5);

    leg1bot.render(f5);

    leg2bot.render(f5);

    head.render(f5);

    arm2rock.render(f5);

    leg2butt.render(f5);

    arm1backrock.render(f5);

    arm2backrock.render(f5);

    leg1knee.render(f5);

    leg1butt.render(f5);

    arm2fing1.render(f5);

    arm2fing2.render(f5);

    arm2fing3.render(f5);

    arm2fing4.render(f5);

    arm2fing5.render(f5);

    arm1fing1.render(f5);

    body2.render(f5);

    arm1fing2.render(f5);

    arm1fing3.render(f5);

    arm1fing4.render(f5);

    body3.render(f5);

    body4.render(f5);

    body5.render(f5);

    body6.render(f5);

    arm1rock.render(f5);

    leg2knee.render(f5);

    leg2foot.render(f5);

    leg1foot.render(f5);

    spike1.render(f5);

    spike2.render(f5);

    spike3.render(f5);

    spike4.render(f5);

    spike5.render(f5);

    spike6.render(f5);

    spike7.render(f5);

    spike8.render(f5);

    spike9.render(f5);

    spike10.render(f5);

    Spike11.render(f5);

    spike12.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, Entity entity)

  {

    super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);

    float f6 = (180F / (float)Math.PI);

    this.body1.rotateAngleX = f4 / (180F / (float)Math.PI);

    this.body1.rotateAngleY = f3 / (180F / (float)Math.PI);

    this.body2.rotateAngleX = f4 / (180F / (float)Math.PI);

    this.body2.rotateAngleY = f3 / (180F / (float)Math.PI);

    this.body3.rotateAngleX = f4 / (180F / (float)Math.PI);

    this.body3.rotateAngleY = f3 / (180F / (float)Math.PI);

    this.body4.rotateAngleX = f4 / (180F / (float)Math.PI);

    this.body4.rotateAngleY = f3 / (180F / (float)Math.PI);

    this.body5.rotateAngleX = f4 / (180F / (float)Math.PI);

    this.body5.rotateAngleY = f3 / (180F / (float)Math.PI);

    this.body6.rotateAngleX = f4 / (180F / (float)Math.PI);

    this.body6.rotateAngleY = f3 / (180F / (float)Math.PI);

   

    this.leg1bot.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1;

    this.leg1butt.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1;

    this.leg1foot.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1;

    this.leg1knee.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1;

    this.leg1top.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1;

    this.leg2bot.rotateAngleX = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 1.4F * f1;

    this.leg2butt.rotateAngleX = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 1.4F * f1;

    this.leg2foot.rotateAngleX = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 1.4F * f1;

    this.leg2knee.rotateAngleX = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 1.4F * f1;

    this.leg2top.rotateAngleX = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 1.4F * f1;

  }

 

}

 

 

 

 

all the extra ones are parts in the same area

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.