Invalid Java Model

Started by TheDuckKnight_Mc on

Topic category: Help with modding (Java Edition)

Last seen on 08:24, 14. Nov 2021
Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Invalid Java Model
Thu, 04/30/2020 - 14:45 (edited)

Ok, so, there are so many other posts like this one, but none of them helped me. When I try to import my .java model into MCreator it shows: Your model name is not a valid java name.

Here's the model code, so someone can help me:

// 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 raft extends EntityModel {
    private final RendererModel loglayer1;
    private final RendererModel loglayer2;
    private final RendererModel seat;

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

        loglayer1 = new RendererModel(this);
        loglayer1.setRotationPoint(0.0F, 24.0F, 0.0F);
        loglayer1.cubeList.add(new ModelBox(loglayer1, 0, 27, 4.0F, -4.0F, -17.0F, 4, 4, 33, 0.0F, false));
        loglayer1.cubeList.add(new ModelBox(loglayer1, 0, 27, -2.0F, -4.0F, -17.0F, 4, 4, 33, 0.0F, false));
        loglayer1.cubeList.add(new ModelBox(loglayer1, 0, 27, -8.0F, -4.0F, -17.0F, 4, 4, 33, 0.0F, false));

        loglayer2 = new RendererModel(this);
        loglayer2.setRotationPoint(0.0F, -4.0F, 0.0F);
        loglayer1.addChild(loglayer2);
        loglayer2.cubeList.add(new ModelBox(loglayer2, 0, 0, -11.0F, -3.0F, -14.0F, 22, 4, 4, 0.0F, false));
        loglayer2.cubeList.add(new ModelBox(loglayer2, 0, 0, -11.0F, -3.0F, -8.0F, 22, 4, 4, 0.0F, false));
        loglayer2.cubeList.add(new ModelBox(loglayer2, 0, 0, -11.0F, -3.0F, -2.0F, 22, 4, 4, 0.0F, false));
        loglayer2.cubeList.add(new ModelBox(loglayer2, 0, 0, -11.0F, -3.0F, 4.0F, 22, 4, 4, 0.0F, false));
        loglayer2.cubeList.add(new ModelBox(loglayer2, 0, 0, -11.0F, -3.0F, 10.0F, 22, 4, 4, 0.0F, false));

        seat = new RendererModel(this);
        seat.setRotationPoint(11.0F, 21.0F, 10.0F);
        
    }

    @Override
    public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
        loglayer1.render(f5);
        seat.render(f5);
    }

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

So please, halp.

Edited by TheDuckKnight_Mc on Thu, 04/30/2020 - 14:45
Last seen on 16:18, 11. Feb 2024
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Try removing the 4 lines at…
Thu, 04/30/2020 - 15:05

Try removing the 4 lines at the top containing comments:

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

https://mcreator.net/forum/60262/issues-and-solutions-when-uploading-java-entities-blockbench-153

Last seen on 08:24, 14. Nov 2021
Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Awmygosh it worked. Thanks :…
Fri, 05/01/2020 - 13:22

Awmygosh it worked. Thanks : )

Last seen on 20:19, 17. May 2020
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This worked, thankyou!
Fri, 05/15/2020 - 23:07

This worked, thankyou!