when importing java custom model nothing happen

Published by imed on Fri, 08/16/2019 - 17:16
Upvotes: 1
Issue description

hi,

it's my first time using mcreator and i created a java model with blockbench and i already fixed the unvalid name problem but when i import the .java file nothing happen

it means it does'nt show an error message but there is no model

Issue comments

does'nt work '-' 

maby the code will help

 

 

//Made with Blockbench
//Paste this code into your mod.

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;

public1class geometry.spider extends ModelBase {
    private final ModelRenderer body0;
    private final ModelRenderer body3;
    private final ModelRenderer body2;
    private final ModelRenderer body1;
    private final ModelRenderer leg0;
    private final ModelRenderer leg1;
    private final ModelRenderer leg2;
    private final ModelRenderer leg3;
    private final ModelRenderer leg4;
    private final ModelRenderer leg5;
    private final ModelRenderer arm0;
    private final ModelRenderer arm1;
    private final ModelRenderer eye0;
    private final ModelRenderer eye1;

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

        body0 = new ModelRenderer(this);
        body0.setRotationPoint(0.0F, 15.0F, 0.0F);

        body3 = new ModelRenderer(this);
        body3.setRotationPoint(0.0F, 9.0F, 0.0F);
        body0.addChild(body3);
        body3.cubeList.add(new ModelBox(body3, 0, 0, -6.0F, -2.0F, -5.0F, 6, 1, 5, 0.0F, true));

        body2 = new ModelRenderer(this);
        body2.setRotationPoint(0.0F, 24.0F, 0.0F);
        body2.cubeList.add(new ModelBox(body2, 18, 28, -5.0F, -3.0F, -4.0F, 4, 1, 3, 0.0F, false));

        body1 = new ModelRenderer(this);
        body1.setRotationPoint(0.0F, 15.0F, 9.0F);
        body1.cubeList.add(new ModelBox(body1, 0, 12, -5.0F, 8.0F, -13.0F, 4, 1, 3, 0.0F, true));

        leg0 = new ModelRenderer(this);
        leg0.setRotationPoint(4.0F, 15.0F, 2.0F);
        leg0.cubeList.add(new ModelBox(leg0, 18, 0, -5.0F, 8.0F, -4.0F, 3, 1, 1, 0.0F, true));

        leg1 = new ModelRenderer(this);
        leg1.setRotationPoint(-4.0F, 15.0F, 2.0F);
        leg1.cubeList.add(new ModelBox(leg1, 18, 0, -4.0F, 8.0F, -4.0F, 3, 1, 1, 0.0F, true));

        leg2 = new ModelRenderer(this);
        leg2.setRotationPoint(4.0F, 15.0F, 1.0F);
        leg2.cubeList.add(new ModelBox(leg2, 18, 0, -5.0F, 8.0F, -4.0F, 3, 1, 1, 0.0F, true));

        leg3 = new ModelRenderer(this);
        leg3.setRotationPoint(-4.0F, 15.0F, 1.0F);
        leg3.cubeList.add(new ModelBox(leg3, 18, 0, -4.0F, 8.0F, -4.0F, 3, 1, 1, 0.0F, true));

        leg4 = new ModelRenderer(this);
        leg4.setRotationPoint(4.0F, 15.0F, 0.0F);
        leg4.cubeList.add(new ModelBox(leg4, 18, 0, -5.0F, 8.0F, -4.0F, 3, 1, 1, 0.0F, true));

        leg5 = new ModelRenderer(this);
        leg5.setRotationPoint(-4.0F, 15.0F, 0.0F);
        leg5.cubeList.add(new ModelBox(leg5, 18, 0, -4.0F, 8.0F, -4.0F, 3, 1, 1, 0.0F, true));

        arm0 = new ModelRenderer(this);
        arm0.setRotationPoint(0.0F, 24.0F, 0.0F);
        arm0.cubeList.add(new ModelBox(arm0, 8, 0, -1.0F, -3.0F, -3.0F, 3, 1, 1, 0.0F, false));
        arm0.cubeList.add(new ModelBox(arm0, 28, 7, 1.0F, -5.0F, -3.0F, 1, 2, 1, 0.0F, false));

        arm1 = new ModelRenderer(this);
        arm1.setRotationPoint(0.0F, 24.0F, 0.0F);
        arm1.cubeList.add(new ModelBox(arm1, 0, 0, -8.0F, -3.0F, -3.0F, 3, 1, 1, 0.0F, false));
        arm1.cubeList.add(new ModelBox(arm1, 28, 15, -8.0F, -5.0F, -3.0F, 1, 2, 1, 0.0F, false));

        eye0 = new ModelRenderer(this);
        eye0.setRotationPoint(0.0F, 24.0F, 0.0F);
        eye0.cubeList.add(new ModelBox(eye0, 0, 30, -2.0F, -3.0F, -5.0F, 1, 1, 1, 0.0F, false));

        eye1 = new ModelRenderer(this);
        eye1.setRotationPoint(0.0F, 24.0F, 0.0F);
        eye1.cubeList.add(new ModelBox(eye1, 5, 30, -5.0F, -3.0F, -5.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) {
        body0.render(f5);
        body2.render(f5);
        body1.render(f5);
        leg0.render(f5);
        leg1.render(f5);
        leg2.render(f5);
        leg3.render(f5);
        leg4.render(f5);
        leg5.render(f5);
        arm0.render(f5);
        arm1.render(f5);
        eye0.render(f5);
        eye1.render(f5);
    }
    public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
        modelRenderer.rotateAngleX = x;
        modelRenderer.rotateAngleY = y;
        modelRenderer.rotateAngleZ = z;
    }
}

public1class geometry.spider

  1. replace public1class with public class, what is 1 doing here?
  2. change geometry.spider to geometryspider, Java does not allow dots in names

i did what you said but it says make sure that all model parts have a valide java name and that your model is in fact java model with a valid syntax

mabe it's because i named some body parts "eye" ??

Part names are OK. Remove the 1 and replace it with space. Or set prope model name in your Modeler and export your model again so the modeler makes this valid for you.

i don't know how to change the name of the model in blockbench it's called geometry.spider because i started modeling with a spider model and even when i extract it again the same error appears

omg it worked 

i changed the name in blockbench like you said

thank you so much!!



Donate to MCreator

By donating to developers you can speed up development, as with more resources, we can dedicate more time to MCreator. It is a free project made by developers working on it in their free time.