Jump to content

How can I render the custom entity so that it can hold objects in its hands?


Recommended Posts

Posted

renderer :

package net.mcreator.additionaladventure.entity.renderer;

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

import net.minecraft.util.math.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.entity.Entity;
import net.minecraft.client.renderer.model.ModelRenderer;
import net.minecraft.client.renderer.entity.model.EntityModel;
import net.minecraft.client.renderer.entity.layers.HeldItemLayer;
import net.minecraft.client.renderer.entity.MobRenderer;
import net.minecraft.client.renderer.entity.EntityRendererManager;

import net.mcreator.additionaladventure.entity.SkySkeletonEntity;

import com.mojang.blaze3d.vertex.IVertexBuilder;
import com.mojang.blaze3d.matrix.MatrixStack;

public class SkySkeletonRenderer {
	public static class ModelRegisterHandler {
		@SubscribeEvent
		public void registerModels(ModelRegistryEvent event) {
			RenderingRegistry.registerEntityRenderingHandler(SkySkeletonEntity.entity, renderManager -> {
				return new MobRenderer(renderManager, new Modelcustom_model(), 0.5f) {
					@Override
					public ResourceLocation getEntityTexture(Entity entity) {
						return new ResourceLocation("additional_adventure:textures/esqueletodelcielo.png");
					}
						public SkySkeletonRenderer(EntityRendererManager renderManagerIn) {
						super(renderManagerIn, new Modelcustom_model<>, 0.5F);
						this.addLayer(new HeldItemLayer(this));
					}
				};
			});
		}
	}

Error 1  Description    Resource    Path    Location    Type
Cannot infer type argument(s) for <T> registerEntityRenderingHandler(EntityType<T>, IRenderFactory<? super T>)    SkySkeletonRenderer.java    /additional_adventure/src/main/java/net/mcreator/additionaladventure/entity/renderer    line 1    Java Problem

Error 2 : Description    Resource    Path    Location    Type
Constructor call must be the first statement in a constructor    SkySkeletonRenderer.java    /additional_adventure/src/main/java/net/mcreator/additionaladventure/entity/renderer    line 1    Java Problem
 

Error 3 :Description    Resource    Path    Location    Type
Syntax error, insert "( )" to complete Expression    SkySkeletonRenderer.java    /additional_adventure/src/main/java/net/mcreator/additionaladventure/entity/renderer    line 32    Java Problem

Please help me fix this.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.