mcreator your model name is not a valid java name!

Started by Köftespiess on

Topic category: Help with modding (Java Edition)

Last seen on 22:25, 3. May 2020
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
mcreator your model name is not a valid java name!

I've searched for a long time what is wrong but I have found nothing can anyone help me here is the code:

(Im new in programming)

 

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

public class duck extends ModelEntity {

    private final RendererModel body;
    private final RendererModel wing_right;
    private final RendererModel wing_left;
    private final RendererModel head_top;
    private final RendererModel head_bottom;
    private final RendererModel beak;
    private final RendererModel foot_left;
    private final RendererModel foot_right;

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

        body = new RendererModel(this);
        body.setRotationPoint(1.0F, 22.0F, 0.0F);
        body.cubeList.add(new ModelBox(body, 12, 7, -5.0F, -3.0F, 0.0F, 5, 3, -3, 0.0F, false));

        wing_right = new RendererModel(this);
        wing_right.setRotationPoint(1.0F, 22.0F, 0.0F);
        wing_right.cubeList.add(new ModelBox(wing_right, 0, 9, -6.0F, -3.0F, 0.0F, 5, 2, 1, 0.0F, false));

        wing_left = new RendererModel(this);
        wing_left.setRotationPoint(1.0F, 22.0F, 0.0F);
        wing_left.cubeList.add(new ModelBox(wing_left, 0, 9, -6.0F, -3.0F, -4.0F, 5, 2, 1, 0.0F, false));

        head_top = new RendererModel(this);
        head_top.setRotationPoint(1.0F, 22.0F, 0.0F);
        head_top.cubeList.add(new ModelBox(head_top, 0, 0, -1.0F, -6.0F, -3.0F, 2, 3, 3, 0.0F, false));

        head_bottom = new RendererModel(this);
        head_bottom.setRotationPoint(2.0F, 19.0F, -3.0F);
        head_bottom.cubeList.add(new ModelBox(head_bottom, 0, 3, -1.0F, 0.0F, 0.0F, 1, 2, 3, 0.0F, false));

        beak = new RendererModel(this);
        beak.setRotationPoint(2.0F, 21.0F, -3.0F);
        beak.cubeList.add(new ModelBox(beak, 0, 12, 0.0F, -4.0F, 0.0F, 1, 1, 3, 0.0F, false));

        foot_left = new RendererModel(this);
        foot_left.setRotationPoint(0.0F, 24.0F, -3.0F);
        foot_left.cubeList.add(new ModelBox(foot_left, 8, 13, -2.0F, -2.0F, 0.0F, 1, 2, 1, 0.0F, false));
        foot_left.cubeList.add(new ModelBox(foot_left, 8, 14, -1.0F, -1.0F, 0.0F, 1, 1, 1, 0.0F, false));

        foot_right = new RendererModel(this);
        foot_right.setRotationPoint(2.0F, 21.0F, -3.0F);
        foot_right.cubeList.add(new ModelBox(foot_right, 8, 13, -4.0F, 1.0F, 2.0F, 1, 2, 1, 0.0F, false));
        foot_right.cubeList.add(new ModelBox(foot_right, 8, 14, -3.0F, 2.0F, 2.0F, 1, 1, 1, 0.0F, false));
    }

    @Override
    public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
        body.render(f5);
        wing_right.render(f5);
        wing_left.render(f5);
        head_top.render(f5);
        head_bottom.render(f5);
        beak.render(f5);
        foot_left.render(f5);
        foot_right.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 22:41, 29. Dec 2021
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hmmm. "duck" is a valid java…
Mon, 04/27/2020 - 12:43

Hmmm. "duck" is a valid java name and its not reserved either. Maybe its a glitch. Try naming it something else.

Also, are you sure it said: "your model name is not a valid java name!"?

Last seen on 22:25, 3. May 2020
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks for helping it works…
Tue, 04/28/2020 - 22:05

Thanks for helping it works now :)