So, Im having an Error when Importing Blockbench models.

Started by AirTunafish22 on

Topic category: User side tutorials

Last seen on 14:17, 12. Dec 2022
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So, Im having an Error when Importing Blockbench models.

So, To start off with, I looked at a Forum post. I tried doing what they told us to do, and, low and behold, it didn't work.

The Error Message:

Your Java Name is Not a Valid Java Name!

Custom Mob Model names cannot contain white space, start with number or contain any non ASCII Letters.

Model name is Not Filename, but 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.

The Java Code (Or whatever it is):

// Made with Blockbench 3.5.2
// Exported for Minecraft version 1.14
// Paste this class into your mod and generate all required imports

public class custom_model extends EntityModel {
    private final RendererModel Head;
    private final RendererModel Neck;
    private final RendererModel Body;
    private final RendererModel RightArm;
    private final RendererModel LeftArm;
    private final RendererModel LeftLeg;
    private final RendererModel RightLeg;

    public custom_model() {
        textureWidth = 16;
        textureHeight = 16;

        Head = new RendererModel(this);
        Head.setRotationPoint(0.0F, 24.0F, 0.0F);
        Head.cubeList.add(new ModelBox(Head, 3, 2, -1.0F, -25.0F, 0.0F, 1, 4, 1, 0.0F, false));
        Head.cubeList.add(new ModelBox(Head, 8, 0, -3.0F, -23.0F, 0.0F, 3, 1, 1, 0.0F, false));
        Head.cubeList.add(new ModelBox(Head, 8, 2, -1.0F, -24.0F, 0.0F, 3, 1, 1, 0.0F, false));

        Neck = new RendererModel(this);
        Neck.setRotationPoint(0.0F, 24.0F, 0.0F);
        Neck.cubeList.add(new ModelBox(Neck, 0, 0, -1.0F, -21.0F, 0.0F, 1, 1, 1, 0.0F, false));

        Body = new RendererModel(this);
        Body.setRotationPoint(0.0F, 13.0F, 0.0F);
        Body.cubeList.add(new ModelBox(Body, 8, 8, -2.0F, -4.0F, 0.0F, 3, 4, 1, 0.0F, false));
        Body.cubeList.add(new ModelBox(Body, 8, 4, -2.0F, -9.0F, 0.0F, 3, 4, 1, 0.0F, false));
        Body.cubeList.add(new ModelBox(Body, 0, 2, -1.0F, -5.0F, 0.0F, 1, 1, 1, 0.0F, false));

        RightArm = new RendererModel(this);
        RightArm.setRotationPoint(-2.5F, 10.0F, 0.5F);
        setRotationAngle(RightArm, 0.0F, 0.0F, 0.0873F);
        RightArm.cubeList.add(new ModelBox(RightArm, 0, 1, -0.5F, -6.0F, -0.5F, 1, 14, 1, 0.0F, false));

        LeftArm = new RendererModel(this);
        LeftArm.setRotationPoint(1.0F, 25.0F, 0.0F);
        setRotationAngle(LeftArm, 0.0F, 0.0F, -0.0873F);
        LeftArm.cubeList.add(new ModelBox(LeftArm, 0, 0, 1.0F, -21.0F, 0.0F, 1, 15, 1, 0.0F, false));

        LeftLeg = new RendererModel(this);
        LeftLeg.setRotationPoint(4.0F, 24.0F, 0.0F);
        LeftLeg.cubeList.add(new ModelBox(LeftLeg, 0, 0, -4.0F, -1.0F, -1.0F, 1, 1, 2, 0.0F, false));
        LeftLeg.cubeList.add(new ModelBox(LeftLeg, 0, 0, -4.0F, -11.0F, 0.0F, 1, 10, 1, 0.0F, false));

        RightLeg = new RendererModel(this);
        RightLeg.setRotationPoint(-4.0F, 0.0F, 0.0F);
        LeftLeg.addChild(RightLeg);
        RightLeg.cubeList.add(new ModelBox(RightLeg, 0, 0, -2.0F, -1.0F, -1.0F, 1, 1, 2, 0.0F, false));
        RightLeg.cubeList.add(new ModelBox(RightLeg, 0, 0, -2.0F, -11.0F, 0.0F, 1, 10, 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);
        Neck.render(f5);
        Body.render(f5);
        RightArm.render(f5);
        LeftArm.render(f5);
        LeftLeg.render(f5);
    }

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

Last seen on 14:17, 12. Dec 2022
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you! I appreciate your…
Tue, 05/12/2020 - 17:40

Thank you! I appreciate your help.