Topic category: Troubleshooting, bugs, and solutions
Hello. So last week i could perfectly add Java entity models to my mod (from Blockbench); but now it does not longer work.
I don't get why. Inside the file the name is correctly added; but when i import it to Mcreator (2020.2) it just shows me this:
''Your model name is not a valid Java name!
Custom mob model names can not contain whitespace.''
But when i look up to the model:
// Made with Blockbench 3.5.0
// Exported for Minecraft version 1.12
// Paste this class into your mod and generate all required imports
public class blue_blaze extends ModelBase {
private final ModelRenderer upperBodyParts0;
private final ModelRenderer upperBodyParts1;
private final ModelRenderer upperBodyParts2;
private final ModelRenderer upperBodyParts3;
private final ModelRenderer upperBodyParts4;
private final ModelRenderer upperBodyParts5;
private final ModelRenderer upperBodyParts6;
private final ModelRenderer upperBodyParts7;
private final ModelRenderer upperBodyParts8;
private final ModelRenderer upperBodyParts9;
private final ModelRenderer upperBodyParts10;
private final ModelRenderer upperBodyParts11;
private final ModelRenderer head;
public blue_blaze() {
textureWidth = 64;
textureHeight = 26;
upperBodyParts0 = new ModelRenderer(this);
upperBodyParts0.setRotationPoint(0.0F, 0.0F, 0.0F);
upperBodyParts0.cubeList.add(new ModelBox(upperBodyParts0, 0, 16, -2.0F, 0.0F, 0.0F, 2, 8, 2, 0.0F, true));
upperBodyParts1 = new ModelRenderer(this);
upperBodyParts1.setRotationPoint(0.0F, 0.0F, 0.0F);
upperBodyParts1.cubeList.add(new ModelBox(upperBodyParts1, 0, 16, -2.0F, 0.0F, 0.0F, 2, 8, 2, 0.0F, true));
upperBodyParts2 = new ModelRenderer(this);
upperBodyParts2.setRotationPoint(0.0F, 0.0F, 0.0F);
upperBodyParts2.cubeList.add(new ModelBox(upperBodyParts2, 0, 16, -2.0F, 0.0F, 0.0F, 2, 8, 2, 0.0F, true));
upperBodyParts3 = new ModelRenderer(this);
upperBodyParts3.setRotationPoint(0.0F, 0.0F, 0.0F);
upperBodyParts3.cubeList.add(new ModelBox(upperBodyParts3, 0, 16, -2.0F, 0.0F, 0.0F, 2, 8, 2, 0.0F, true));
upperBodyParts4 = new ModelRenderer(this);
upperBodyParts4.setRotationPoint(0.0F, 0.0F, 0.0F);
upperBodyParts4.cubeList.add(new ModelBox(upperBodyParts4, 0, 16, -2.0F, 0.0F, 0.0F, 2, 8, 2, 0.0F, true));
upperBodyParts5 = new ModelRenderer(this);
upperBodyParts5.setRotationPoint(0.0F, 0.0F, 0.0F);
upperBodyParts5.cubeList.add(new ModelBox(upperBodyParts5, 0, 16, -2.0F, 0.0F, 0.0F, 2, 8, 2, 0.0F, true));
upperBodyParts6 = new ModelRenderer(this);
upperBodyParts6.setRotationPoint(0.0F, 0.0F, 0.0F);
upperBodyParts6.cubeList.add(new ModelBox(upperBodyParts6, 0, 16, -2.0F, 0.0F, 0.0F, 2, 8, 2, 0.0F, true));
upperBodyParts7 = new ModelRenderer(this);
upperBodyParts7.setRotationPoint(0.0F, 0.0F, 0.0F);
upperBodyParts7.cubeList.add(new ModelBox(upperBodyParts7, 0, 16, -2.0F, 0.0F, 0.0F, 2, 8, 2, 0.0F, true));
upperBodyParts8 = new ModelRenderer(this);
upperBodyParts8.setRotationPoint(0.0F, 0.0F, 0.0F);
upperBodyParts8.cubeList.add(new ModelBox(upperBodyParts8, 0, 16, -2.0F, 0.0F, 0.0F, 2, 8, 2, 0.0F, true));
upperBodyParts9 = new ModelRenderer(this);
upperBodyParts9.setRotationPoint(0.0F, 0.0F, 0.0F);
upperBodyParts9.cubeList.add(new ModelBox(upperBodyParts9, 0, 16, -2.0F, 0.0F, 0.0F, 2, 8, 2, 0.0F, true));
upperBodyParts10 = new ModelRenderer(this);
upperBodyParts10.setRotationPoint(0.0F, 0.0F, 0.0F);
upperBodyParts10.cubeList.add(new ModelBox(upperBodyParts10, 0, 16, -2.0F, 0.0F, 0.0F, 2, 8, 2, 0.0F, true));
upperBodyParts11 = new ModelRenderer(this);
upperBodyParts11.setRotationPoint(0.0F, 0.0F, 0.0F);
upperBodyParts11.cubeList.add(new ModelBox(upperBodyParts11, 0, 16, -2.0F, 0.0F, 0.0F, 2, 8, 2, 0.0F, true));
head = new ModelRenderer(this);
head.setRotationPoint(0.0F, 0.0F, 0.0F);
head.cubeList.add(new ModelBox(head, 0, 0, -4.0F, -4.0F, -4.0F, 8, 8, 8, 0.0F, true));
}
@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
upperBodyParts0.render(f5);
upperBodyParts1.render(f5);
upperBodyParts2.render(f5);
upperBodyParts3.render(f5);
upperBodyParts4.render(f5);
upperBodyParts5.render(f5);
upperBodyParts6.render(f5);
upperBodyParts7.render(f5);
upperBodyParts8.render(f5);
upperBodyParts9.render(f5);
upperBodyParts10.render(f5);
upperBodyParts11.render(f5);
head.render(f5);
}
public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
modelRenderer.rotateAngleX = x;
modelRenderer.rotateAngleY = y;
modelRenderer.rotateAngleZ = z;
}
}
Do you use the latest BlockBench version?
Probably this bug: https://mcreator.net/tracker/issue/60020
And a tip: turn off caps lock when typing the titles ;) I have changed it now, but next time check if the caps lock is on
Okay, sorry for that.
Yeah, it was this bug.
Thank you so much for answering me!
You are welcome! I am glad I could help :) If you like what we do, consider donating to us to help us keep this project up.
For some reason, I've found that just going back into the project and changing the mob geometry name a second time fixes this as well.