Jump to content

Recommended Posts

Posted (edited)

I am having an issue where the model of my entity is drifting away from the actual entity, in the image you can see that the bounding box is where the entity actually is while it's model is falling through the floor. The entity is a simple parrot copy that extends EntityParrot and not much else.

 

The model keeps the same x and z coordinates of the actual entity, but keeps descending.

 

I suspect that this is the result of an issue syncing between client and server but I am not sure exactly where the problem is.

 

My entity class

  Reveal hidden contents

 

My render class:

  Reveal hidden contents

 

I am registering my render in my client proxy on preInit, and registering the entity on the RegistryEvent.Register<EntityEntry> event.

RenderingRegistry.registerEntityRenderingHandler(EntityZombieParrot.class, renderManager -> new RenderZombieParrot(renderManager, new ModelParrot(), 0.5f));

createBuilder("zombie_parrot").entity(EntityZombieParrot.class).tracker(64, 3, false).build();

2018-06-18_16.48.34.png

Edited by laton95
Posted
@Mod.EventBusSubscriber
public class ModEntities
{
	private static int entityID = 0;
	
	@SubscribeEvent
	public static void registerEntities(RegistryEvent.Register<EntityEntry> event)
	{
		LogHelper.info("Registering entities");
		
		EntityEntry[] entries = {
				createBuilder("spell_projectile_bouncing").entity(EntityProjectileSpellBouncing.class).tracker(64, 20, true).build(),
				createBuilder("spell_projectile_damage").entity(EntityProjectileSpellDamage.class).tracker(64, 20, true).build(),
				createBuilder("spell_projectile_explosive").entity(EntityProjectileSpellExplosive.class).tracker(64, 20, true).build(),
				createBuilder("spell_projectile_following").entity(EntityProjectileSpellFollowing.class).tracker(64, 1, true).build(),
				createBuilder("spell_projectile_teleport_basic").entity(EntityProjectileSpellTeleportBasic.class).tracker(64, 20, true).build(),
				createBuilder("zombie_parrot").entity(EntityZombieParrot.class).tracker(64, 1, true).build()
		};
		
		event.getRegistry().registerAll(entries);
		
	}
	
	private static <E extends Entity> EntityEntryBuilder<E> createBuilder(final String name)
	{
		final EntityEntryBuilder<E> builder = EntityEntryBuilder.create();
		final ResourceLocation registryName = new ResourceLocation(ModReference.MOD_ID, name);
		return builder.id(registryName, entityID++).name(registryName.toString());
	}
}

 

Posted (edited)

Well thanks anyway. I'll keep at it, I've made it it's own entity now instead of extending parrot and removed it's ability to fly to check if that was causing the issue. Oddly enough the model still falls slowly like a chicken even though it shouldn't be able to. The actual entity falls like a normal mob.

Edited by laton95
  • 7 months later...

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.