net.minecraft.entity.monster.EntityCreeper Java Examples

The following examples show how to use net.minecraft.entity.monster.EntityCreeper. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HackableHandler.java    From PneumaticCraft with GNU General Public License v3.0 6 votes vote down vote up
public static void addDefaultEntries(){
    PneumaticRegistry.getInstance().addHackable(Blocks.tnt, HackableTNT.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.mob_spawner, HackableMobSpawner.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.lever, HackableLever.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.stone_button, HackableButton.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.wooden_button, HackableButton.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.wooden_door, HackableDoor.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.tripwire_hook, HackableTripwire.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.dispenser, HackableDispenser.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.dropper, HackableDispenser.class);
    PneumaticRegistry.getInstance().addHackable(Blockss.securityStation, HackableSecurityStation.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.monster_egg, HackableTripwire.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.noteblock, HackableNoteblock.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.jukebox, HackableJukebox.class);

    PneumaticRegistry.getInstance().addHackable(EntityCreeper.class, HackableCreeper.class);
    PneumaticRegistry.getInstance().addHackable(EntityTameable.class, HackableTameable.class);
    PneumaticRegistry.getInstance().addHackable(EntityCow.class, HackableCow.class);
    PneumaticRegistry.getInstance().addHackable(EntityCaveSpider.class, HackableCaveSpider.class);
    PneumaticRegistry.getInstance().addHackable(EntityBlaze.class, HackableBlaze.class);
    PneumaticRegistry.getInstance().addHackable(EntityGhast.class, HackableGhast.class);
    PneumaticRegistry.getInstance().addHackable(EntityWitch.class, HackableWitch.class);
    PneumaticRegistry.getInstance().addHackable(EntityLiving.class, HackableLivingDisarm.class);
    PneumaticRegistry.getInstance().addHackable(EntityEnderman.class, HackableEnderman.class);
    PneumaticRegistry.getInstance().addHackable(EntityBat.class, HackableBat.class);
}
 
Example #2
Source File: MoCreatures.java    From mocreaturesdev with GNU General Public License v3.0 6 votes vote down vote up
public static void ClearVanillaMobSpawns()
{
    for (int i = 0; i < BiomeGenBase.biomeList.length; i++)
    {
        if (BiomeGenBase.biomeList[i] != null)
        {
            EntityRegistry.removeSpawn(EntityCreeper.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntitySkeleton.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityZombie.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntitySpider.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityEnderman.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityCaveSpider.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntitySlime.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityGhast.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityPigZombie.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityMagmaCube.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityOcelot.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
        }
    }
}
 
Example #3
Source File: EntityGuard.java    From ToroQuest with GNU General Public License v3.0 6 votes vote down vote up
protected void initEntityAI() {
	areaAI = new EntityAIMoveIntoArea(this, 0.5D, 30);
	tasks.addTask(0, new EntityAISwimming(this));
	tasks.addTask(2, new EntityAIAttackMelee(this, 0.6D, false));
	tasks.addTask(4, areaAI);
	tasks.addTask(7, new EntityAIWander(this, 0.35D));
	tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
	tasks.addTask(8, new EntityAILookIdle(this));

	targetTasks.addTask(2, new EntityAINearestAttackableCivTarget(this));
	targetTasks.addTask(3, new EntityAINearestAttackableTarget<EntityMob>(this, EntityMob.class, 10, false, false, new Predicate<EntityMob>() {
		@Override
		public boolean apply(EntityMob target) {
			return !(target instanceof EntityCreeper);
		}
	}));
}
 
Example #4
Source File: EntityEnderminy.java    From EnderZoo with Creative Commons Zero v1.0 Universal 6 votes vote down vote up
public EntityEnderminy(World world) {
  super(world);
  setSize(0.6F * 0.5F, 2.9F * 0.25F);
  stepHeight = 1.0F;

  tasks.addTask(0, new EntityAISwimming(this));
  tasks.addTask(2, new EntityAIAttackMelee(this, 1.0D, false));
  tasks.addTask(7, new EntityAIWander(this, 1.0D));
  tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
  tasks.addTask(8, new EntityAILookIdle(this));
  targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));

  if(attackIfLookingAtPlayer) {
    targetTasks.addTask(2, new AIFindPlayer());
  }

  if(attackCreepers) {
    targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityCreeper>(this, EntityCreeper.class, true, true));
  }
}
 
Example #5
Source File: EventHandlerEMT.java    From Electro-Magic-Tools with GNU General Public License v3.0 6 votes vote down vote up
@SubscribeEvent
public void onEntityLivingDrops(LivingDropsEvent event) {
    if (event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayer) {
        if (event.entityLiving instanceof EntityCreeper) {
            EntityCreeper creeper = (EntityCreeper) event.entityLiving;
            if (creeper.getPowered()) {
                event.drops.add(new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, new ItemStack(IC2ItemRegistry.itemEMTItems, 1, 6)));
            }
        }
        if (event.entityLiving instanceof EntityTaintChicken) {
            event.drops.add(new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, new ItemStack(IC2ItemRegistry.itemEMTItems, 1, 14)));
        }
    }

    if (event.entityLiving instanceof EntityCreeper) {
        event.entityLiving.entityDropItem(new ItemStack(IC2ItemRegistry.itemEMTItems, 6), 1);
    }
    if (event.entityLiving instanceof EntityTaintChicken) {
        event.entityLiving.entityDropItem(new ItemStack(IC2ItemRegistry.itemEMTItems, 14), 1);
    }
}
 
Example #6
Source File: EntityCreeperMetaProvider.java    From OpenPeripheral-Integration with MIT License 5 votes vote down vote up
@Override
public Object getMeta(EntityCreeper target, Vec3 relativePos) {
	Map<String, Object> map = Maps.newHashMap();

	map.put("isCharged", target.getPowered());

	return map;
}
 
Example #7
Source File: EventHandlerPneumaticCraft.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
@SubscribeEvent
public void onEntityDeath(LivingDeathEvent event){
    if(!event.entity.worldObj.isRemote) {
        if(Config.enableSlimeSeedDrop && event.entity instanceof EntitySlime && Math.random() < 0.1D) {
            ItemPlasticPlants.markInactive(event.entity.entityDropItem(new ItemStack(Itemss.plasticPlant, 1, ItemPlasticPlants.SLIME_PLANT_DAMAGE), 0));
        } else if(Config.enableCreeperSeedDrop && event.entity instanceof EntityCreeper && Math.random() < 0.05D) {
            if(Config.enableCreeperDropExplosion) event.entity.worldObj.createExplosion(event.entity, event.entity.posX, event.entity.posY + event.entityLiving.height / 2D, event.entity.posZ, 0.5F, event.entity.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing"));
            int dropAmount = (int)(Math.random() * 3D) + 1;
            for(int i = 0; i < dropAmount; i++)
                ItemPlasticPlants.markInactive(event.entity.entityDropItem(new ItemStack(Itemss.plasticPlant, 1, ItemPlasticPlants.CREEPER_PLANT_DAMAGE), 0));
        } else if(Config.enableSquidSeedDrop && event.entity instanceof EntitySquid && Math.random() < 0.05D) {
            ItemPlasticPlants.markInactive(event.entity.entityDropItem(new ItemStack(Itemss.plasticPlant, 1, ItemPlasticPlants.SQUID_PLANT_DAMAGE), 0));
        }
    }
}
 
Example #8
Source File: EntityTrackHandler.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void addInfo(Entity entity, List<String> curInfo){
    if(creeperInFuseTime > 0) {
        if(((EntityCreeper)entity).getCreeperState() == 1) {
            curInfo.add(EnumChatFormatting.RED + "FUSE: " + Math.round((30 - creeperInFuseTime) / 20F * 10F) / 10F + "s !");
        } else {
            curInfo.add(EnumChatFormatting.DARK_GREEN + "Cooling down: " + Math.round((30 - creeperInFuseTime) / 20F * 10F) / 10F + "s !");
        }
    }
}
 
Example #9
Source File: EntityTrackHandler.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void update(Entity entity){
    if(((EntityCreeper)entity).getCreeperState() == 1) {
        creeperInFuseTime++;
        if(creeperInFuseTime > 30) creeperInFuseTime = 30;
    } else {
        creeperInFuseTime--;
        if(creeperInFuseTime < 0) creeperInFuseTime = 0;
    }
}
 
Example #10
Source File: MoCEntityLitterBox.java    From mocreaturesdev with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onUpdate()
{
    super.onUpdate();
    if (onGround)
    {
        setPickedUp(false);
    }
    if (getUsedLitter() && MoCreatures.isServer())
    {
        littertime++;
        worldObj.spawnParticle("smoke", posX, posY, posZ, 0.0D, 0.0D, 0.0D);
        List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.expand(12D, 4D, 12D));
        for (int i = 0; i < list.size(); i++)
        {
            Entity entity = (Entity) list.get(i);
            if (!(entity instanceof EntityMob))
            {
                continue;
            }
            EntityMob entitymob = (EntityMob) entity;
            entitymob.setAttackTarget(this);
            if (entitymob instanceof EntityCreeper)
            {
                ((EntityCreeper) entitymob).setCreeperState(-1);
            }
            if (entitymob instanceof MoCEntityOgre)
            {
                ((MoCEntityOgre) entitymob).pendingSmashAttack = false;
                //((MoCEntityOgre) entitymob).attackTime = 20;
            }
        }

    }
    if (littertime > 5000 && MoCreatures.isServer())
    {
        setUsedLitter(false);
        littertime = 0;
    }
}
 
Example #11
Source File: EntityConcussionCreeper.java    From EnderZoo with Creative Commons Zero v1.0 Universal 5 votes vote down vote up
public EntityConcussionCreeper(World world) {
  super(world);
  try {
    fTimeSinceIgnited = ReflectionHelper.findField(EntityCreeper.class, "timeSinceIgnited", "field_70833_d");
    fFuseTime = ReflectionHelper.findField(EntityCreeper.class, "fuseTime", "field_82225_f");
  } catch (Exception e) {
    Log.error("Could not create ender creeper  logic as fields not found");
  }
}
 
Example #12
Source File: EntityEventHandler.java    From Electro-Magic-Tools with GNU General Public License v3.0 5 votes vote down vote up
@SubscribeEvent
public void onEntityLivingDrops(LivingDropsEvent event) {

    if (event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayer) {
        if (event.entityLiving instanceof EntityCreeper) {
            EntityCreeper creeper = (EntityCreeper) event.entityLiving;
            if (creeper.getPowered()) {
                event.entityLiving.entityDropItem(new ItemStack(IC2ItemRegistry.itemEMTItems, 1, 6), 1);
            }
        }
        if (event.entityLiving instanceof EntityTaintChicken) {
            event.entityLiving.entityDropItem(new ItemStack(IC2ItemRegistry.itemEMTItems, 1, 14), 1);
        }
    }
}
 
Example #13
Source File: AdvancedModEventHandler.java    From AdvancedMod with GNU General Public License v3.0 5 votes vote down vote up
@SubscribeEvent
public void onCreeperSpawn(EntityJoinWorldEvent event){
    if(event.entity instanceof EntityCreeper) {
        ((EntityCreeper)event.entity).explosionRadius = 0;
        try {
            Field field = ReflectionHelper.findField(EntityCreeper.class, "field_82225_f", "fuseTime");
            field.set(event.entity, 80);
        } catch(Throwable e) {
            Log.warn("Reflection on Creeper fuseTime failed!");
            e.printStackTrace();
        }
    }
}
 
Example #14
Source File: LighterBehaviour.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
    if (entity instanceof EntityCreeper) {
        ((EntityCreeper) entity).ignite();
        useItemDurability(player, EnumHand.MAIN_HAND, stack, ItemStack.EMPTY);
        return true;
    }
    return false;
}
 
Example #15
Source File: ServerEventHandler.java    From Et-Futurum with The Unlicense 5 votes vote down vote up
private int getHeadMetadata(EntityLivingBase entity) {
	if (entity.getClass() == EntityZombie.class)
		return 2;
	else if (entity.getClass() == EntitySkeleton.class && ((EntitySkeleton) entity).getSkeletonType() == 0)
		return 0;
	else if (entity.getClass() == EntityCreeper.class)
		return 4;

	return -1;
}
 
Example #16
Source File: ServerEventHandler.java    From Et-Futurum with The Unlicense 5 votes vote down vote up
private boolean isPoweredCreeper(DamageSource source) {
	if (source.isExplosion() && source instanceof EntityDamageSource) {
		Entity entity = ((EntityDamageSource) source).getEntity();
		if (entity != null && entity instanceof EntityCreeper)
			return ((EntityCreeper) entity).getPowered();
	}

	return false;
}
 
Example #17
Source File: BiomeGenStormland.java    From AdvancedRocketry with MIT License 5 votes vote down vote up
public BiomeGenStormland(int biomeId, boolean register) {
	super(new BiomeProperties("Stormland").setBaseHeight(1f).setHeightVariation(0.1f).setRainfall(0.9f).setTemperature(0.9f));
	
       this.setRegistryName(new ResourceLocation("advancedrocketry:Stormland"));
	
	spawnableMonsterList.clear();
	this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityCreeper.class, 5, 1, 1));
	this.spawnableCreatureList.clear();
	this.decorator.generateFalls=false;
	this.decorator.flowersPerChunk=0;
	this.decorator.grassPerChunk=0;
	this.decorator.treesPerChunk=6;
}
 
Example #18
Source File: ActivationRange.java    From Kettle with GNU General Public License v3.0 5 votes vote down vote up
/**
 * If an entity is not in range, do some more checks to see if we should
 * give it a shot.
 *
 * @param entity
 * @return
 */
public static boolean checkEntityImmunities(Entity entity) {
    // quick checks.
    if (entity.inWater || entity.fire > 0) {
        return true;
    }
    if (!(entity instanceof EntityArrow)) {
        if (!entity.onGround || !entity.riddenByEntities.isEmpty() || entity.isRiding()) {
            return true;
        }
    } else if (!((EntityArrow) entity).inGround) {
        return true;
    }
    // special cases.
    if (entity instanceof EntityLiving) {
        EntityLiving living = (EntityLiving) entity;
        if ( /*TODO: Missed mapping? living.attackTicks > 0 || */ living.hurtTime > 0 || living.activePotionsMap.size() > 0) {
            return true;
        }
        if (entity instanceof EntityCreature && ((EntityCreature) entity).getAttackTarget() != null) {
            return true;
        }
        if (entity instanceof EntityVillager && ((EntityVillager) entity).isMating()) {
            return true;
        }
        if (entity instanceof EntityAnimal) {
            EntityAnimal animal = (EntityAnimal) entity;
            if (animal.isChild() || animal.isInLove()) {
                return true;
            }
            if (entity instanceof EntitySheep && ((EntitySheep) entity).getSheared()) {
                return true;
            }
        }
        if (entity instanceof EntityCreeper && ((EntityCreeper) entity).hasIgnited()) { // isExplosive
            return true;
        }
    }
    return false;
}
 
Example #19
Source File: EntityAINearestAttackableTargetFiltered.java    From Wizardry with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Returns whether the EntityAIBase should begin execution.
 */
@SuppressWarnings("unchecked")
public boolean shouldExecute() {
	if (this.targetChance > 0 && this.taskOwner.getRNG().nextInt(this.targetChance) != 0) {
		return false;
	} else if (this.targetClass != EntityPlayer.class && this.targetClass != EntityPlayerMP.class) {
		List<T> list = this.taskOwner.world.getEntitiesWithinAABB(this.targetClass, this.getTargetableArea(this.getTargetDistance()), this.targetEntitySelector);

		if (list.isEmpty()) {
			return false;
		} else {
			list.sort(this.sorter);
			this.targetEntity = list.get(0);
			return true;
		}
	} else {
		this.targetEntity = (T) this.taskOwner.world.getNearestAttackablePlayer(this.taskOwner.posX, this.taskOwner.posY + (double) this.taskOwner.getEyeHeight(), this.taskOwner.posZ, this.getTargetDistance(), this.getTargetDistance(), new Function<EntityPlayer, Double>() {
			@Nullable
			public Double apply(@Nullable EntityPlayer p_apply_1_) {
				ItemStack itemstack = p_apply_1_.getItemStackFromSlot(EntityEquipmentSlot.HEAD);

				if (itemstack.getItem() == Items.SKULL) {
					int i = itemstack.getItemDamage();
					boolean flag = EntityAINearestAttackableTargetFiltered.this.taskOwner instanceof EntitySkeleton && i == 0;
					boolean flag1 = EntityAINearestAttackableTargetFiltered.this.taskOwner instanceof EntityZombie && i == 2;
					boolean flag2 = EntityAINearestAttackableTargetFiltered.this.taskOwner instanceof EntityCreeper && i == 4;

					if (flag || flag1 || flag2) {
						return Double.valueOf(0.5D);
					}
				}

				return Double.valueOf(1.0D);
			}
		}, (Predicate<EntityPlayer>) this.targetEntitySelector);
		return this.targetEntity != null;
	}
}
 
Example #20
Source File: EntitySentry.java    From ToroQuest with GNU General Public License v3.0 5 votes vote down vote up
protected void initEntityAI() {
	tasks.addTask(0, new EntityAISwimming(this));
	tasks.addTask(2, new EntityAIAttackMelee(this, 0.5D, false));
	tasks.addTask(7, new EntityAIWander(this, 0.35D));
	tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
	tasks.addTask(8, new EntityAILookIdle(this));

	targetTasks.addTask(2, new EntityAINearestAttackableCivTarget(this));
	targetTasks.addTask(3, new EntityAINearestAttackableTarget<EntityMob>(this, EntityMob.class, 2, false, false, new Predicate<EntityMob>() {
		@Override
		public boolean apply(EntityMob target) {
			return !(target instanceof EntityCreeper);
		}
	}));
}
 
Example #21
Source File: PotionTimeSlow.java    From Wizardry with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void applyAttributesModifiersToEntity(EntityLivingBase entityLivingBaseIn, @Nonnull AbstractAttributeMap attributeMapIn, int amplifier) {
	super.applyAttributesModifiersToEntity(entityLivingBaseIn, attributeMapIn, amplifier);

	if (timeScale(entityLivingBaseIn) == 0 && entityLivingBaseIn instanceof EntityCreature) {
		((EntityLiving) entityLivingBaseIn).setNoAI(true);

		if(entityLivingBaseIn instanceof EntityCreeper) {
			((EntityCreeper)entityLivingBaseIn).setCreeperState(-1);
		}
	}

	entityLivingBaseIn.world.playSound(null, entityLivingBaseIn.getPosition(), ModSounds.SLOW_MOTION_IN, SoundCategory.NEUTRAL, 1f, 1);
}
 
Example #22
Source File: CraftCreeper.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
public CraftCreeper(CraftServer server, EntityCreeper entity) {
    super(server, entity);
}
 
Example #23
Source File: CraftCreeper.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
@Override
public EntityCreeper getHandle() {
    return (EntityCreeper) entity;
}
 
Example #24
Source File: HackableCreeper.java    From PneumaticCraft with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean afterHackTick(Entity entity){
    ((EntityCreeper)entity).setCreeperState(1);
    return true;
}
 
Example #25
Source File: EntityTrackHandler.java    From PneumaticCraft with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean isApplicable(Entity entity){
    return entity instanceof EntityCreeper;
}
 
Example #26
Source File: RenderConcussionCreeper.java    From EnderZoo with Creative Commons Zero v1.0 Universal 4 votes vote down vote up
@Override
public Render<? super EntityCreeper> createRenderFor(RenderManager manager) {
  return new RenderConcussionCreeper(manager);
}
 
Example #27
Source File: RenderConcussionCreeper.java    From EnderZoo with Creative Commons Zero v1.0 Universal 4 votes vote down vote up
/**
 * Returns the location of an entity's texture. Doesn't seem to be called
 * unless you call Render.bindEntityTexture.
 */
@Override
protected ResourceLocation getEntityTexture(EntityCreeper p_110775_1_) {
  return creeperTextures;
}
 
Example #28
Source File: BlockFluidWitchwater.java    From ExNihiloAdscensio with MIT License 4 votes vote down vote up
@Override
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity) {
	
	if (world.isRemote)
		return;
	
	if (entity.isDead)
		return;
	
	if (entity instanceof EntitySkeleton) {
		
		EntitySkeleton skeleton = (EntitySkeleton) entity;
		if (skeleton.getSkeletonType() == SkeletonType.NORMAL) {
			skeleton.setSkeletonType(SkeletonType.WITHER);
			skeleton.setHealth(skeleton.getMaxHealth());
			
			return;
		}
	}
	
	if (entity instanceof EntityCreeper) {
		EntityCreeper creeper = (EntityCreeper) entity;
		if (!creeper.getPowered()) {
			creeper.onStruckByLightning(null);
			creeper.setHealth(creeper.getMaxHealth());
			
			return;
		}
	}
	
	if (entity instanceof EntitySpider && !(entity instanceof EntityCaveSpider)) {
		EntitySpider spider = (EntitySpider) entity;
		spider.setDead();
		
		EntityCaveSpider caveSpider = new EntityCaveSpider(world);
		caveSpider.setLocationAndAngles(spider.posX, spider.posY, spider.posZ, spider.rotationYaw, spider.rotationPitch);
		caveSpider.renderYawOffset = spider.renderYawOffset;
		caveSpider.setHealth(caveSpider.getMaxHealth());
		
		world.spawnEntity(caveSpider);
		
		return;
	}
	
	if (entity instanceof EntitySquid) {
		EntitySquid squid = (EntitySquid) entity;
		squid.setDead();
		
		EntityGhast ghast = new EntityGhast(world);
		ghast.setLocationAndAngles(squid.posX, squid.posY, squid.posZ, squid.rotationYaw, squid.rotationPitch);
		ghast.renderYawOffset = squid.renderYawOffset;
		ghast.setHealth(ghast.getMaxHealth());
		
		world.spawnEntity(ghast);
		
		return;
	}
	
	if (entity instanceof EntityAnimal) {
		((EntityAnimal) entity).onStruckByLightning(null);
		return;
	}
	
	if (entity instanceof EntityPlayer) {
		EntityPlayer player = (EntityPlayer) entity;
		player.addPotionEffect(new PotionEffect(MobEffects.BLINDNESS, 210, 0));
		player.addPotionEffect(new PotionEffect(MobEffects.WEAKNESS, 210, 2));
		player.addPotionEffect(new PotionEffect(MobEffects.WITHER, 210, 0));
		player.addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 210, 0));
	}
}
 
Example #29
Source File: CraftCreeper.java    From Thermos with GNU General Public License v3.0 4 votes vote down vote up
public CraftCreeper(CraftServer server, EntityCreeper entity) {
    super(server, entity);
}
 
Example #30
Source File: CraftCreeper.java    From Thermos with GNU General Public License v3.0 4 votes vote down vote up
@Override
public EntityCreeper getHandle() {
    return (EntityCreeper) entity;
}