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);
}
}
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--;
}
}
}
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;
}
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);
}
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);
}
}
Aggregations