Model name is not a valid Java name

Started by Calf on

Topic category: Help with MCreator software

Last seen on 04:17, 29. May 2020
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Model name is not a valid Java name

Model name is not a valid Java name Help!
Me Code:
 

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

public class geometry.zombie extends EntityModel<Entity> {
    private final ModelRenderer body;
    private final ModelRenderer leftArm;
    private final ModelRenderer rightArm;

    public geometry.zombie() {
        textureWidth = 64;
        textureHeight = 32;

        body = new ModelRenderer(this);
        body.setRotationPoint(0.0F, 0.0F, 0.0F);
        body.setTextureOffset(0, 0).addBox(-4.0F, 0.0F, -3.0F, 8.0F, 13.0F, 6.0F, 0.0F, false);

        leftArm = new ModelRenderer(this);
        leftArm.setRotationPoint(-5.0F, 2.0F, 0.0F);
        leftArm.setTextureOffset(0, 0).addBox(-4.0F, -2.0F, -3.0F, 5.0F, 12.0F, 6.0F, 0.0F, false);

        rightArm = new ModelRenderer(this);
        rightArm.setRotationPoint(5.0F, 2.0F, 0.0F);
        rightArm.setTextureOffset(0, 0).addBox(-1.0F, -2.0F, -3.0F, 5.0F, 12.0F, 6.0F, 0.0F, false);
    }

    @Override
    public void setRotationAngles(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch){
        //previously the render function, render code was moved to a method below
    }

    @Override
    public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha){
        body.render(matrixStack, buffer, packedLight, packedOverlay);
        leftArm.render(matrixStack, buffer, packedLight, packedOverlay);
        rightArm.render(matrixStack, buffer, packedLight, packedOverlay);
    }

    public void setRotationAngle(ModelRenderer 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:
Remove the top three…
Sat, 05/09/2020 - 12:00

Remove the top three sentences that start with //.  This is a known bug with Blockbench ever since 3.5.0

Last seen on 18:16, 20. Oct 2021
Joined Aug 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
In reply to Calf: Put this…
Sat, 05/09/2020 - 15:02

In reply to Calf:
Put this on the start of the code:
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;

It is the import code that Blockbench placed manually, I think they removed it on purpose for the user to place if they want...

Last seen on 18:16, 20. Oct 2021
Joined Aug 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
In reply to Trolmaso: This "…
Sat, 05/09/2020 - 15:04

In reply to Trolmaso:
This "//" are a tag for comments in Java, this don't affect the code.

Last seen on 22:41, 29. Dec 2021
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
In reply to Igor, I know…
Sat, 05/09/2020 - 15:21

In reply to Igor,

I know that, but there are forums and support tickets that have the same problem and one of  the solutions is just simply deleting it for some reason. I don’t know why, but it is according to the first forum that had the problem. It’s weird but at least it works :)

Last seen on 18:30, 9. Mar 2024
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i really know, there's many…
Mon, 01/18/2021 - 17:50

i really know, there's many people how they are confused, but there's not available for another user