.Java entity models don't work

Started by Nyancatpig on

Topic category: Troubleshooting, bugs, and solutions

Last seen on 00:20, 26. Mar 2022
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
.Java entity models don't work

I have two mobs in my mod, both of which have different models, and I get an error every time the build tries to load, saying that the second mob is an element that doesn't compile properly. I have deleted the 3 lines with // at the start and have changed the identifiers of both models but it still doesn't like model 2. All other threads about this are fixed by one of these so I'm stumped.

Here is the .java file for model 2:

public class Eyecrawl extends EntityModel<Entity> {
    private final ModelRenderer eye;
    private final ModelRenderer 1;
    private final ModelRenderer tendral1;
    private final ModelRenderer arm1;
    private final ModelRenderer 2;
    private final ModelRenderer tendral2;
    private final ModelRenderer arm2;
    private final ModelRenderer 3;
    private final ModelRenderer tendral3;
    private final ModelRenderer arm3;
    private final ModelRenderer 4;
    private final ModelRenderer tendral4;
    private final ModelRenderer arm4;
    private final ModelRenderer 5;
    private final ModelRenderer tendral5;
    private final ModelRenderer arm5;
    private final ModelRenderer 6;
    private final ModelRenderer tendral6;
    private final ModelRenderer arm6;
    private final ModelRenderer 7;
    private final ModelRenderer tendral7;
    private final ModelRenderer arm7;
    private final ModelRenderer 8;
    private final ModelRenderer tendral8;
    private final ModelRenderer arm8;

    public Eyecrawl() {
        textureWidth = 128;
        textureHeight = 128;

        eye = new ModelRenderer(this);
        eye.setRotationPoint(0.0F, 24.0F, 0.0F);
        eye.setTextureOffset(0, 88).addBox(-5.0F, -35.0F, -3.0F, 11.0F, 11.0F, 7.0F, 0.0F, false);

        1 = new ModelRenderer(this);
        1.setRotationPoint(29.0F, -4.0F, 0.0F);
        setRotationAngle(1, 0.0F, 0.0F, -1.5708F);
        

        tendral1 = new ModelRenderer(this);
        tendral1.setRotationPoint(-1.0F, -25.0F, 2.0F);
        1.addChild(tendral1);
        setRotationAngle(tendral1, 0.0F, 0.5236F, 0.0F);
        tendral1.setTextureOffset(0, 0).addBox(-18.0F, -5.0F, 1.2679F, 20.0F, 3.0F, 2.0F, 0.0F, false);

        arm1 = new ModelRenderer(this);
        arm1.setRotationPoint(-15.0F, -25.0F, 10.0F);
        1.addChild(arm1);
        setRotationAngle(arm1, 0.0F, -0.5236F, 0.0F);
        arm1.setTextureOffset(0, 0).addBox(-18.0F, -5.0F, 1.2679F, 20.0F, 3.0F, 2.0F, 0.0F, false);

        2 = new ModelRenderer(this);
        2.setRotationPoint(-29.0F, -6.0F, 0.0F);
        setRotationAngle(2, 0.0F, 0.0F, 1.5708F);
        

        tendral2 = new ModelRenderer(this);
        tendral2.setRotationPoint(-1.0F, -25.0F, 2.0F);
        2.addChild(tendral2);
        setRotationAngle(tendral2, 0.0F, 0.5236F, 0.0F);
        tendral2.setTextureOffset(0, 0).addBox(-18.0F, -6.0F, 1.2679F, 20.0F, 3.0F, 2.0F, 0.0F, false);

        arm2 = new ModelRenderer(this);
        arm2.setRotationPoint(-15.0F, -25.0F, 10.0F);
        2.addChild(arm2);
        setRotationAngle(arm2, 0.0F, -0.5236F, 0.0F);
        arm2.setTextureOffset(0, 0).addBox(-18.0F, -6.0F, 1.2679F, 20.0F, 3.0F, 2.0F, 0.0F, false);

        3 = new ModelRenderer(this);
        3.setRotationPoint(0.0F, 24.0F, 0.0F);
        

        tendral3 = new ModelRenderer(this);
        tendral3.setRotationPoint(-1.0F, -25.0F, 2.0F);
        3.addChild(tendral3);
        setRotationAngle(tendral3, 0.0F, 0.5236F, 0.0F);
        tendral3.setTextureOffset(0, 0).addBox(-18.0F, -6.0F, 1.2679F, 20.0F, 3.0F, 2.0F, 0.0F, false);

        arm3 = new ModelRenderer(this);
        arm3.setRotationPoint(-15.0F, -25.0F, 10.0F);
        3.addChild(arm3);
        setRotationAngle(arm3, 0.0F, -0.5236F, 0.0F);
        arm3.setTextureOffset(0, 0).addBox(-18.0F, -6.0F, 1.2679F, 20.0F, 3.0F, 2.0F, 0.0F, false);

        4 = new ModelRenderer(this);
        4.setRotationPoint(0.0F, 24.0F, 0.0F);
        

        tendral4 = new ModelRenderer(this);
        tendral4.setRotationPoint(16.0F, -25.0F, 10.0F);
        4.addChild(tendral4);
        setRotationAngle(tendral4, 0.0F, -0.5236F, 0.0F);
        tendral4.setTextureOffset(0, 0).addBox(-18.0F, -6.0F, 1.2679F, 20.0F, 3.0F, 2.0F, 0.0F, false);

        arm4 = new ModelRenderer(this);
        arm4.setRotationPoint(30.0F, -25.0F, 2.0F);
        4.addChild(arm4);
        setRotationAngle(arm4, 0.0F, 0.5236F, 0.0F);
        arm4.setTextureOffset(0, 0).addBox(-18.0F, -6.0F, 1.2679F, 20.0F, 3.0F, 2.0F, 0.0F, false);

        5 = new ModelRenderer(this);
        5.setRotationPoint(-21.0F, 15.0F, 0.0F);
        setRotationAngle(5, 0.0F, 0.0F, 0.7854F);
        

        tendral5 = new ModelRenderer(this);
        tendral5.setRotationPoint(-1.0F, -25.0F, 2.0F);
        5.addChild(tendral5);
        setRotationAngle(tendral5, 0.0F, 0.5236F, 0.0F);
        tendral5.setTextureOffset(0, 0).addBox(-18.0F, -5.7321F, 1.2679F, 20.0F, 3.0F, 2.0F, 0.0F, false);

        arm5 = new ModelRenderer(this);
        arm5.setRotationPoint(-15.0F, -25.0F, 10.0F);
        5.addChild(arm5);
        setRotationAngle(arm5, 0.0F, -0.5236F, 0.0F);
        arm5.setTextureOffset(0, 0).addBox(-18.0F, -5.7321F, 1.2679F, 20.0F, 3.0F, 2.0F, 0.0F, false);

        6 = new ModelRenderer(this);
        6.setRotationPoint(21.0F, 15.0F, 0.0F);
        setRotationAngle(6, 0.0F, 0.0F, -0.7854F);
        

        tendral6 = new ModelRenderer(this);
        tendral6.setRotationPoint(-1.0F, -25.0F, 2.0F);
        6.addChild(tendral6);
        setRotationAngle(tendral6, 0.0F, 0.5236F, 0.0F);
        tendral6.setTextureOffset(0, 0).addBox(-18.0F, -5.7321F, 1.2679F, 20.0F, 3.0F, 2.0F, 0.0F, false);

        arm6 = new ModelRenderer(this);
        arm6.setRotationPoint(-15.0F, -25.0F, 10.0F);
        6.addChild(arm6);
        setRotationAngle(arm6, 0.0F, -0.5236F, 0.0F);
        arm6.setTextureOffset(0, 0).addBox(-18.0F, -5.7321F, 1.2679F, 20.0F, 3.0F, 2.0F, 0.0F, false);

        7 = new ModelRenderer(this);
        7.setRotationPoint(21.0F, -26.0F, 0.0F);
        setRotationAngle(7, 0.0F, 0.0F, -2.3562F);
        

        tendral7 = new ModelRenderer(this);
        tendral7.setRotationPoint(-1.0F, -25.0F, 2.0F);
        7.addChild(tendral7);
        setRotationAngle(tendral7, 0.0F, 0.5236F, 0.0F);
        tendral7.setTextureOffset(0, 0).addBox(-18.0F, -5.7321F, 1.2679F, 20.0F, 3.0F, 2.0F, 0.0F, false);

        arm7 = new ModelRenderer(this);
        arm7.setRotationPoint(-15.0F, -25.0F, 10.0F);
        7.addChild(arm7);
        setRotationAngle(arm7, 0.0F, -0.5236F, 0.0F);
        arm7.setTextureOffset(0, 0).addBox(-18.0F, -5.7321F, 1.2679F, 20.0F, 3.0F, 2.0F, 0.0F, false);

        8 = new ModelRenderer(this);
        8.setRotationPoint(-20.0F, -26.0F, 0.0F);
        setRotationAngle(8, 0.0F, 0.0F, 2.3562F);
        

        tendral8 = new ModelRenderer(this);
        tendral8.setRotationPoint(-1.0F, -25.0F, 2.0F);
        8.addChild(tendral8);
        setRotationAngle(tendral8, 0.0F, 0.5236F, 0.0F);
        tendral8.setTextureOffset(0, 0).addBox(-18.0F, -5.7321F, 1.2679F, 20.0F, 3.0F, 2.0F, 0.0F, false);

        arm8 = new ModelRenderer(this);
        arm8.setRotationPoint(-15.0F, -25.0F, 10.0F);
        8.addChild(arm8);
        setRotationAngle(arm8, 0.0F, -0.5236F, 0.0F);
        arm8.setTextureOffset(0, 0).addBox(-18.0F, -5.7321F, 1.2679F, 20.0F, 3.0F, 2.0F, 0.0F, false);
    }

    @Override
    public void setRotationAngles(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch){
        //previously the render function, render code was moved to a method below
    }

    @Override
    public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha){
        eye.render(matrixStack, buffer, packedLight, packedOverlay);
        1.render(matrixStack, buffer, packedLight, packedOverlay);
        2.render(matrixStack, buffer, packedLight, packedOverlay);
        3.render(matrixStack, buffer, packedLight, packedOverlay);
        4.render(matrixStack, buffer, packedLight, packedOverlay);
        5.render(matrixStack, buffer, packedLight, packedOverlay);
        6.render(matrixStack, buffer, packedLight, packedOverlay);
        7.render(matrixStack, buffer, packedLight, packedOverlay);
        8.render(matrixStack, buffer, packedLight, packedOverlay);
    }

    public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
        modelRenderer.rotateAngleX = x;
        modelRenderer.rotateAngleY = y;
        modelRenderer.rotateAngleZ = z;
    }
}

Last seen on 00:20, 26. Mar 2022
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It might not even be the…
Thu, 12/10/2020 - 00:00

It might not even be the model, MCreator doesn't seem to like me adding new entities at all

Last seen on 00:20, 26. Mar 2022
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
No it's definitely the model…
Thu, 12/10/2020 - 00:08

No it's definitely the model, nothing I do fixes it.

Last seen on 00:20, 26. Mar 2022
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It's the latest versions for…
Fri, 12/11/2020 - 01:30

It's the latest versions for both.

There must've been something wrong with the models in general, I made new ones for both and it seems to work now.

I guess you can't put bones inside bones in MCreator models

Last seen on 15:03, 2. Feb 2021
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
MCreator will give you…
Fri, 12/11/2020 - 01:47

MCreator will give you errors if your entity model contains:

transparent parts

parts with irregular scales (setting a lower scale to get more pixels in a smaller space)

parts that are named the same thing (I mess this one up a lot using Tabula)

and lots of other errors that are specific to the model maker you are using. And if you mean putting bones inside of bones in the sense of Blender's bone structure, then stop using Blender for making models because it usually doesn't work.

Last seen on 15:03, 2. Feb 2021
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Also, it generally won't…
Fri, 12/11/2020 - 01:50

Also, it generally won't work if you tried to animate the model outside of MCreator, which I find very unfortunate as MCreater's animations are super baisic.

Last seen on 18:30, 9. Mar 2024
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
the model it was a probably…
Tue, 01/12/2021 - 12:59

the model it was a probably in the problem, should improve it at for sure, the models won't work basically for the generator when starts and causes error with problems, if you improve it the model, animations are the model is improved, with need to work, probably if you improve it 

Last seen on 15:34, 21. Jun 2021
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You have the names of the…
Thu, 05/06/2021 - 09:04

You have the names of the numbers 1,2,3.
This should not be the case, replace the names of the folders(bones) in blockbench with normal ones and re-export