Custom entity model causes problems

Started by Chargonium on

Topic category: Help with modding (Java Edition)

Last seen on 14:36, 31. Oct 2021
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Custom entity model causes problems

I am trying to make a custom entity model but in the console it outputs a lot of errors(most of them are pretty much the same though)

one of the errors is:: 

C:\Users\Sven Van Doorn\MCreatorWorkspaces\stevepowers\src\main\java\net\mcreator\stevepowers\entity\renderer\DarknessRenderer.java:64: error: cannot find symbol

 

The code the error is in:
 

package net.mcreator.stevepowers.entity.renderer;

import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.api.distmarker.Dist;

import net.minecraft.util.ResourceLocation;
import net.minecraft.entity.Entity;
import net.minecraft.client.renderer.entity.model.EntityModel;
import net.minecraft.client.renderer.entity.MobRenderer;

import net.mcreator.stevepowers.entity.DarknessEntity;

@OnlyIn(Dist.CLIENT)
public class DarknessRenderer {
	public static class ModelRegisterHandler {
		@SubscribeEvent
		@OnlyIn(Dist.CLIENT)
		public void registerModels(ModelRegistryEvent event) {
			RenderingRegistry.registerEntityRenderingHandler(DarknessEntity.entity, renderManager -> {
				return new MobRenderer(renderManager, new Modelidk(), 0.5f) {
					@Override
					public ResourceLocation getEntityTexture(Entity entity) {
						return new ResourceLocation("stevepowers:textures/rainbow-quest-darkness-14562361.png");
					}
				};
			});
		}
	}

	// Made with Blockbench 4.0.3
	// Exported for Minecraft version 1.17 with Mojang mappings
	// Paste this class into your mod and generate all required imports
	public static class Modelidk<T extends Entity> extends EntityModel<T> {
		// This layer location should be baked with EntityRendererProvider.Context in
		// the entity renderer and passed into this model's constructor
		public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(new ResourceLocation("modid", "idk"), "main");
		private final ModelPart bb_main;
		public Modelidk(ModelPart root) {
			this.bb_main = root.getChild("bb_main");
		}

		public static LayerDefinition createBodyLayer() {
			MeshDefinition meshdefinition = new MeshDefinition();
			PartDefinition partdefinition = meshdefinition.getRoot();
			PartDefinition bb_main = partdefinition.addOrReplaceChild(
					"bb_main", CubeListBuilder.create().texOffs(0, 0).addBox(-6.0F, -22.0F, -4.0F, 5.0F, 22.0F, 8.0F, new CubeDeformation(0.0F))
							.texOffs(0, 0).addBox(-8.0F, -32.0F, -6.0F, 9.0F, 10.0F, 12.0F, new CubeDeformation(0.0F)),
					PartPose.offset(0.0F, 24.0F, 0.0F));
			PartDefinition ArmTwo_r1 = bb_main.addOrReplaceChild("ArmTwo_r1",
					CubeListBuilder.create().texOffs(0, 0).addBox(-22.0F, -5.0F, 4.0F, 5.0F, 13.0F, 4.0F, new CubeDeformation(0.0F)).texOffs(0, 0)
							.addBox(-22.0F, -5.0F, -8.0F, 5.0F, 13.0F, 4.0F, new CubeDeformation(0.0F)),
					PartPose.offsetAndRotation(2.0F, 0.0F, 0.0F, 0.0F, 0.0F, 1.5708F));
			return LayerDefinition.create(meshdefinition, 32, 16);
		}

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

		@Override
		public void renderToBuffer(PoseStack poseStack, VertexConsumer buffer, int packedLight, int packedOverlay, float red, float green, float blue,
				float alpha) {
			bb_main.render(poseStack, buffer, packedLight, packedOverlay);
		}

		public void setRotationAngles(Entity e, float f, float f1, float f2, float f3, float f4) {
		}
	}
}

 

Last seen on 15:24, 24. Apr 2024
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Blockbench ? If you use…
Thu, 10/28/2021 - 19:09

Blockbench ?

If you use Blockbench then this was already asked 4 times yesterday

Please check yesterday's forum and you will have your fix

Last seen on 14:36, 31. Oct 2021
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can you maybe post a link…
Fri, 10/29/2021 - 09:06

Can you maybe post a link then because i cannot find it

 

Last seen on 15:24, 24. Apr 2024
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It's the post just below…
Fri, 10/29/2021 - 09:33

It's the post just below yours. You don't find it since you have even not searched for it

Last seen on 14:36, 31. Oct 2021
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
or you could just have copy…
Fri, 10/29/2021 - 14:21

or you could just have copy and pasted the solution into here and then i could have seen it immidiatly and you then would also not need to post that second comment in here.

but i already saw the solution you posted there

 

Last seen on 20:27, 24. Apr 2024
Joined Jan 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Since people will find this…
Thu, 02/17/2022 - 09:05

Since people will find this thread like me posting the solution here would have been pretty beneficial...

Last seen on 06:59, 17. Apr 2022
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
where is the solution?  
Tue, 03/29/2022 - 09:47

where is the solution?