My .java shematic for a mob doesn't work .

Started by LordGael22 on

Topic category: Help with MCreator software

Joined May 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
My .java shematic for a mob doesn't work .
Sat, 05/04/2019 - 23:52 (edited)

Here is the code of the entity , it just made my mcreator crashed and crashed again :

 

 

//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;

public class goliathspider extends ModelBase {
	private final ModelRenderer Abdomen;
	private final ModelRenderer Base;
	private final ModelRenderer Head;
	private final ModelRenderer Upperhead;
	private final ModelRenderer lefttooth;
	private final ModelRenderer Tooth;
	private final ModelRenderer righttooth;
	private final ModelRenderer Righthand;
	private final ModelRenderer Rightfinger;
	private final ModelRenderer Lefthand;
	private final ModelRenderer Leftfinger;
	private final ModelRenderer Leftarm;
	private final ModelRenderer Legtwo;
	private final ModelRenderer Legthree;
	private final ModelRenderer Rightarm;
	private final ModelRenderer RightLegpack;
	private final ModelRenderer Legthree2;
	private final ModelRenderer Legtwo2;
	private final ModelRenderer Legone;
	private final ModelRenderer LeftLegpack;
	private final ModelRenderer Legsix;
	private final ModelRenderer Legfive;
	private final ModelRenderer Legseven;

	public goliathspider() {
		textureWidth = 186;
		textureHeight = 186;

		Abdomen = new ModelRenderer(this);
		Abdomen.setRotationPoint(0.0F, 24.0F, 0.0F);
		setRotationAngle(Abdomen, -0.0873F, 0.0F, 0.0F);
		Abdomen.cubeList.add(new ModelBox(Abdomen, 0, 60, -12.0F, -23.0F, -1.0F, 24, 16, 33, 0.0F, false));

		Base = new ModelRenderer(this);
		Base.setRotationPoint(0.0F, 24.0F, 0.0F);
		Base.cubeList.add(new ModelBox(Base, 0, 0, -7.0F, -17.0F, -10.0F, 14, 11, 12, 0.0F, false));

		Head = new ModelRenderer(this);
		Head.setRotationPoint(0.0F, 13.0F, -10.0F);
		Head.cubeList.add(new ModelBox(Head, 112, 0, -7.0F, -7.0F, -16.0F, 14, 12, 16, 0.0F, false));
		Head.cubeList.add(new ModelBox(Head, 112, 62, -6.0F, -9.0F, -16.0F, 12, 2, 8, 0.0F, false));
		Head.cubeList.add(new ModelBox(Head, 170, 0, -4.5F, -8.0F, -17.0F, 4, 4, 4, 0.0F, false));
		Head.cubeList.add(new ModelBox(Head, 170, 0, 0.5F, -8.0F, -17.0F, 4, 4, 4, 0.0F, false));

		Upperhead = new ModelRenderer(this);
		Upperhead.setRotationPoint(0.0F, 11.0F, 10.0F);
		setRotationAngle(Upperhead, -0.1745F, 0.0F, 0.0F);
		Head.addChild(Upperhead);
		Upperhead.cubeList.add(new ModelBox(Upperhead, 112, 62, -6.0F, -16.0F, -22.0F, 12, 2, 8, 0.0F, false));

		lefttooth = new ModelRenderer(this);
		lefttooth.setRotationPoint(0.0F, 11.0F, 10.0F);
		setRotationAngle(lefttooth, -0.0873F, 0.0873F, 0.0F);
		Head.addChild(lefttooth);
		lefttooth.cubeList.add(new ModelBox(lefttooth, 1, 176, -2.0F, -10.0F, -30.0F, 4, 7, 3, 0.0F, false));

		Tooth = new ModelRenderer(this);
		Tooth.setRotationPoint(0.0F, 0.0F, 0.0F);
		setRotationAngle(Tooth, 0.0873F, 0.0F, 0.0873F);
		righttooth.addChild(Tooth);
		Tooth.cubeList.add(new ModelBox(Tooth, 6, 31, -0.75F, -7.0F, -29.0F, 1, 3, 1, 0.0F, false));

		righttooth = new ModelRenderer(this);
		righttooth.setRotationPoint(0.0F, 11.0F, 10.0F);
		setRotationAngle(righttooth, -0.0873F, -0.0873F, 0.0F);
		Head.addChild(righttooth);
		righttooth.cubeList.add(new ModelBox(righttooth, 1, 176, -2.0F, -10.0F, -30.0F, 4, 7, 3, 0.0F, false));

		Righthand = new ModelRenderer(this);
		Righthand.setRotationPoint(0.0F, 11.0F, 10.0F);
		setRotationAngle(Righthand, 0.0873F, 0.2618F, 0.1745F);
		Head.addChild(Righthand);
		Righthand.cubeList.add(new ModelBox(Righthand, 170, 62, -3.0F, -13.0F, -31.0F, 2, 2, 6, 0.0F, false));

		Rightfinger = new ModelRenderer(this);
		Rightfinger.setRotationPoint(0.0F, 0.0F, 0.0F);
		setRotationAngle(Rightfinger, -0.3491F, 0.4363F, 0.1745F);
		Righthand.addChild(Rightfinger);
		Rightfinger.cubeList.add(new ModelBox(Rightfinger, 170, 40, 9.0F, -2.0F, -33.0F, 5, 4, 1, 0.0F, false));

		Lefthand = new ModelRenderer(this);
		Lefthand.setRotationPoint(0.0F, 11.0F, 10.0F);
		setRotationAngle(Lefthand, 0.0873F, -0.2618F, -0.1745F);
		Head.addChild(Lefthand);
		Lefthand.cubeList.add(new ModelBox(Lefthand, 170, 62, 1.0F, -13.0F, -31.0F, 2, 2, 6, 0.0F, true));

		Leftfinger = new ModelRenderer(this);
		Leftfinger.setRotationPoint(0.0F, 0.0F, 0.0F);
		setRotationAngle(Leftfinger, -0.3491F, -0.4363F, -0.1745F);
		Lefthand.addChild(Leftfinger);
		Leftfinger.cubeList.add(new ModelBox(Leftfinger, 170, 40, -14.0F, -2.0F, -33.0F, 5, 4, 1, 0.0F, false));

		Leftarm = new ModelRenderer(this);
		Leftarm.setRotationPoint(7.0F, 13.0F, -16.0F);
		setRotationAngle(Leftarm, -0.6981F, 0.6109F, -1.1345F);
		Leftarm.cubeList.add(new ModelBox(Leftarm, 112, 112, -1.0F, -4.0F, 0.0F, 27, 4, 4, 0.0F, true));

		Legtwo = new ModelRenderer(this);
		Legtwo.setRotationPoint(29.0F, 0.0F, 0.0F);
		setRotationAngle(Legtwo, 0.0F, 0.0F, 1.309F);
		Legseven.addChild(Legtwo);
		Legtwo.cubeList.add(new ModelBox(Legtwo, 112, 112, -1.0F, -1.0F, 0.0F, 18, 4, 4, 0.0F, true));

		Legthree = new ModelRenderer(this);
		Legthree.setRotationPoint(16.0F, 0.0F, 0.0F);
		setRotationAngle(Legthree, 0.0F, 0.0F, 0.8727F);
		Legtwo.addChild(Legthree);
		Legthree.cubeList.add(new ModelBox(Legthree, 112, 112, 0.0F, -1.0F, 0.5F, 23, 3, 3, 0.0F, true));

		Rightarm = new ModelRenderer(this);
		Rightarm.setRotationPoint(-7.0F, 13.0F, -16.0F);
		setRotationAngle(Rightarm, -0.6981F, -0.6109F, 1.1345F);
		Rightarm.cubeList.add(new ModelBox(Rightarm, 112, 112, -26.0F, -4.0F, 0.0F, 27, 4, 4, 0.0F, false));

		RightLegpack = new ModelRenderer(this);
		RightLegpack.setRotationPoint(0.0F, 24.0F, 0.0F);

		Legthree2 = new ModelRenderer(this);
		Legthree2.setRotationPoint(-7.0F, -11.0F, -3.0F);
		setRotationAngle(Legthree2, 0.7854F, 0.5236F, 0.7854F);
		RightLegpack.addChild(Legthree2);
		Legthree2.cubeList.add(new ModelBox(Legthree2, 112, 112, -29.0F, -2.0F, 0.0F, 27, 4, 4, 0.0F, false));

		Legtwo2 = new ModelRenderer(this);
		Legtwo2.setRotationPoint(-7.0F, -11.0F, -10.0F);
		setRotationAngle(Legtwo2, -0.3491F, -0.2618F, 0.6109F);
		RightLegpack.addChild(Legtwo2);
		Legtwo2.cubeList.add(new ModelBox(Legtwo2, 112, 112, -26.0F, -2.0F, -2.0F, 25, 4, 4, 0.0F, false));

		Legone = new ModelRenderer(this);
		Legone.setRotationPoint(-7.0F, -11.0F, -5.0F);
		setRotationAngle(Legone, 0.0873F, 0.1745F, 0.6981F);
		RightLegpack.addChild(Legone);
		Legone.cubeList.add(new ModelBox(Legone, 112, 112, -27.0F, -2.0F, -3.0F, 25, 4, 4, 0.0F, false));

		LeftLegpack = new ModelRenderer(this);
		LeftLegpack.setRotationPoint(0.0F, 24.0F, 0.0F);

		Legsix = new ModelRenderer(this);
		Legsix.setRotationPoint(7.0F, -11.0F, -10.0F);
		setRotationAngle(Legsix, -0.3491F, 0.2618F, -0.6109F);
		LeftLegpack.addChild(Legsix);
		Legsix.cubeList.add(new ModelBox(Legsix, 112, 112, 2.0F, -2.0F, -2.0F, 25, 4, 4, 0.0F, true));

		Legfive = new ModelRenderer(this);
		Legfive.setRotationPoint(7.0F, -11.0F, -5.0F);
		setRotationAngle(Legfive, 0.0873F, -0.1745F, -0.6981F);
		LeftLegpack.addChild(Legfive);
		Legfive.cubeList.add(new ModelBox(Legfive, 112, 112, 2.0F, -2.0F, -3.0F, 25, 4, 4, 0.0F, true));

		Legseven = new ModelRenderer(this);
		Legseven.setRotationPoint(7.0F, -11.0F, -3.0F);
		setRotationAngle(Legseven, 0.7854F, -0.5236F, -0.7854F);
		LeftLegpack.addChild(Legseven);
		Legseven.cubeList.add(new ModelBox(Legseven, 112, 112, 2.0F, -2.0F, 0.0F, 27, 4, 4, 0.0F, true));
	}

	@Override
	public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
		Abdomen.render(f5);
		Base.render(f5);
		Head.render(f5);
		Leftarm.render(f5);
		Rightarm.render(f5);
		RightLegpack.render(f5);
		LeftLegpack.render(f5);
	}
	public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
		modelRenderer.rotateAngleX = x;
		modelRenderer.rotateAngleY = y;
		modelRenderer.rotateAngleZ = z;
	}
}

 

Thanks for the help ^^ !

Edited by LordGael22 on Sat, 05/04/2019 - 23:52
Joined May 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
C:\Pylo\MCreator183\forge…
Sun, 05/05/2019 - 17:20

C:\Pylo\MCreator183\forge\build\sources\main\java\mod\mcreator\mcreator_spidergo.java:228: error: variable Legfive might not have been initialized
            Legfive.addChild(Legtwo);
            ^
C:\Pylo\MCreator183\forge\build\sources\main\java\mod\mcreator\mcreator_spidergo.java:233: error: variable Legtwoseven might not have been initialized
            Legtwoseven.addChild(Legthree);
            ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s

Joined May 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So anybody have any idee…
Sun, 05/05/2019 - 23:57

So anybody have any idee about the problem ?

 

Yes, this is a bug from the…
Mon, 05/06/2019 - 15:37

Yes, this is a bug from the modeler you use. Techne is known to make such code which can cause these errors. Use another modeler to make your mob model.

And the compile error is for mob spidergo which seems to be using different mob model based on the error log as the model code you attached above does not contain a part called Legtwoseven.