Jump to content

Recommended Posts

Posted

Hey, 

 

I am trying to follow a tutorial to make custom entities in Minecraft.  The tutorial I am following was written in 1.14.4 and entity registering seems to have been updated.  When following the tutorial, I get the error 

 

The method registerEntityRenderingHandler(EntityType<T>, IRenderFactory<? super T>) in the type RenderingRegistry is not applicable for the arguments (Class<TutorialEntity>, TutorialEntityRender.RenderFactory)

 

from 

public class TutorialRenderRegistry {
	public static void registryEntityRenders() {
		RenderingRegistry.registerEntityRenderingHandler(TutorialEntity.class, new TutorialEntityRender.RenderFactory());
	}
}

TutorialEntity:

public class TutorialEntity extends CreatureEntity {

	public TutorialEntity(EntityType<? extends CreatureEntity> type, World world) {

		super((EntityType<? extends CreatureEntity>) TutorialEntities.TUTORIAL_ENTITY, world);

	}

	@Override
	protected void registerGoals() {

		this.goalSelector.addGoal(0, new SwimGoal(this));
		this.goalSelector.addGoal(1, new RandomWalkingGoal(this, 1.2d));
		this.goalSelector.addGoal(2, new LookRandomlyGoal(this));

	}

	@Override
	protected void registerAttributes() {
		// TODO Auto-generated method stub
		super.registerAttributes();
		this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(20.0d);
		this.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(1.2d);
	}

}

TutorialEntityRenderer:

public class TutorialEntityRender extends LivingRenderer<TutorialEntity, TutorialEntityModel> {

	public TutorialEntityRender(EntityRendererManager manager) {
		super(manager, new TutorialEntityModel(), 0F);
		// TODO Auto-generated constructor stub
	}

	@Override
	public ResourceLocation getEntityTexture(TutorialEntity entity) {
		// TODO Auto-generated method stub
		return TutorialModRegistries.location("textures/entity/tutorial_entity.png");
	}

	public static class RenderFactory implements IRenderFactory<TutorialEntity> {

		@Override
		public EntityRenderer<? super TutorialEntity> createRenderFor(EntityRendererManager manager) {
			// TODO Auto-generated method stub
			return new TutorialEntityRender(manager);
		}

	}

}

 

 

Thanks for any help provided!

  • Like 1
Posted
8 hours ago, TeknoServal said:

Hey, 

 

I am trying to follow a tutorial to make custom entities in Minecraft.  The tutorial I am following was written in 1.14.4 and entity registering seems to have been updated.  When following the tutorial, I get the error 

 

The method registerEntityRenderingHandler(EntityType<T>, IRenderFactory<? super T>) in the type RenderingRegistry is not applicable for the arguments (Class<TutorialEntity>, TutorialEntityRender.RenderFactory)

 

from 


public class TutorialRenderRegistry {
	public static void registryEntityRenders() {
		RenderingRegistry.registerEntityRenderingHandler(TutorialEntity.class, new TutorialEntityRender.RenderFactory());
	}
}

TutorialEntity:


public class TutorialEntity extends CreatureEntity {

	public TutorialEntity(EntityType<? extends CreatureEntity> type, World world) {

		super((EntityType<? extends CreatureEntity>) TutorialEntities.TUTORIAL_ENTITY, world);

	}

	@Override
	protected void registerGoals() {

		this.goalSelector.addGoal(0, new SwimGoal(this));
		this.goalSelector.addGoal(1, new RandomWalkingGoal(this, 1.2d));
		this.goalSelector.addGoal(2, new LookRandomlyGoal(this));

	}

	@Override
	protected void registerAttributes() {
		// TODO Auto-generated method stub
		super.registerAttributes();
		this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(20.0d);
		this.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(1.2d);
	}

}

TutorialEntityRenderer:


public class TutorialEntityRender extends LivingRenderer<TutorialEntity, TutorialEntityModel> {

	public TutorialEntityRender(EntityRendererManager manager) {
		super(manager, new TutorialEntityModel(), 0F);
		// TODO Auto-generated constructor stub
	}

	@Override
	public ResourceLocation getEntityTexture(TutorialEntity entity) {
		// TODO Auto-generated method stub
		return TutorialModRegistries.location("textures/entity/tutorial_entity.png");
	}

	public static class RenderFactory implements IRenderFactory<TutorialEntity> {

		@Override
		public EntityRenderer<? super TutorialEntity> createRenderFor(EntityRendererManager manager) {
			// TODO Auto-generated method stub
			return new TutorialEntityRender(manager);
		}

	}

}

 

 

Thanks for any help provided!

If you are using a Tutorial of Harry Talks, then your EntityType is in the same location as you make your spawnegg and the Loop for making spawn the entities in the World.

New in Modding? == Still learning!

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.