Custom entity breaks the whole mod

Started by LETMEUSEYOURSOFTWARE on

Topic category: Help with Minecraft modding (Java Edition)

Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Custom entity breaks the whole mod

When I make a custom entity and export the mod it fails to export, does anybody know why?

 

Model file:

 

package net.mcreator.ccgame.client.model;

import net.minecraftforge.client.model.data.ModelData;

import net.minecraft.world.entity.Entity;
import net.minecraft.client.model.geom.ModelPart;
import net.minecraft.client.model.EntityModel;

import com.mojang.blaze3d.vertex.VertexConsumer;

// Made with Blockbench 3.7.4
// Exported for Minecraft version 1.17+ for Yarn
// Paste this class into your mod and generate all required imports
public class Modelcreateddark_madman extends EntityModel<Entity> {
    public final ModelPart waist;
    public final ModelPart body;
    public final ModelPart head;
    public final ModelPart hat;
    public final ModelPart rightArm;
    public final ModelPart rightArm_r1;
    public final ModelPart rightItem;
    public final ModelPart leftArm;
    public final ModelPart rightLeg;
    public final ModelPart leftLeg;

    public Modelcreateddark_madman(ModelPart root) {
        %(model_parts)
    }

    public static TexturedModelData getTexturedModelData() {
        ModelData modelData = new ModelData();
        ModelPartData modelPartData = modelData.getRoot();
        ?(has_no_parent)ModelPartData waist = modelPartData.addChild("waist", ModelPartBuilder.create()
        %(remove_n)
        ?(has_no_rotation)%(remove_n), ModelTransform.pivot(0.0F, 12.0F, 0.0F));
        ?(has_no_parent)ModelPartData body = modelPartData.addChild("body", ModelPartBuilder.create()
        ModelPartData body = waist.addChild("body", ModelPartBuilder.create()
        %(remove_n).uv(0, 0){?(has_mirror).mirrored()}.cuboid(-4.0F, 0.0F, -2.0F, 8.0F, 12.0F, 4.0F, new Dilation(0.0F)){?(has_mirror).mirrored(false)}
        ?(has_no_rotation)%(remove_n), ModelTransform.pivot(0.0F, -12.0F, 0.0F));
        ?(has_no_parent)ModelPartData head = modelPartData.addChild("head", ModelPartBuilder.create()
        ModelPartData head = body.addChild("head", ModelPartBuilder.create()
        %(remove_n).uv(24, 0){?(has_mirror).mirrored()}.cuboid(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, new Dilation(0.0F)){?(has_mirror).mirrored(false)}
        ?(has_no_rotation)%(remove_n), ModelTransform.pivot(0.0F, 0.0F, 0.0F));
        ?(has_no_parent)ModelPartData hat = modelPartData.addChild("hat", ModelPartBuilder.create()
        ModelPartData hat = head.addChild("hat", ModelPartBuilder.create()
        %(remove_n)
        ?(has_no_rotation)%(remove_n), ModelTransform.pivot(0.0F, 0.0F, 0.0F));
        ?(has_no_parent)ModelPartData rightArm = modelPartData.addChild("rightArm", ModelPartBuilder.create()
        ModelPartData rightArm = body.addChild("rightArm", ModelPartBuilder.create()
        %(remove_n)
        ?(has_no_rotation)%(remove_n), ModelTransform.pivot(-5.0F, 2.0F, 0.0F));
        ?(has_no_parent)ModelPartData rightArm_r1 = modelPartData.addChild("rightArm_r1", ModelPartBuilder.create()
        ModelPartData rightArm_r1 = rightArm.addChild("rightArm_r1", ModelPartBuilder.create()
        %(remove_n).uv(56, 0){?(has_mirror).mirrored()}.cuboid(-3.0F, -2.0F, -2.0F, 4.0F, 12.0F, 4.0F, new Dilation(0.0F)){?(has_mirror).mirrored(false)}
        %(remove_n), ModelTransform.of(0.0F, 0.0F, 0.0F, 0.0F, -0.0349F, 0.0F));
        ?(has_no_rotation)%(remove_n), ModelTransform.pivot(0.0F, 0.0F, 0.0F));
        ?(has_no_parent)ModelPartData rightItem = modelPartData.addChild("rightItem", ModelPartBuilder.create()
        ModelPartData rightItem = rightArm.addChild("rightItem", ModelPartBuilder.create()
        %(remove_n)
        ?(has_no_rotation)%(remove_n), ModelTransform.pivot(-1.0F, 7.0F, 1.0F));
        ?(has_no_parent)ModelPartData leftArm = modelPartData.addChild("leftArm", ModelPartBuilder.create()
        ModelPartData leftArm = body.addChild("leftArm", ModelPartBuilder.create()
        %(remove_n).uv(72, 0){?(has_mirror).mirrored()}.cuboid(-1.0F, -2.0F, -2.0F, 4.0F, 12.0F, 4.0F, new Dilation(0.0F)){?(has_mirror).mirrored(false)}
        ?(has_no_rotation)%(remove_n), ModelTransform.pivot(5.0F, 2.0F, 0.0F));
        ?(has_no_parent)ModelPartData rightLeg = modelPartData.addChild("rightLeg", ModelPartBuilder.create()
        ModelPartData rightLeg = body.addChild("rightLeg", ModelPartBuilder.create()
        %(remove_n).uv(88, 0){?(has_mirror).mirrored()}.cuboid(-2.0F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, new Dilation(0.0F)){?(has_mirror).mirrored(false)}
        ?(has_no_rotation)%(remove_n), ModelTransform.pivot(-1.9F, 12.0F, 0.0F));
        ?(has_no_parent)ModelPartData leftLeg = modelPartData.addChild("leftLeg", ModelPartBuilder.create()
        ModelPartData leftLeg = body.addChild("leftLeg", ModelPartBuilder.create()
        %(remove_n).uv(104, 0){?(has_mirror).mirrored()}.cuboid(-1.9F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, new Dilation(0.0F)){?(has_mirror).mirrored(false)}
        ?(has_no_rotation)%(remove_n), ModelTransform.pivot(1.9F, 12.0F, 0.0F));
        return TexturedModelData.of(modelData, 120, 16);
    }

    @Override
    public void setAngles(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
    }

    @Override
    public void render(MatrixStack matrices, VertexConsumer vertexConsumer, int light, int overlay, float red, float green, float blue, float alpha) {
        waist.render(matrices, vertexConsumer, light, overlay, red, green, blue, alpha);
    }

    public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity e) {
        this.head.rotateAngleY = f3 / (180F / (float) Math.PI);
        this.head.rotateAngleX = f4 / (180F / (float) Math.PI);
        this.rightLeg.rotateAngleX = MathHelper.cos(f * 1.0F) * 1.0F * f1;
        this.rightArm.rotateAngleX = MathHelper.cos(f * 0.6662F + (float) Math.PI) * f1;
        this.leftArm.rotateAngleX = MathHelper.cos(f * 0.6662F) * f1;
        this.hat.rotateAngleY = f3 / (180F / (float) Math.PI);
        this.hat.rotateAngleX = f4 / (180F / (float) Math.PI);
        this.leftLeg.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1;
        this.rightItem.rotateAngleX = MathHelper.cos(f * 0.6662F + (float) Math.PI) * f1;
        this.rightArm_r1.rotateAngleX = MathHelper.cos(f * 0.6662F + (float) Math.PI) * f1;
    }
}