Search in sources :

Example 1 with EntitySkeleton

use of net.minecraft.entity.monster.EntitySkeleton in project BluePower by Qmunity.

the class BPEventHandler method dropHeads.

private void dropHeads(LivingDeathEvent event) {
    if (event.entityLiving instanceof EntityCreeper) {
        event.entityLiving.entityDropItem(new ItemStack(Items.skull, 1, 4), 0.0F);
    }
    if (event.entityLiving instanceof EntityPlayer) {
        ItemStack drop = new ItemStack(Items.skull, 1, 3);
        drop.stackTagCompound = new NBTTagCompound();
        drop.stackTagCompound.setString("SkullOwner", ((EntityPlayer) event.entityLiving).getDisplayName());
        event.entityLiving.entityDropItem(drop, 0.0F);
    }
    if (event.entityLiving instanceof EntitySkeleton) {
        EntitySkeleton sk = (EntitySkeleton) event.entityLiving;
        if (sk.getSkeletonType() == 0) {
            event.entityLiving.entityDropItem(new ItemStack(Items.skull, 1, 0), 0.0F);
        } else {
            event.entityLiving.entityDropItem(new ItemStack(Items.skull, 1, 1), 0.0F);
        }
    }
    if (event.entityLiving instanceof EntityZombie) {
        event.entityLiving.entityDropItem(new ItemStack(Items.skull, 1, 2), 0.0F);
    }
}
Also used : EntityCreeper(net.minecraft.entity.monster.EntityCreeper) EntityZombie(net.minecraft.entity.monster.EntityZombie) EntitySkeleton(net.minecraft.entity.monster.EntitySkeleton) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) EntityPlayer(net.minecraft.entity.player.EntityPlayer) ItemStack(net.minecraft.item.ItemStack)

Example 2 with EntitySkeleton

use of net.minecraft.entity.monster.EntitySkeleton in project SimplyJetpacks by Tonius.

the class EntityInteractHandler method onEntityInteract.

@SubscribeEvent
public void onEntityInteract(EntityInteractEvent evt) {
    if (evt.entityPlayer.isSneaking() && (evt.target instanceof EntityZombie || evt.target instanceof EntitySkeleton)) {
        EntityLiving target = (EntityLiving) evt.target;
        ItemStack heldStack = evt.entityPlayer.getHeldItem();
        if (heldStack != null && heldStack.getItem() instanceof ItemJetpack) {
            if (!target.worldObj.isRemote) {
                target.dropEquipment(true, 3);
            }
            target.setCurrentItemOrArmor(3, heldStack.copy());
            target.equipmentDropChances[3] = 2.0F;
            target.persistenceRequired = true;
            evt.entityPlayer.getHeldItem().stackSize--;
        }
    }
}
Also used : EntityLiving(net.minecraft.entity.EntityLiving) ItemJetpack(tonius.simplyjetpacks.item.ItemPack.ItemJetpack) EntityZombie(net.minecraft.entity.monster.EntityZombie) EntitySkeleton(net.minecraft.entity.monster.EntitySkeleton) ItemStack(net.minecraft.item.ItemStack) SubscribeEvent(cpw.mods.fml.common.eventhandler.SubscribeEvent)

Example 3 with EntitySkeleton

use of net.minecraft.entity.monster.EntitySkeleton in project ArsMagica2 by Mithion.

the class Summon method summonCreature.

public EntityLiving summonCreature(ItemStack stack, EntityLivingBase caster, EntityLivingBase target, World world, double x, double y, double z) {
    Class clazz = getSummonType(stack);
    EntityLiving entity = null;
    try {
        entity = (EntityLiving) clazz.getConstructor(World.class).newInstance(world);
    } catch (Throwable t) {
        t.printStackTrace();
        return null;
    }
    if (entity == null) {
        return null;
    }
    if (entity instanceof EntitySkeleton) {
        ((EntitySkeleton) entity).setSkeletonType(0);
        ((EntitySkeleton) entity).setCurrentItemOrArmor(0, new ItemStack(Items.bow));
    } else if (entity instanceof EntityHorse && caster instanceof EntityPlayer) {
        ((EntityHorse) entity).setTamedBy(((EntityPlayer) caster));
    }
    entity.setPosition(x, y, z);
    world.spawnEntityInWorld(entity);
    if (caster instanceof EntityPlayer) {
        EntityUtilities.makeSummon_PlayerFaction((EntityCreature) entity, (EntityPlayer) caster, false);
    } else {
        EntityUtilities.makeSummon_MonsterFaction((EntityCreature) entity, false);
    }
    EntityUtilities.setOwner(entity, caster);
    int duration = SpellUtils.instance.getModifiedInt_Mul(4800, stack, caster, target, world, 0, SpellModifiers.DURATION);
    EntityUtilities.setSummonDuration(entity, duration);
    SpellHelper.instance.applyStageToEntity(stack, caster, world, entity, 0, false);
    return entity;
}
Also used : EntityHorse(net.minecraft.entity.passive.EntityHorse) EntitySkeleton(net.minecraft.entity.monster.EntitySkeleton) EntityPlayer(net.minecraft.entity.player.EntityPlayer) World(net.minecraft.world.World) ItemStack(net.minecraft.item.ItemStack)

Example 4 with EntitySkeleton

use of net.minecraft.entity.monster.EntitySkeleton in project VoodooCraft by Mod-DevCafeTeam.

the class HexSpiritTaint method activeUse.

@Override
public ItemStack activeUse(ItemStack stackIn, World world, EntityPlayer player, EnumHand hand, int strength, @Nullable EntityLivingBase target) {
    if (!world.isRemote) {
        if (target instanceof EntitySkeleton) {
            EntitySkeleton entity = new EntitySkeleton(world);
            if (((EntitySkeleton) target).getSkeletonType().equals(SkeletonType.NORMAL)) {
                entity.setSkeletonType(SkeletonType.WITHER);
                entity.copyLocationAndAnglesFrom(target);
                entity.onInitialSpawn(world.getDifficultyForLocation(new BlockPos(entity)), null);
                world.removeEntity(target);
                world.spawnEntity(entity);
            }
            if (((EntitySkeleton) target).getSkeletonType().equals(SkeletonType.WITHER)) {
                entity.setSkeletonType(SkeletonType.NORMAL);
                entity.copyLocationAndAnglesFrom(target);
                entity.onInitialSpawn(world.getDifficultyForLocation(new BlockPos(entity)), null);
                world.removeEntity(target);
                world.spawnEntity(entity);
            }
        }
    }
    if (target != null)
        VoodooCraft.proxy.spawnParticle(world, EnumParticleTypes.EXPLOSION_NORMAL, target.posX, target.posY, target.posZ);
    player.playSound(VCSoundHandler.transformation, 1.0F, 1.0F);
    return super.activeUse(stackIn, world, player, hand, strength, target);
}
Also used : EntitySkeleton(net.minecraft.entity.monster.EntitySkeleton) BlockPos(net.minecraft.util.math.BlockPos)

Example 5 with EntitySkeleton

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

the class EntityAIHalloweenKnights method updateTask.

/**
     * Updates the task
     */
@Override
public void updateTask() {
    executed = true;
    DifficultyInstance difficultyinstance = horse.worldObj.getDifficultyForLocation(new BlockPos(horse));
    horse.setType(HorseType.SKELETON);
    horse.setHorseTamed(true);
    horse.setGrowingAge(0);
    horse.worldObj.addWeatherEffect(new EntityLightningBolt(horse.worldObj, horse.posX, horse.posY, horse.posZ, true));
    EntitySkeleton entityskeleton = createSkeleton(difficultyinstance, horse);
    entityskeleton.startRiding(horse);
    for (int i = 0; i < 3; ++i) {
        EntityHorse entityhorse = createHorse(difficultyinstance);
        EntitySkeleton skeleton = createSkeleton(difficultyinstance, entityhorse);
        skeleton.startRiding(entityhorse);
        entityhorse.addVelocity(horse.getRNG().nextGaussian() * 0.5D, 0.0D, horse.getRNG().nextGaussian() * 0.5D);
    }
}
Also used : EntityHorse(net.minecraft.entity.passive.EntityHorse) DifficultyInstance(net.minecraft.world.DifficultyInstance) EntitySkeleton(net.minecraft.entity.monster.EntitySkeleton) BlockPos(net.minecraft.util.math.BlockPos) EntityLightningBolt(net.minecraft.entity.effect.EntityLightningBolt)

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