@Override protected void entityInit() { super.entityInit(); isImmuneToFire = true; }
@Override public void onLivingUpdate() { if (this.world.isRemote) { for (int i = 0; i < 2; ++i) { this.world.spawnParticle(EnumParticleTypes.PORTAL, this.posX + (this.rand.nextDouble() - 0.5D) * this.width, this.posY + this.rand.nextDouble() * this.height - 0.25D, this.posZ + (this.rand.nextDouble() - 0.5D) * this.width, (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), (this.rand.nextDouble() - 0.5D) * 2.0D, new int[0]); } } isJumping = false; super.onLivingUpdate(); }
@Override public boolean attackEntityAsMob(Entity e) { if (e instanceof ReplicatorEntity) { this.hunger -= 0.4; ((ReplicatorEntity) e).hunger += 0.4; } return super.attackEntityAsMob(e); }
entity = new EntityCreeper(world); if(world.rand.nextInt(200) == 0) entity.onStruckByLightning(null); } else switch(world.rand.nextInt(3)) { entity.setPositionAndRotation(x, y, z, world.rand.nextFloat() * 360F, 0); entity.motionX = entity.motionY = entity.motionZ = 0; map.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier("Loonium Modififer Health", 2, 1)); map.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier("Loonium Modififer Damage", 1.5, 1)); entity.getAttributeMap().applyAttributeModifiers(map); entity.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, entity instanceof EntityCreeper ? 100 : Integer.MAX_VALUE, 0)); entity.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, entity instanceof EntityCreeper ? 100 : Integer.MAX_VALUE, 0)); entity.getEntityData().setTag(TAG_ITEMSTACK_TO_DROP, cmp); entity.onInitialSpawn(world.getDifficultyForLocation(pos), null); world.spawnEntity(entity); entity.spawnExplosionParticle();
@Override protected void applyEntityAttributes() { super.applyEntityAttributes(); getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D); applyAttributes(this, ZooConfig.witherCatHealth, ZooConfig.witherCatAttackDamage); }
@Override public void readEntityFromNBT(NBTTagCompound NBTTagCompound) { super.readEntityFromNBT(NBTTagCompound); this.villagerNBTTagCompound = NBTTagCompound.getCompoundTag("villager"); this.fromVillager = NBTTagCompound.getBoolean("fromVillager"); }
@Override public void writeEntityToNBT(NBTTagCompound tag) { super.writeEntityToNBT(tag); tag.setInteger("ttl", getTtl()); }
@Override public IEntityLivingData onInitialSpawn(@Nonnull DifficultyInstance di, @Nullable IEntityLivingData livingData) { spawned = true; return super.onInitialSpawn(di, livingData); }
@Override public boolean attackEntityFrom(DamageSource source, float damage) { if (source.damageType.contains("arrow")) { return false; } return super.attackEntityFrom(source, damage); }
@Override public boolean getCanSpawnHere() { return world.canBlockSeeSky(BlockCoord.get(this)) && super.getCanSpawnHere(); }
@Override public void onDeath(@Nonnull DamageSource cause) { super.onDeath(cause); EntityPlayer player = EntityHelper.getPlayerFromSource(cause); if (player != null) { player.addStat(HFAchievements.killChick); } }
@Override protected void applyEntityAttributes() { super.applyEntityAttributes(); getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D); applyAttributes(this, ZooConfig.witherWitchHealth, NO_ATTACK); }
@Override public void readEntityFromNBT(NBTTagCompound nbt) { super.readEntityFromNBT(nbt); setAlpha(nbt.getFloat("mantis_alpha")); }
@Override public void writeEntityToNBT(NBTTagCompound nbt) { super.writeEntityToNBT(nbt); nbt.setInteger("skin", getSkin()); }
@Override @Nullable public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, @Nullable IEntityLivingData livingdata) { setSkin(rand.nextInt(51)); return super.onInitialSpawn(difficulty, livingdata); }
@Override public boolean attackEntityFrom(DamageSource source, float damage) { if (source.equals(DamageSource.IN_WALL)) return false; return super.attackEntityFrom(source, damage); }
@Override public boolean getCanSpawnHere() { float light = getBrightness(); if (light >= 0F) return isNotColliding(); return super.getCanSpawnHere(); }
@Override public void onDeath(@Nonnull DamageSource cause) { super.onDeath(cause); EntityPlayer player = EntityHelper.getPlayerFromSource(cause); if (player != null) { player.addStat(HFAchievements.killChicken); } }
@Override protected void entityInit() { super.entityInit(); dataManager.register(SCREAMING_INDEX, false); }
@Override protected void applyEntityAttributes() { super.applyEntityAttributes(); getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.3); applyAttributes(this, ZooConfig.miniHealth, ZooConfig.miniAttackDamage); }