"Your model name is not a valid Java name!" ERROR

Started by Yawk on Thu, 08/05/2021 - 18:03

Topic category: Troubleshooting, bugs, and solutions

Last seen on 07:35, 19. Sep 2021
Joined Aug 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
"Your model name is not a valid Java name!" ERROR
Thu, 08/05/2021 - 18:03

Hi, i'm making a mod for 1.12.2 with MCreator 2020.2 and I was making my first custom 3D model, here is the custom model code:

// Made with Blockbench 3.9.2
// Exported for Minecraft version 1.7 - 1.12
// Paste this class into your mod and generate all required imports

public class ratecnico extends ModelBase {
    private final ModelRenderer cabolo;
    private final ModelRenderer cuerpo;
    private final ModelRenderer BrazoDer;
    private final ModelRenderer BrazoIzq;
    private final ModelRenderer pieder;
    private final ModelRenderer pieizq;

    public ratecnico() {
        textureWidth = 64;
        textureHeight = 64;

        cabolo = new ModelRenderer(this);
        cabolo.setRotationPoint(0.0F, 9.0F, 0.0F);
        cabolo.cubeList.add(new ModelBox(cabolo, 0, 0, -4.0F, -8.0F, -4.0F, 8, 8, 8, 0.0F, false));
        cabolo.cubeList.add(new ModelBox(cabolo, 0, 16, -4.5F, -7.0F, -4.5F, 9, 2, 9, 0.0F, false));
        cabolo.cubeList.add(new ModelBox(cabolo, 0, 39, -1.5F, -3.25F, -7.0F, 3, 3, 3, 0.0F, false));
        cabolo.cubeList.add(new ModelBox(cabolo, 51, 0, -4.5F, -10.5F, -3.0F, 2, 3, 1, 0.0F, false));
        cabolo.cubeList.add(new ModelBox(cabolo, 58, 0, 2.5F, -10.5F, -3.0F, 2, 3, 1, 0.0F, false));
        cabolo.cubeList.add(new ModelBox(cabolo, 41, 15, -3.0F, -11.0F, 0.0F, 6, 3, 0, 0.0F, false));
        cabolo.cubeList.add(new ModelBox(cabolo, 41, 15, -3.0F, -10.0F, 1.5F, 6, 3, 0, 0.0F, false));
        cabolo.cubeList.add(new ModelBox(cabolo, 41, 15, -3.0F, -8.5F, 2.75F, 6, 3, 0, 0.0F, false));
        cabolo.cubeList.add(new ModelBox(cabolo, 41, 15, 0.25F, -7.5F, 1.5F, 6, 3, 0, 0.0F, false));
        cabolo.cubeList.add(new ModelBox(cabolo, 41, 15, -6.25F, -7.5F, 1.5F, 6, 3, 0, 0.0F, false));
        cabolo.cubeList.add(new ModelBox(cabolo, 41, 15, -0.5F, -3.75F, 1.5F, 6, 3, 0, 0.0F, false));
        cabolo.cubeList.add(new ModelBox(cabolo, 41, 15, -5.5F, -3.75F, 1.5F, 6, 3, 0, 0.0F, false));
        cabolo.cubeList.add(new ModelBox(cabolo, 41, 18, -3.0F, -0.75F, -3.5F, 6, 3, 0, 0.0F, false));

        cuerpo = new ModelRenderer(this);
        cuerpo.setRotationPoint(0.0F, 13.0F, 0.0F);
        cuerpo.cubeList.add(new ModelBox(cuerpo, 0, 27, -3.0F, -4.0F, -1.5F, 6, 9, 3, 0.0F, false));
        cuerpo.cubeList.add(new ModelBox(cuerpo, 34, 4, -1.5F, 2.75F, -2.0F, 3, 3, 4, 0.0F, false));

        BrazoDer = new ModelRenderer(this);
        BrazoDer.setRotationPoint(-4.0F, 9.0F, 0.0F);
        BrazoDer.cubeList.add(new ModelBox(BrazoDer, 30, 35, -1.0F, 1.0F, -1.0F, 2, 10, 2, 0.0F, false));
        BrazoDer.cubeList.add(new ModelBox(BrazoDer, 29, 13, -1.5F, 0.0F, -1.5F, 3, 9, 3, 0.0F, false));

        BrazoIzq = new ModelRenderer(this);
        BrazoIzq.setRotationPoint(4.0F, 9.0F, 0.0F);
        BrazoIzq.cubeList.add(new ModelBox(BrazoIzq, 30, 35, -1.0F, 1.0F, -1.0F, 2, 10, 2, 0.0F, false));
        BrazoIzq.cubeList.add(new ModelBox(BrazoIzq, 29, 13, -1.5F, 0.0F, -1.5F, 3, 9, 3, 0.0F, false));

        pieder = new ModelRenderer(this);
        pieder.setRotationPoint(-2.0F, 15.0F, 0.0F);
        pieder.cubeList.add(new ModelBox(pieder, 34, 0, -1.5F, 8.0F, -3.0F, 3, 1, 3, 0.0F, false));
        pieder.cubeList.add(new ModelBox(pieder, 44, 1, -1.0F, 8.0F, -1.0F, 2, 1, 3, 0.0F, false));
        pieder.cubeList.add(new ModelBox(pieder, 44, 5, -1.0F, 7.0F, -2.5F, 2, 1, 2, 0.0F, false));
        pieder.cubeList.add(new ModelBox(pieder, 21, 39, -1.5F, 6.5F, -2.0F, 3, 2, 1, 0.0F, false));
        pieder.cubeList.add(new ModelBox(pieder, 0, 0, -1.0F, 3.0F, -1.0F, 2, 6, 2, 0.0F, false));
        pieder.cubeList.add(new ModelBox(pieder, 30, 27, -1.5F, 0.75F, -2.0F, 3, 4, 4, 0.0F, false));
        pieder.cubeList.add(new ModelBox(pieder, 8, 45, 0.25F, 8.0F, -1.25F, 1, 1, 3, 0.0F, false));
        pieder.cubeList.add(new ModelBox(pieder, 44, 31, -1.25F, 8.0F, -1.5F, 1, 1, 3, 0.0F, false));

        pieizq = new ModelRenderer(this);
        pieizq.setRotationPoint(2.0F, 16.0F, 0.0F);
        pieizq.cubeList.add(new ModelBox(pieizq, 34, 0, -1.5F, 7.0F, -3.0F, 3, 1, 3, 0.0F, false));
        pieizq.cubeList.add(new ModelBox(pieizq, 44, 1, -1.0F, 7.0F, -1.0F, 2, 1, 3, 0.0F, false));
        pieizq.cubeList.add(new ModelBox(pieizq, 44, 5, -1.0F, 6.0F, -2.5F, 2, 1, 2, 0.0F, false));
        pieizq.cubeList.add(new ModelBox(pieizq, 21, 39, -1.5F, 5.5F, -2.0F, 3, 2, 1, 0.0F, false));
        pieizq.cubeList.add(new ModelBox(pieizq, 0, 0, -1.0F, 2.0F, -1.0F, 2, 6, 2, 0.0F, false));
        pieizq.cubeList.add(new ModelBox(pieizq, 24, 0, -1.5F, -0.25F, -2.0F, 3, 4, 4, 0.0F, false));
        pieizq.cubeList.add(new ModelBox(pieizq, 8, 45, 0.25F, 7.0F, -1.25F, 1, 1, 3, 0.0F, false));
        pieizq.cubeList.add(new ModelBox(pieizq, 44, 31, -1.25F, 7.0F, -1.5F, 1, 1, 3, 0.0F, false));
    }

    @Override
    public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
        cabolo.render(f5);
        cuerpo.render(f5);
        BrazoDer.render(f5);
        BrazoIzq.render(f5);
        pieder.render(f5);
        pieizq.render(f5);
    }

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

 

Pls help :c

Last seen on 07:35, 19. Sep 2021
Joined Aug 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Nevermind, I just removed…
Thu, 08/05/2021 - 18:26

Nevermind, I just removed the 3 first code lines (the comments) and it works, here the tutorial that I found: https://www.youtube.com/watch?v=0GeOJqaFOvs