Your model name is not a valid java name

Started by nxrth on

Topic category: Help with MCreator software

Last seen on 23:15, 23. Feb 2021
Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Your model name is not a valid java name
Thu, 02/18/2021 - 11:55 (edited)

I cant export any of my models into mcreator even there are no any whitespaces or unusual letters. Please help

Here is the code

public class crow extends ModelBase {
    private final ModelRenderer head;
    private final ModelRenderer body;
    private final ModelRenderer r_arm;
    private final ModelRenderer l_arm;
    private final ModelRenderer l_leg;
    private final ModelRenderer r_leg;

    public crow() {
        textureWidth = 32;
        textureHeight = 32;

        head = new ModelRenderer(this);
        head.setRotationPoint(0.0F, 23.0F, 0.0F);
        head.cubeList.add(new ModelBox(head, 2, 2, -1.0F, -9.0F, 0.0F, 2, 3, 2, 0.0F, false));
        head.cubeList.add(new ModelBox(head, 11, 7, -0.5F, -9.0F, -1.0F, 1, 2, 1, 0.0F, false));
        head.cubeList.add(new ModelBox(head, 16, 7, -0.5F, -9.25F, -2.0F, 1, 2, 1, 0.0F, false));

        body = new ModelRenderer(this);
        body.setRotationPoint(0.0F, 24.0F, 0.0F);
        body.cubeList.add(new ModelBox(body, 2, 8, -1.5F, -8.0F, -1.0F, 3, 6, 3, 0.0F, false));
        body.cubeList.add(new ModelBox(body, 22, 1, -1.5F, -4.0F, 1.5F, 3, 4, 1, 0.0F, false));

        r_arm = new ModelRenderer(this);
        r_arm.setRotationPoint(0.0F, 24.0F, 0.0F);
        r_arm.cubeList.add(new ModelBox(r_arm, 19, 8, -2.0F, -7.5F, -0.7F, 1, 5, 3, 0.0F, false));

        l_arm = new ModelRenderer(this);
        l_arm.setRotationPoint(0.0F, 24.0F, 0.0F);
        l_arm.cubeList.add(new ModelBox(l_arm, 19, 8, 1.0F, -7.5F, -0.7F, 1, 5, 3, 0.0F, false));

        l_leg = new ModelRenderer(this);
        l_leg.setRotationPoint(0.0F, 24.0F, 0.0F);
        l_leg.cubeList.add(new ModelBox(l_leg, 14, 18, -1.5F, -2.0F, 0.0F, 1, 2, 1, 0.0F, false));

        r_leg = new ModelRenderer(this);
        r_leg.setRotationPoint(0.0F, 24.0F, 0.0F);
        r_leg.cubeList.add(new ModelBox(r_leg, 14, 18, 0.5F, -2.0F, 0.0F, 1, 2, 1, 0.0F, false));
    }

    @Override
    public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
        head.render(f5);
        body.render(f5);
        r_arm.render(f5);
        l_arm.render(f5);
        l_leg.render(f5);
        r_leg.render(f5);
    }

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

 

I don't know what the problem is

Edited by nxrth on Thu, 02/18/2021 - 11:55
Last seen on 22:02, 23. Jan 2023
Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
it could be that when naming…
Thu, 02/18/2021 - 17:04

it could be that when naming the model you gave it the same name as another model you made, id suggest putting a shortened form of the mod name at the end of the model name if that is the problem

Last seen on 23:15, 23. Feb 2021
Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I have 4 different…
Thu, 02/18/2021 - 19:47

I have 4 different variations of that model with _, "e" letter at the beginning and end of a word and mcreator is still swearing. All model names and file names are the same as well