Search in sources :

Example 6 with EntitySkeleton

use of net.minecraft.entity.monster.EntitySkeleton in project BetterWithAddons by DaedalusGame.

the class TerratorialHandler method spawnLiving.

@SubscribeEvent
public void spawnLiving(LivingSpawnEvent.CheckSpawn spawnEvent) {
    World world = spawnEvent.getWorld();
    EntityLivingBase entity = spawnEvent.getEntityLiving();
    Chunk chunk = world.getChunkFromBlockCoords(new BlockPos(spawnEvent.getX(), spawnEvent.getY(), spawnEvent.getZ()));
    if (!chunk.isLoaded())
        return;
    if (entity instanceof EntityZombie || entity instanceof EntitySkeleton || entity instanceof EntityCreeper)
        spawnEvent.setResult(Event.Result.DENY);
}
Also used : EntityCreeper(net.minecraft.entity.monster.EntityCreeper) EntityZombie(net.minecraft.entity.monster.EntityZombie) EntitySkeleton(net.minecraft.entity.monster.EntitySkeleton) EntityLivingBase(net.minecraft.entity.EntityLivingBase) BlockPos(net.minecraft.util.math.BlockPos) World(net.minecraft.world.World) Chunk(net.minecraft.world.chunk.Chunk) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Example 7 with EntitySkeleton

use of net.minecraft.entity.monster.EntitySkeleton in project MineFactoryReloaded by powercrystals.

the class VanillaMobProvider method getRandomMobs.

@Override
public List<RandomMob> getRandomMobs(World world) {
    List<RandomMob> mobs = new ArrayList<RandomMob>();
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityMooshroom.class, world), 20));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntitySlime.class, world), 20));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityCow.class, world), 100));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityChicken.class, world), 100));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntitySheep.class, world), 100));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityWitch.class, world), 10));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityGhast.class, world), 15));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityPig.class, world), 100));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityCreeper.class, world), 25));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntitySquid.class, world), 30));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityMinecartHopper.class, world), 15));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityOcelot.class, world), 20));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityWolf.class, world), 20));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityBat.class, world), 35));
    EntityCreeper chargedCreeper = (EntityCreeper) MFRUtil.prepareMob(EntityCreeper.class, world);
    NBTTagCompound creeperNBT = new NBTTagCompound();
    chargedCreeper.writeToNBT(creeperNBT);
    creeperNBT.setBoolean("powered", true);
    creeperNBT.setShort("Fuse", (short) 120);
    chargedCreeper.readFromNBT(creeperNBT);
    mobs.add(new RandomMob(chargedCreeper, 5));
    EntityTNTPrimed armedTNT = (EntityTNTPrimed) MFRUtil.prepareMob(EntityTNTPrimed.class, world);
    armedTNT.fuse = 120;
    mobs.add(new RandomMob(armedTNT, 5));
    EntitySlime invisislime = (EntitySlime) MFRUtil.prepareMob(EntitySlime.class, world);
    invisislime.addPotionEffect(new PotionEffect(Potion.invisibility.id, 120 * 20));
    mobs.add(new RandomMob(invisislime, 5));
    EntityMooshroom invisishroom = (EntityMooshroom) MFRUtil.prepareMob(EntityMooshroom.class, world);
    invisishroom.addPotionEffect(new PotionEffect(Potion.invisibility.id, 120 * 20));
    mobs.add(new RandomMob(invisishroom, 5));
    EntitySkeleton skeleton1 = (EntitySkeleton) MFRUtil.prepareMob(EntitySkeleton.class, world);
    EntitySkeleton skeleton2 = (EntitySkeleton) MFRUtil.prepareMob(EntitySkeleton.class, world);
    EntitySkeleton skeleton3 = (EntitySkeleton) MFRUtil.prepareMob(EntitySkeleton.class, world);
    EntitySkeleton skeleton4 = (EntitySkeleton) MFRUtil.prepareMob(EntitySkeleton.class, world);
    skeleton4.mountEntity(skeleton3);
    skeleton3.mountEntity(skeleton2);
    skeleton2.mountEntity(skeleton1);
    mobs.add(new RandomMob(skeleton1, 2));
    EntityBlaze blazeJockey = (EntityBlaze) MFRUtil.prepareMob(EntityBlaze.class, world);
    EntityGhast blazeMount = (EntityGhast) MFRUtil.prepareMob(EntityGhast.class, world);
    blazeJockey.mountEntity(blazeMount);
    mobs.add(new RandomMob(blazeMount, 2));
    EntityCreeper creeperJockey = (EntityCreeper) MFRUtil.prepareMob(EntityCreeper.class, world);
    EntityCaveSpider creeperMount = (EntityCaveSpider) MFRUtil.prepareMob(EntityCaveSpider.class, world);
    creeperJockey.mountEntity(creeperMount);
    mobs.add(new RandomMob(creeperMount, 2));
    return mobs;
}
Also used : EntityMooshroom(net.minecraft.entity.passive.EntityMooshroom) RandomMob(powercrystals.minefactoryreloaded.api.RandomMob) EntityCaveSpider(net.minecraft.entity.monster.EntityCaveSpider) PotionEffect(net.minecraft.potion.PotionEffect) EntityTNTPrimed(net.minecraft.entity.item.EntityTNTPrimed) EntitySlime(net.minecraft.entity.monster.EntitySlime) EntitySkeleton(net.minecraft.entity.monster.EntitySkeleton) ArrayList(java.util.ArrayList) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) EntityGhast(net.minecraft.entity.monster.EntityGhast) EntityBlaze(net.minecraft.entity.monster.EntityBlaze) EntityCreeper(net.minecraft.entity.monster.EntityCreeper)

Example 8 with EntitySkeleton

use of net.minecraft.entity.monster.EntitySkeleton in project Railcraft by Railcraft.

the class EntityAIHalloweenKnights method createSkeleton.

private EntitySkeleton createSkeleton(DifficultyInstance difficultyInstance, EntityHorse entityHorse) {
    EntitySkeleton skeleton = new EntitySkeleton(entityHorse.worldObj);
    skeleton.onInitialSpawn(difficultyInstance, null);
    skeleton.setPosition(entityHorse.posX, entityHorse.posY, entityHorse.posZ);
    skeleton.hurtResistantTime = 60;
    skeleton.enablePersistence();
    skeleton.setItemStackToSlot(EntityEquipmentSlot.HEAD, new ItemStack(MiscTools.RANDOM.nextFloat() < 0.25F ? Blocks.LIT_PUMPKIN : Blocks.PUMPKIN));
    EnchantmentHelper.addRandomEnchantment(skeleton.getRNG(), skeleton.getHeldItemMainhand(), (int) (5.0F + difficultyInstance.getClampedAdditionalDifficulty() * (float) skeleton.getRNG().nextInt(18)), false);
    //        EnchantmentHelper.addRandomEnchantment(skeleton.getRNG(), skeleton.getItemStackFromSlot(EntityEquipmentSlot.HEAD), (int)(5.0F + difficultyInstance.getClampedAdditionalDifficulty() * (float)skeleton.getRNG().nextInt(18)), false);
    skeleton.worldObj.spawnEntityInWorld(skeleton);
    return skeleton;
}
Also used : EntitySkeleton(net.minecraft.entity.monster.EntitySkeleton) ItemStack(net.minecraft.item.ItemStack)

Aggregations

EntitySkeleton (net.minecraft.entity.monster.EntitySkeleton)8 ItemStack (net.minecraft.item.ItemStack)4 EntityCreeper (net.minecraft.entity.monster.EntityCreeper)3 EntityZombie (net.minecraft.entity.monster.EntityZombie)3 BlockPos (net.minecraft.util.math.BlockPos)3 EntityHorse (net.minecraft.entity.passive.EntityHorse)2 EntityPlayer (net.minecraft.entity.player.EntityPlayer)2 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)2 World (net.minecraft.world.World)2 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)1 ArrayList (java.util.ArrayList)1 EntityLiving (net.minecraft.entity.EntityLiving)1 EntityLivingBase (net.minecraft.entity.EntityLivingBase)1 EntityLightningBolt (net.minecraft.entity.effect.EntityLightningBolt)1 EntityTNTPrimed (net.minecraft.entity.item.EntityTNTPrimed)1 EntityBlaze (net.minecraft.entity.monster.EntityBlaze)1 EntityCaveSpider (net.minecraft.entity.monster.EntityCaveSpider)1 EntityGhast (net.minecraft.entity.monster.EntityGhast)1 EntitySlime (net.minecraft.entity.monster.EntitySlime)1 EntityMooshroom (net.minecraft.entity.passive.EntityMooshroom)1