is something wrong with the code?? it keeps saying invalid .java name

Started by klushie225 on

Topic category: Help with modding (Java Edition)

Last seen on 23:58, 19. Apr 2021
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
is something wrong with the code?? it keeps saying invalid .java name

I have tried everything i saw on the forums, not one thing helped me. I really am stumped on how to import a java model... here is my code:

// 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 molabear extends EntityModel {
    private final RendererModel leg;
    private final RendererModel legtwo;
    private final RendererModel legthree;
    private final RendererModel legfour;
    private final RendererModel body;
    private final RendererModel head;

    public molabear() {
        textureWidth = 60;
        textureHeight = 60;

        leg = new RendererModel(this);
        leg.setRotationPoint(-8.0F, 24.0F, -8.0F);
        leg.cubeList.add(new ModelBox(leg, 4, 19, 0.0F, -5.0F, 2.0F, 3, 4, 1, 0.0F, false));
        leg.cubeList.add(new ModelBox(leg, 0, 15, 3.0F, -1.0F, 0.0F, -3, 1, 3, 0.0F, false));

        legtwo = new RendererModel(this);
        legtwo.setRotationPoint(8.0F, 24.0F, -8.0F);
        legtwo.cubeList.add(new ModelBox(legtwo, 17, 0, -3.0F, -5.0F, 2.0F, 3, 4, 1, 0.0F, false));
        legtwo.cubeList.add(new ModelBox(legtwo, 16, 9, -3.0F, -1.0F, 0.0F, 3, 1, 3, 0.0F, false));

        legthree = new RendererModel(this);
        legthree.setRotationPoint(-8.0F, 24.0F, -8.0F);
        legthree.cubeList.add(new ModelBox(legthree, 14, 27, 0.0F, -6.0F, 15.0F, 3, 5, 1, 0.0F, false));
        legthree.cubeList.add(new ModelBox(legthree, 26, 0, 3.0F, -1.0F, 13.0F, -3, 1, 3, 0.0F, false));

        legfour = new RendererModel(this);
        legfour.setRotationPoint(-8.0F, 24.0F, -8.0F);
        legfour.cubeList.add(new ModelBox(legfour, 25, 0, 13.0F, -6.0F, 15.0F, 3, 5, 1, 0.0F, false));
        legfour.cubeList.add(new ModelBox(legfour, 7, 15, 16.0F, -1.0F, 13.0F, -3, 1, 3, 0.0F, false));

        body = new RendererModel(this);
        body.setRotationPoint(-5.0F, 19.0F, -6.0F);
        body.cubeList.add(new ModelBox(body, 0, 42, -3.0F, -4.0F, -1.0F, 16, 4, 14, 0.0F, false));

        head = new RendererModel(this);
        head.setRotationPoint(0.0F, 19.0F, -8.0F);
        head.cubeList.add(new ModelBox(head, 38, 0, -3.0F, -5.0F, -1.0F, 6, 6, 4, 0.0F, false));
        head.cubeList.add(new ModelBox(head, 2, 15, -2.0F, -2.0F, -2.0F, 4, 1, 1, 0.0F, false));
        head.cubeList.add(new ModelBox(head, 43, 20, -4.0F, -3.0F, -2.0F, 1, 1, 1, 0.0F, false));
        head.cubeList.add(new ModelBox(head, 43, 20, 3.0F, -3.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) {
        leg.render(f5);
        legtwo.render(f5);
        legthree.render(f5);
        legfour.render(f5);
        body.render(f5);
        head.render(f5);
    }

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

 

 

thank you

Last seen on 11:37, 14. May 2020
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Remove the comments at the…
Wed, 05/13/2020 - 04:13

Remove the comments at the top - this part:

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

You may need to remove the blank line before "public class molabear..." too, not sure.

Just ran into this myself