setInvulTime(invul + 1);
}
if(reverseTicks > MOB_SPAWN_START_TICKS * 2 && mobTicks > MOB_SPAWN_END_TICKS && mobTicks % MOB_SPAWN_WAVE_TIME == 0 && !worldObj.isRemote) {
for(int i = 0; i < 3 + worldObj.rand.nextInt(2); i++) {
EntityLiving entity = null;
switch(worldObj.rand.nextInt(2)) {
case 0 : {
entity = new EntityZombie(worldObj);
if(worldObj.rand.nextInt(12) == 0)
entity = new EntityWitch(worldObj);
break;
}
case 1 : {
entity = new EntitySkeleton(worldObj);
((EntitySkeleton) entity).setCurrentItemOrArmor(0, new ItemStack(Items.bow));
if(worldObj.rand.nextInt(8) == 0) {
((EntitySkeleton) entity).setSkeletonType(1);
((EntitySkeleton) entity).setCurrentItemOrArmor(0, new ItemStack(Items.stone_sword));
}
break;
}
case 3 : {
for(int j = 0; j < 1 + worldObj.rand.nextInt(5); j++) {
EntityPixie pixie = new EntityPixie(worldObj);
pixie.setProps(players.get(rand.nextInt(players.size())), this, 1, 8);
pixie.setPosition(posX + width / 2, posY + 2, posZ + width / 2);
worldObj.spawnEntityInWorld(pixie);
}
}
}
if(entity != null) {
range = 6F;
entity.setPosition(posX + 0.5 + Math.random() * range - range / 2, posY - 1, posZ + 0.5 + Math.random() * range - range / 2);
worldObj.spawnEntityInWorld(entity);
}
}
}