Your model name is not a valid Java name

Started by Endercreeper997 on

Topic category: Help with MCreator software

Last seen on 14:10, 13. Nov 2020
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Your model name is not a valid Java name
Tue, 07/30/2019 - 09:01 (edited)

I am very frustrated. I finally find a way to make custom mob models, and now I can't even use them. I am using an application called blockbench. Whenever I try to import my model, it says the name isn't valid. I have changed the name multiple times, to fit the requirements, and I don't understand why it is still wrong. there is no numbers at the beginning off the name, no whitespace, and all the letters are valid ASCII! the name is literally np.java! 

Edited by Endercreeper997 on Tue, 07/30/2019 - 09:01
Last seen on 14:10, 13. Nov 2020
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
ok, then how do I change the…
Tue, 07/30/2019 - 15:35

ok, then how do I change the code name?

In the code, on the search…
Tue, 07/30/2019 - 15:36

In the code, on the search page I linked to you have tens of pages where this is explained.

Last seen on 14:10, 13. Nov 2020
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
ok. sorry I only looked at…
Tue, 07/30/2019 - 15:46

ok. sorry I only looked at the first one

 

Last seen on 14:10, 13. Nov 2020
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
sorry, Im very new to coding…
Tue, 07/30/2019 - 15:50

sorry, Im very new to coding. where do I go to rename them? I didn't really understand the answers. im on a Mac as well, so it might be different than the answers you gave me

The Mac is the same, open…
Tue, 07/30/2019 - 16:19

The Mac is the same, open model file with text editor. You can paste the contents here and I can try to help you. You could change model name in your modeler too and export it properly.

Last seen on 14:10, 13. Nov 2020
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
import org.lwjgl.opengl.GL11…
Tue, 07/30/2019 - 16:52

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;

public class Normal Phoot extends ModelBase {
    private final ModelRenderer group;

    public Normal Phoot() {
        textureWidth = 16;
        textureHeight = 16;

        group = new ModelRenderer(this);
        group.setRotationPoint(-8.0F, 16.0F, 8.0F);
        group.cubeList.add(new ModelBox(group, 0, 0, 5.0F, 3.0F, -8.0F, 4, 5, 4, 0.0F, false));
        group.cubeList.add(new ModelBox(group, 0, 1, 5.0F, 6.0F, -8.5F, 0, 0, 0, 0.0F, false));
        group.cubeList.add(new ModelBox(group, 0, 0, 8.5F, 6.0F, -8.5F, 0, 0, 0, 0.0F, false));
    }

    @Override
    public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
        group.render(f5);
    }
    public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
        modelRenderer.rotateAngleX = x;
        modelRenderer.rotateAngleY = y;
        modelRenderer.rotateAngleZ = z;
    }
}

 

is this what im supposed to use for my mod? it says to paste it in

Last seen on 14:10, 13. Nov 2020
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
do I just change the name to…
Tue, 07/30/2019 - 16:54

do I just change the name to not have spaces?

 

Last seen on 14:10, 13. Nov 2020
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
never mind! it works! I…
Tue, 07/30/2019 - 16:56

never mind! it works! I changed the name to not have spaces, and now I can add it! Thanks for your help! :)

Last seen on 14:43, 2. Aug 2022
Joined Nov 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
A tip use underscores(_) …
Tue, 07/30/2019 - 17:52

A tip use underscores(_)  instead of spaces!

For naming instead of spaces…
Tue, 07/30/2019 - 18:32

For naming instead of spaces like this, use camel case naming, which is a standard for Java.

Instead of

My custom model

use

MyCustomModel

Last seen on 14:10, 13. Nov 2020
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
thanks!
Wed, 07/31/2019 - 00:30

thanks!

Last seen on 01:57, 10. Dec 2022
Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
pls help theres no spaces in…
Sun, 09/01/2019 - 13:30

pls help theres no spaces in my name t's just ghost.java and it cant work