Model name is not filename but the name inside the model java code

Started by underiel on

Topic category: Help with MCreator software

Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Model name is not filename but the name inside the model java code

Hello I am trying to add a Java model in Mcreator but I have an error message which is this:
your model name is not valid java name

custom mob model can not contain whitespace start with number or any non ASCII letters

Model name is not filename but the name inside the model java code (model class name)

here is the code (I don't know anything about code) : 

 

// Made with Blockbench 3.8.3

// Exported for Minecraft version 1.7 - 1.12

// Paste this class into your mod and generate all required imports

 

public class nezukomob extends ModelBase {

    private final ModelRenderer head;

    private final ModelRenderer body;

    private final ModelRenderer leftArm;

    private final ModelRenderer rightArm;

    private final ModelRenderer leftLeg;

    private final ModelRenderer rightLeg;

 

    public nezukomob() {

        textureWidth = 64;

        textureHeight = 64;

 

        head = new ModelRenderer(this);

        head.setRotationPoint(0.0F, 0.0F, 0.0F);

        head.cubeList.add(new ModelBox(head, 0, 0, -4.0F, -8.0F, -4.0F, 8, 8, 8, 0.0F, true));

 

        body = new ModelRenderer(this);

        body.setRotationPoint(0.0F, 0.0F, 0.0F);

        body.cubeList.add(new ModelBox(body, 16, 16, -4.0F, 0.0F, -2.0F, 8, 12, 4, 0.0F, true));

 

        leftArm = new ModelRenderer(this);

        leftArm.setRotationPoint(-5.0F, 2.0F, 0.0F);

        leftArm.cubeList.add(new ModelBox(leftArm, 40, 16, -3.0F, -2.0F, -2.0F, 4, 12, 4, 0.0F, false));

 

        rightArm = new ModelRenderer(this);

        rightArm.setRotationPoint(5.0F, 2.0F, 0.0F);

        rightArm.cubeList.add(new ModelBox(rightArm, 40, 16, -1.0F, -2.0F, -2.0F, 4, 12, 4, 0.0F, true));

 

        leftLeg = new ModelRenderer(this);

        leftLeg.setRotationPoint(-1.9F, 12.0F, 0.0F);

        leftLeg.cubeList.add(new ModelBox(leftLeg, 0, 16, -2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F, false));

 

        rightLeg = new ModelRenderer(this);

        rightLeg.setRotationPoint(1.9F, 12.0F, 0.0F);

        rightLeg.cubeList.add(new ModelBox(rightLeg, 0, 16, -2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F, true));

    }

 

    @Override

    public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {

        head.render(f5);

        body.render(f5);

        leftArm.render(f5);

        rightArm.render(f5);

        leftLeg.render(f5);

        rightLeg.render(f5);

    }

 

    public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {

        modelRenderer.rotateAngleX = x;

        modelRenderer.rotateAngleY = y;

        modelRenderer.rotateAngleZ = z;

    }

}

Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can try removing the…
Mon, 03/29/2021 - 14:44

You can try removing the first 4 lines of code in the Java file and make sure you are using the most current full version of Mcreator.