public void renderSkeleton(
      EntitySkeleton entity, double d, double d1, double d2, float f, float f1) {
    super.doRenderLiving(entity, d, d1, d2, f, f1);

    if (entity.getHealth() > 0) {
      renderLivingLabel(
          entity, "" + entity.getHealth() + "/" + entity.getMaxHealth() + " HP", d, d1, d2, 64);
      renderLivingLabel(entity, "Skeleton", d, d1 + 0.25D, d2, 64);
    }
  }
Exemple #2
0
 /** determines if a skeleton spawns on a spider, and if a sheep is a different color */
 private static void creatureSpecificInit(
     EntityLiving par0EntityLiving, World par1World, float par2, float par3, float par4) {
   if ((par0EntityLiving instanceof EntitySpider) && par1World.rand.nextInt(100) == 0) {
     EntitySkeleton entityskeleton = new EntitySkeleton(par1World);
     entityskeleton.setLocationAndAngles(par2, par3, par4, par0EntityLiving.rotationYaw, 0.0F);
     par1World.spawnEntityInWorld(entityskeleton);
     entityskeleton.mountEntity(par0EntityLiving);
   } else if (par0EntityLiving instanceof EntitySheep) {
     ((EntitySheep) par0EntityLiving)
         .setFleeceColor(EntitySheep.getRandomFleeceColor(par1World.rand));
   } else if ((par0EntityLiving instanceof EntityOcelot) && par1World.rand.nextInt(7) == 0) {
     for (int i = 0; i < 2; i++) {
       EntityOcelot entityocelot = new EntityOcelot(par1World);
       entityocelot.setLocationAndAngles(par2, par3, par4, par0EntityLiving.rotationYaw, 0.0F);
       entityocelot.setGrowingAge(-24000);
       par1World.spawnEntityInWorld(entityocelot);
     }
   }
 }