Topic category: Help with MCreator software
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;
}
}
Remove the top three sentences that start with //. This is a known bug with Blockbench ever since 3.5.0
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...
In reply to Trolmaso:
This "//" are a tag for comments in Java, this don't affect the code.
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 :)
Remove the comments, they confuse MCreator in 2020.2
i really know, there's many people how they are confused, but there's not available for another user