Invalid Java Name

Started by AidanVS on

Topic category: Help with Minecraft modding (Java Edition)

Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Invalid Java Name

"Your model name is not a valid Java name!

Custom mob models can not contain whitespace, start with numbers or contain any non ASCII letters.

Model name is not filename, but the name inside the model Java code (model class name)!

The best solution to this problem is to properly define the model name in your modeler before exporting the model"

 

Been looking at forums for hours and trying to fix it myself on blockbench but I cant figure it out. any one have any ideas? 

(Here's the model code)

//Made with Blockbench
//Paste this code into your mod.

import org.lwjgl.opengl.GL11;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelBox;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;

public class  extends ModelBase {
    private final ModelRenderer head;
    private final ModelRenderer tassle;
    private final ModelRenderer tassle2;
    private final ModelRenderer tassle3;
    private final ModelRenderer tassle4;
    private final ModelRenderer torso;
    private final ModelRenderer torsemid;
    private final ModelRenderer torsemid2;
    private final ModelRenderer torsemid3;
    private final ModelRenderer leftleg;
    private final ModelRenderer ankle;
    private final ModelRenderer foot;
    private final ModelRenderer rightleg;
    private final ModelRenderer ankle2;
    private final ModelRenderer foot2;

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

        head = new ModelRenderer(this);
        head.setRotationPoint(0.0F, 24.0F, 0.0F);
        head.cubeList.add(new ModelBox(head, 0, 30, -12.0F, -31.0F, -3.0F, 5, 7, 6, 0.0F, false));

        tassle = new ModelRenderer(this);
        tassle.setRotationPoint(0.0F, 0.0F, 0.0F);
        setRotationAngle(tassle, -0.1745F, 0.0F, 0.0F);
        head.addChild(tassle);
        tassle.cubeList.add(new ModelBox(tassle, 16, 30, -6.0F, -23.0F, -8.0F, 1, 3, 1, 0.0F, false));
        tassle.cubeList.add(new ModelBox(tassle, 0, 30, -8.0F, -23.0F, -8.0F, 1, 3, 1, 0.0F, false));

        tassle2 = new ModelRenderer(this);
        tassle2.setRotationPoint(0.0F, 0.0F, 0.0F);
        setRotationAngle(tassle2, 0.0873F, 0.0F, 0.0F);
        tassle.addChild(tassle2);
        tassle2.cubeList.add(new ModelBox(tassle2, 22, 30, -8.0F, -21.0F, -6.0F, 1, 4, 0, 0.0F, false));
        tassle2.cubeList.add(new ModelBox(tassle2, 20, 30, -6.0F, -21.0F, -6.0F, 1, 4, 0, 0.0F, false));

        tassle3 = new ModelRenderer(this);
        tassle3.setRotationPoint(-13.0F, 0.0F, 0.0F);
        setRotationAngle(tassle3, 2.9671F, 0.0F, 3.1416F);
        head.addChild(tassle3);
        tassle3.cubeList.add(new ModelBox(tassle3, 26, 17, -6.0F, -23.0F, -8.0F, 1, 3, 1, 0.0F, false));
        tassle3.cubeList.add(new ModelBox(tassle3, 0, 17, -8.0F, -23.0F, -8.0F, 1, 3, 1, 0.0F, false));

        tassle4 = new ModelRenderer(this);
        tassle4.setRotationPoint(0.0F, 0.0F, 0.0F);
        setRotationAngle(tassle4, 0.0873F, 0.0F, 0.0F);
        tassle3.addChild(tassle4);
        tassle4.cubeList.add(new ModelBox(tassle4, 4, 30, -8.0F, -21.0F, -6.0F, 1, 4, 0, 0.0F, false));
        tassle4.cubeList.add(new ModelBox(tassle4, 4, 17, -6.0F, -21.0F, -6.0F, 1, 4, 0, 0.0F, false));

        torso = new ModelRenderer(this);
        torso.setRotationPoint(0.0F, 20.0F, 0.0F);
        torso.cubeList.add(new ModelBox(torso, 0, 0, -9.0F, -28.0F, -4.0F, 10, 9, 8, 0.0F, false));

        torsemid = new ModelRenderer(this);
        torsemid.setRotationPoint(1.0F, -12.0F, -3.0F);
        setRotationAngle(torsemid, 0.0F, 0.0F, 0.2618F);
        torso.addChild(torsemid);
        torsemid.cubeList.add(new ModelBox(torsemid, 0, 17, -4.0F, -15.0F, 0.0F, 10, 7, 6, 0.0F, false));

        torsemid2 = new ModelRenderer(this);
        torsemid2.setRotationPoint(1.0F, -12.0F, -3.0F);
        setRotationAngle(torsemid2, 0.0F, 0.0F, 1.1345F);
        torso.addChild(torsemid2);
        torsemid2.cubeList.add(new ModelBox(torsemid2, 28, 28, -6.0F, -13.0F, 1.0F, 11, 6, 4, 0.0F, false));

        torsemid3 = new ModelRenderer(this);
        torsemid3.setRotationPoint(1.0F, -12.0F, -3.0F);
        setRotationAngle(torsemid3, 0.0F, 0.0F, 1.2217F);
        torso.addChild(torsemid3);
        torsemid3.cubeList.add(new ModelBox(torsemid3, 32, 11, 3.0F, -14.0F, 0.0F, 4, 7, 6, 0.0F, false));

        leftleg = new ModelRenderer(this);
        leftleg.setRotationPoint(4.0F, 10.0F, -3.0F);
        setRotationAngle(leftleg, 0.0F, 0.0F, 1.0472F);
        leftleg.cubeList.add(new ModelBox(leftleg, 22, 38, 2.0F, -9.0F, -1.0F, 8, 5, 2, 0.0F, false));

        ankle = new ModelRenderer(this);
        ankle.setRotationPoint(0.0F, 0.0F, 0.0F);
        setRotationAngle(ankle, 0.0F, 0.0F, -0.3491F);
        leftleg.addChild(ankle);
        ankle.cubeList.add(new ModelBox(ankle, 0, 43, 8.0F, -3.0F, -1.0F, 3, 9, 1, 0.0F, false));

        foot = new ModelRenderer(this);
        foot.setRotationPoint(0.0F, 0.0F, 0.0F);
        setRotationAngle(foot, 0.0F, 0.0F, 2.4435F);
        ankle.addChild(foot);
        foot.cubeList.add(new ModelBox(foot, 4, 0, -4.0F, -14.0F, -1.0F, 1, 4, 1, 0.0F, false));

        rightleg = new ModelRenderer(this);
        rightleg.setRotationPoint(4.0F, 10.0F, -3.0F);
        setRotationAngle(rightleg, 0.0F, 0.0F, 1.0472F);
        rightleg.cubeList.add(new ModelBox(rightleg, 28, 0, 2.0F, -9.0F, 5.0F, 8, 5, 2, 0.0F, false));

        ankle2 = new ModelRenderer(this);
        ankle2.setRotationPoint(0.0F, 0.0F, 0.0F);
        setRotationAngle(ankle2, 0.0F, 0.0F, -0.3491F);
        rightleg.addChild(ankle2);
        ankle2.cubeList.add(new ModelBox(ankle2, 42, 42, 8.0F, -3.0F, 6.0F, 3, 9, 1, 0.0F, false));

        foot2 = new ModelRenderer(this);
        foot2.setRotationPoint(0.0F, 0.0F, 0.0F);
        setRotationAngle(foot2, 0.0F, 0.0F, 2.4435F);
        ankle2.addChild(foot2);
        foot2.cubeList.add(new ModelBox(foot2, 0, 0, -4.0F, -14.0F, 6.0F, 1, 4, 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);
        torso.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;
    }
}

Your model does not even…
Sun, 12/01/2019 - 10:31

Your model does not even have name defined. Learn to use the modeler you have properly.

Set the model name in modeler before exporting it.