Posted June 18, 20187 yr 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 Spoiler public class EntityZombieParrot extends EntityParrot { public EntityZombieParrot(World worldIn) { super(worldIn); } @Override public boolean processInteract(EntityPlayer player, EnumHand hand) { if (!this.world.isRemote && !this.isFlying() && this.isTamed() && this.isOwner(player)) { this.aiSit.setSitting(!this.isSitting()); } return true; } @Nullable @Override public SoundEvent getAmbientSound() { return SoundEvents.E_PARROT_IM_ZOMBIE; } @Nullable @Override protected SoundEvent getDeathSound() { return SoundEvents.ENTITY_ZOMBIE_DEATH; } @Nullable @Override protected SoundEvent getHurtSound(DamageSource damageSourceIn) { return SoundEvents.ENTITY_ZOMBIE_HURT; } } My render class: Spoiler public class RenderZombieParrot extends RenderLiving { public RenderZombieParrot(RenderManager rendermanagerIn, ModelBase modelbaseIn, float shadowsizeIn) { super(rendermanagerIn, modelbaseIn, shadowsizeIn); } @Nullable @Override protected ResourceLocation getEntityTexture(Entity entity) { return new ResourceLocation("mod:textures/entity/zombie_parrot/zombie_parrot.png"); } } 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(); Edited June 18, 20187 yr by laton95
June 18, 20187 yr Author Thanks for the tip, but even with it set to true the behaviour is still the same.
June 18, 20187 yr Author @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()); } }
June 18, 20187 yr Author 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 June 18, 20187 yr by laton95
June 18, 20187 yr Author Hmm, it is a problem with using the parrot model itself. The same entity with a different model will not have the issue.
June 18, 20187 yr Author Ok, turns out that I needed to override handleRotationFloat in my render class like vanilla did to it's parrot.
June 18, 20187 yr Author Getting the parrot to work properly on the player's shoulder is probably not possible, looks like the parrot is hardcoded in several places.
February 4, 20196 yr On 6/18/2018 at 9:02 AM, laton95 said: Getting the parrot to work properly on the player's shoulder is probably not possible, looks like the parrot is hardcoded in several places. Well I believe Ice and Fire does it, you could check their code.
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.