/** Convert this zombie into a villager. */ protected void convertToVillager() { EntityVillager entityvillager = new EntityVillager(this.worldObj); entityvillager.copyLocationAndAnglesFrom(this); entityvillager.onSpawnWithEgg((EntityLivingData) null); entityvillager.func_82187_q(); if (this.isChild()) { entityvillager.setGrowingAge(-24000); } this.worldObj.removeEntity(this); this.worldObj.spawnEntityInWorld(entityvillager); entityvillager.addPotionEffect(new PotionEffect(Potion.confusion.id, 200, 0)); this.worldObj.playAuxSFXAtEntity( (EntityPlayer) null, 1017, (int) this.posX, (int) this.posY, (int) this.posZ, 0); }
/** Convert this zombie into a villager. */ protected void convertToVillager() { EntityVillager entityvillager = new EntityVillager(this.worldObj); entityvillager.func_82149_j(this); entityvillager.initCreature(); entityvillager.func_82187_q(); if (this.isChild()) { entityvillager.setGrowingAge(-24000); } this.worldObj.removeEntity(this); this.worldObj.spawnEntityInWorld(entityvillager); entityvillager.addPotionEffect(new PotionEffect(Potion.confusion.id, 200, 0)); this.worldObj.playAuxSFXAtEntity( (EntityPlayer) null, 1017, (int) this.posX, (int) this.posY, (int) this.posZ, 0); }