/** Updates a zombie entity with the villager info this object is tracking. */ public void updateZombie(EntityZombie zombie, ExtendedVillagerZombie properties) { // Note: I must trust that this object actually contain a villager info. If not, the cast below // will fail. final Object[] extraInfo = (Object[]) this.getObject(); final int profession = (Integer) extraInfo[0]; final boolean isBaby = (Boolean) extraInfo[1]; // Custom name if (this.getCustomName() != "") { zombie.setCustomNameTag(this.getCustomName()); zombie.enablePersistence(); } // Adult or child zombie.setChild(isBaby); // Profession if (profession >= 0 && profession <= 4) { // vanilla professions properties.setProfession(profession); } else { properties.setProfession(-1); // vanilla zombie villager } }