Problem with the parts and members of the Java model made in BlockBench

Published by Bielsaurus on Wed, 04/29/2020 - 17:03
Status
Resolved
Type
Product/platform
MCreator/Windows
Priority
Normal
Issue description

Hello!
I made a model in the BlockBench program and everything went well within the program and when exporting, but when I put the entity model in the game it has duplicate and mismatched parts as I showed in the photos. I have no idea if it's a modeling, export or even programming problem, since what I did is quite simple, I just took the model and kicked it into the game practically...

Model file:
 

Sorry if there is already a topic about it, I tried to find it and I couldn't, thank you in advance if you can help!

Attachment Size
what.png629.24 KB 629.24 KB
model.png132.25 KB 132.25 KB
dollfacemodel_0.java8.42 KB 8.42 KB

Issue comments

The broken model is a result of the modeler problem. Make sure to use entity java model type.

MCreator only imports model code.

I suggest consulting with modeler devs.

Hello again!

I talked to the program support and they recommended replacing some terms at the end of the Java model file:

public void setRotationAngle (ModelRenderer modelRenderer, float x, float y, float z) {
modelRenderer.rotateAngleX = x * (Math.PI / 180F);
modelRenderer.rotateAngleY = y * (Math.PI / 180F);
modelRenderer.rotateAngleZ = z * (Math.PI / 180F);
}

But MCreator for some reason is not recognizing, do you know why?

It could be this: https://mcreator.net/tracker/issue/60092

Submitted by akamashi on Tue, 04/28/2020

infact the problem came from the exporter plugin of blockbench: I used to select "JAVA model" because the exporter plugin "JAVA entity" didn't works (invalid java name, but my name was correct). but thanks the link you gave me, I understood that the problem of this plugin was in the code (we have to remove the 1st, 2sd and 3th lines of the code make by blockbench).

 

so, now i use the corrcect exporter plugin (JAVA entity) and i know how to use it. 

use the plugin "JAVA model" wasn't the things to do... 

Oh yes, I had already seen these links and worked around some other mistakes for him. According to BlockBench support they have the following problem: "There is currently an issue in the 1.14 and 1.12 exporter that exports rotations as degrees instead of radians."

Then a dice member who normally uses this code above to get around this rotation problem, but for some reason MCreator doesn't recognize it.
public class custom_model extends ModelBase {
    private final ModelRenderer corpo;
    private final ModelRenderer cabeca;
    private final ModelRenderer cabelo;
    private final ModelRenderer cabelo2;
    private final ModelRenderer cabelo3;
    private final ModelRenderer pernaesquerda;
    private final ModelRenderer bone2;
    private final ModelRenderer pernadireita;
    private final ModelRenderer bone;
    private final ModelRenderer bracosecdireito;
    private final ModelRenderer bracosecdireito1;
    private final ModelRenderer bracosecdireito2;
    private final ModelRenderer ligacaodireita;
    private final ModelRenderer ombrodireito;
    private final ModelRenderer bracodireito1;
    private final ModelRenderer bracodireito2;
    private final ModelRenderer ombroesquerdo;
    private final ModelRenderer bracoesquerdo1;
    private final ModelRenderer bracoesquerdo2;
    private final ModelRenderer bracosecdireito3;
    private final ModelRenderer bracosecdireito4;
    private final ModelRenderer bracosecdireito5;
    private final ModelRenderer ligacaodireita2;

    public custom_model() {
        textureWidth = 128;
        textureHeight = 128;

        corpo = new ModelRenderer(this);
        corpo.setRotationPoint(0.0F, -36.0F, -1.25F);
        setRotationAngle(corpo, 5.0F, 0.0F, 0.0F);
        corpo.cubeList.add(new ModelBox(corpo, 0, 6, -4.5F, -14.78F, -1.7117F, 9, 29, 3, 0.0F, false));

        cabeca = new ModelRenderer(this);
        cabeca.setRotationPoint(0.0F, -7.78F, -2.2117F);
        corpo.addChild(cabeca);
        setRotationAngle(cabeca, 5.0F, 0.0F, 0.0F);
        cabeca.cubeList.add(new ModelBox(cabeca, 40, 40, -3.0F, -2.5947F, -2.7163F, 6, 6, 3, 0.0F, false));

        cabelo = new ModelRenderer(this);
        cabelo.setRotationPoint(-2.5F, 2.9053F, 2.7837F);
        cabeca.addChild(cabelo);
        cabelo.cubeList.add(new ModelBox(cabelo, 24, 19, -1.5F, -6.4772F, -4.9771F, 8, 1, 2, 0.0F, false));

        cabelo2 = new ModelRenderer(this);
        cabelo2.setRotationPoint(4.0F, 0.9282F, 1.3067F);
        cabeca.addChild(cabelo2);
        setRotationAngle(cabelo2, 0.0F, 0.0F, 85.0F);
        cabelo2.cubeList.add(new ModelBox(cabelo2, 24, 15, -3.827F, -0.4849F, -3.5152F, 11, 1, 3, 0.0F, false));

        cabelo3 = new ModelRenderer(this);
        cabelo3.setRotationPoint(-3.6972F, 0.8977F, 1.3067F);
        cabeca.addChild(cabelo3);
        setRotationAngle(cabelo3, 0.0F, 0.0F, 95.0F);
        cabelo3.cubeList.add(new ModelBox(cabelo3, 24, 10, -3.827F, -0.5151F, -3.5152F, 11, 1, 3, 0.0F, false));

        pernaesquerda = new ModelRenderer(this);
        pernaesquerda.setRotationPoint(4.0F, -21.0F, -1.0F);
        setRotationAngle(pernaesquerda, -5.0F, 0.0F, -5.0F);
        pernaesquerda.cubeList.add(new ModelBox(pernaesquerda, 16, 39, -1.6972F, -2.0608F, -0.3054F, 2, 20, 1, 0.0F, false));

        bone2 = new ModelRenderer(this);
        bone2.setRotationPoint(-0.7049F, 18.3743F, 1.7212F);
        pernaesquerda.addChild(bone2);
        setRotationAngle(bone2, 10.0F, 0.0F, 5.0F);
        bone2.cubeList.add(new ModelBox(bone2, 24, 28, -1.448F, -1.8136F, -1.6163F, 2, 29, 1, 0.0F, false));

        pernadireita = new ModelRenderer(this);
        pernadireita.setRotationPoint(-4.0F, -21.0F, -1.0F);
        setRotationAngle(pernadireita, -5.0F, 0.0F, 5.0F);
        pernadireita.cubeList.add(new ModelBox(pernadireita, 8, 39, -0.3028F, -2.0608F, -0.3054F, 2, 20, 1, 0.0F, false));

        bone = new ModelRenderer(this);
        bone.setRotationPoint(0.7049F, 18.3743F, 0.7212F);
        pernadireita.addChild(bone);
        setRotationAngle(bone, 10.0F, 0.0F, -5.0F);
        bone.cubeList.add(new ModelBox(bone, 32, 32, -0.552F, -1.6399F, -0.6314F, 2, 29, 2, 0.0F, false));

        bracosecdireito = new ModelRenderer(this);
        bracosecdireito.setRotationPoint(-5.0F, -54.5F, -3.5F);
        setRotationAngle(bracosecdireito, 0.0F, 0.0F, -15.0F);
        bracosecdireito.cubeList.add(new ModelBox(bracosecdireito, 58, 10, -1.0F, -4.5F, -0.5F, 1, 9, 2, 0.0F, false));

        bracosecdireito1 = new ModelRenderer(this);
        bracosecdireito1.setRotationPoint(-1.2941F, -4.1704F, 2.0F);
        bracosecdireito.addChild(bracosecdireito1);
        setRotationAngle(bracosecdireito1, 15.0F, 0.0F, 0.0F);
        bracosecdireito1.cubeList.add(new ModelBox(bracosecdireito1, 58, 36, -1.0F, -0.8243F, -0.2612F, 1, 16, 1, 0.0F, false));

        bracosecdireito2 = new ModelRenderer(this);
        bracosecdireito2.setRotationPoint(-0.4504F, 15.0878F, 0.5217F);
        bracosecdireito1.addChild(bracosecdireito2);
        setRotationAngle(bracosecdireito2, -15.0F, 0.0F, 15.0F);
        bracosecdireito2.cubeList.add(new ModelBox(bracosecdireito2, 4, 39, -0.6201F, -0.4513F, -0.5479F, 1, 25, 1, 0.0F, false));

        ligacaodireita = new ModelRenderer(this);
        ligacaodireita.setRotationPoint(-3.8637F, 0.9647F, 0.5F);
        bracosecdireito.addChild(ligacaodireita);
        setRotationAngle(ligacaodireita, 0.0F, 0.0F, 25.0F);
        ligacaodireita.cubeList.add(new ModelBox(ligacaodireita, 48, 49, -1.0F, -7.0F, -0.5F, 2, 15, 1, 0.0F, false));

        ombrodireito = new ModelRenderer(this);
        ombrodireito.setRotationPoint(-3.0F, -50.0F, -3.0F);
        setRotationAngle(ombrodireito, 0.0F, 0.0F, -45.0F);
        ombrodireito.cubeList.add(new ModelBox(ombrodireito, 40, 32, -9.0F, -2.0F, -1.0F, 8, 2, 2, 0.0F, false));

        bracodireito1 = new ModelRenderer(this);
        bracodireito1.setRotationPoint(-10.6569F, 1.8284F, 0.0F);
        ombrodireito.addChild(bracodireito1);
        setRotationAngle(bracodireito1, 0.0F, -5.0F, -50.0F);
        bracodireito1.cubeList.add(new ModelBox(bracodireito1, 24, 6, -14.0F, -1.0F, -1.0F, 18, 2, 2, 0.0F, false));

        bracodireito2 = new ModelRenderer(this);
        bracodireito2.setRotationPoint(-13.6003F, -0.3493F, -0.1463F);
        bracodireito1.addChild(bracodireito2);
        setRotationAngle(bracodireito2, 0.0F, 10.0F, -5.0F);
        bracodireito2.cubeList.add(new ModelBox(bracodireito2, 0, 3, -40.9975F, 0.3968F, -1.2579F, 42, 1, 1, 0.0F, false));

        ombroesquerdo = new ModelRenderer(this);
        ombroesquerdo.setRotationPoint(3.0F, -50.0F, -3.0F);
        setRotationAngle(ombroesquerdo, 0.0F, 0.0F, 45.0F);
        ombroesquerdo.cubeList.add(new ModelBox(ombroesquerdo, 32, 28, 1.0F, -2.0F, -1.0F, 8, 2, 2, 0.0F, false));

        bracoesquerdo1 = new ModelRenderer(this);
        bracoesquerdo1.setRotationPoint(10.6569F, 1.8284F, 0.0F);
        ombroesquerdo.addChild(bracoesquerdo1);
        setRotationAngle(bracoesquerdo1, 0.0F, 5.0F, 50.0F);
        bracoesquerdo1.cubeList.add(new ModelBox(bracoesquerdo1, 24, 24, -4.0F, -1.0F, -1.0F, 18, 2, 2, 0.0F, false));

        bracoesquerdo2 = new ModelRenderer(this);
        bracoesquerdo2.setRotationPoint(13.6003F, 0.6507F, -0.1463F);
        bracoesquerdo1.addChild(bracoesquerdo2);
        setRotationAngle(bracoesquerdo2, 0.0F, -10.0F, 5.0F);
        bracoesquerdo2.cubeList.add(new ModelBox(bracoesquerdo2, 0, 0, -1.0883F, -0.5993F, -1.2427F, 42, 1, 2, 0.0F, false));

        bracosecdireito3 = new ModelRenderer(this);
        bracosecdireito3.setRotationPoint(5.0F, -54.5F, -3.5F);
        setRotationAngle(bracosecdireito3, 0.0F, 0.0F, 15.0F);
        bracosecdireito3.cubeList.add(new ModelBox(bracosecdireito3, 52, 10, 0.0F, -4.5F, -0.5F, 1, 9, 2, 0.0F, false));

        bracosecdireito4 = new ModelRenderer(this);
        bracosecdireito4.setRotationPoint(1.2941F, -4.1704F, 2.0F);
        bracosecdireito3.addChild(bracosecdireito4);
        setRotationAngle(bracosecdireito4, 15.0F, 0.0F, 0.0F);
        bracosecdireito4.cubeList.add(new ModelBox(bracosecdireito4, 56, 56, 0.0F, -0.8243F, -0.2612F, 1, 16, 1, 0.0F, false));

        bracosecdireito5 = new ModelRenderer(this);
        bracosecdireito5.setRotationPoint(0.4504F, 15.0878F, 0.5217F);
        bracosecdireito4.addChild(bracosecdireito5);
        setRotationAngle(bracosecdireito5, -15.0F, 0.0F, -15.0F);
        bracosecdireito5.cubeList.add(new ModelBox(bracosecdireito5, 0, 39, -0.3799F, -0.4513F, -0.5479F, 1, 25, 1, 0.0F, false));

        ligacaodireita2 = new ModelRenderer(this);
        ligacaodireita2.setRotationPoint(3.8637F, 0.9647F, 0.5F);
        bracosecdireito3.addChild(ligacaodireita2);
        setRotationAngle(ligacaodireita2, 0.0F, 0.0F, -25.0F);
        ligacaodireita2.cubeList.add(new ModelBox(ligacaodireita2, 40, 49, -1.0F, -7.0F, -0.5F, 2, 15, 1, 0.0F, false));
    }

    @Override
    public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
        corpo.render(f5);
        cabeca.render(f5);
        cabelo.render(f5);
        cabelo2.render(f5);
        cabelo3.render(f5);
        pernaesquerda.render(f5);
        bone2.render(f5);
        pernadireita.render(f5);
        bone.render(f5);
        bracosecdireito.render(f5);
        bracosecdireito1.render(f5);
        bracosecdireito2.render(f5);
        ligacaodireita.render(f5);
        ombrodireito.render(f5);
        bracodireito1.render(f5);
        bracodireito2.render(f5);
        ombroesquerdo.render(f5);
        bracoesquerdo1.render(f5);
        bracoesquerdo2.render(f5);
        bracosecdireito3.render(f5);
        bracosecdireito4.render(f5);
        bracosecdireito5.render(f5);
        ligacaodireita2.render(f5);
    }

    public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
        modelRenderer.rotateAngleX = x * (Math.PI/180F);
        modelRenderer.rotateAngleY = y * (Math.PI/180F);
        modelRenderer.rotateAngleZ = z * (Math.PI/180F);
    }
}
 

I suggest you modify the code of the actual mod element after the model is selected.

Or wait for blockbech devs to fix it.

so, now i use the corrcect exporter plugin (JAVA entity) and i know how to use it. 

This did not help, the other user reported this helped?

Not because it is not the same problem, his problem was that the model could not be loaded by MCreator because it has comment lines at the top, my problem is with the rotation of the model parts. Anyway thank you.



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.