Examples of attackEntityFrom()


Examples of net.minecraft.entity.Entity.attackEntityFrom()

                    d0 /= d8;
                    d1 /= d8;
                    d2 /= d8;
                    double d9 = worldObj.getBlockDensity(vec3, entity.boundingBox);
                    double d10 = (1.0D - d7) * d9;
                    entity.attackEntityFrom(player == null || type == null ? DamageSource.setExplosionSource(this) : new EntityDamageSourceGun(type.shortName, entity, player, type, false), ((int)((d10 * d10 + d10) / 2.0D * 8.0D * explosionSize + 1.0D)));
                    double d11 = EnchantmentProtection.func_92092_a(entity, d10);
                    entity.motionX += d0 * d11;
                    entity.motionY += d1 * d11;
                    entity.motionZ += d2 * d11;

 
View Full Code Here

Examples of net.minecraft.entity.Entity.attackEntityFrom()

                    d1 /= d8;
                    d2 /= d8;
                    double d9 = (double) this.world.getBlockDensity(vec3, entity.boundingBox);
                    double d10 = (1.0D - d7) * d9;
                    if (!(entity instanceof EntityItem))
                        entity.attackEntityFrom(DamageSource.setExplosionSource(this), (float) ((int) ((d10 * d10 + d10) / 2.0D * 8.0D * (double) this.explosionSize + 1.0D)));
                    double d11 = EnchantmentProtection.func_92092_a(entity, d10);
                    entity.motionX += d0 * d11;
                    entity.motionY += d1 * d11;
                    entity.motionZ += d2 * d11;

 
View Full Code Here

Examples of net.minecraft.entity.EntityLivingBase.attackEntityFrom()

      Entity source = event.source.getSourceOfDamage();
      if (source != null && source instanceof EntityLivingBase) {
        EntityLivingBase attacker = (EntityLivingBase) source;
        ItemStack itemInUse = attacker.getHeldItem();
        if (itemInUse != null && itemInUse.getItem() == this)
          attacker.attackEntityFrom(DamageSource.magic, 2);
      }
    }
  }

  @Override
View Full Code Here

Examples of net.minecraft.entity.EntityLivingBase.attackEntityFrom()

      motionZ += d2 / d3 * mod;

      if(Math.sqrt(d3) < 1F) {
        if(summoner != null) {
          if(summoner instanceof EntityPlayer)
            target.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) summoner), damage);
          else {
            target.attackEntityFrom(DamageSource.causeMobDamage(summoner), damage);
          }
        } else target.attackEntityFrom(DamageSource.causeMobDamage(this), damage);
        die();
View Full Code Here

Examples of net.minecraft.entity.EntityLivingBase.attackEntityFrom()

      if(Math.sqrt(d3) < 1F) {
        if(summoner != null) {
          if(summoner instanceof EntityPlayer)
            target.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) summoner), damage);
          else {
            target.attackEntityFrom(DamageSource.causeMobDamage(summoner), damage);
          }
        } else target.attackEntityFrom(DamageSource.causeMobDamage(this), damage);
        die();
      }
    }
View Full Code Here

Examples of net.minecraft.entity.EntityLivingBase.attackEntityFrom()

          if(summoner instanceof EntityPlayer)
            target.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) summoner), damage);
          else {
            target.attackEntityFrom(DamageSource.causeMobDamage(summoner), damage);
          }
        } else target.attackEntityFrom(DamageSource.causeMobDamage(this), damage);
        die();
      }
    }

    renderYawOffset = rotationYaw = -((float)Math.atan2(motionX, motionZ)) * 180.0F / (float)Math.PI;
View Full Code Here

Examples of net.minecraft.entity.EntityLivingBase.attackEntityFrom()

          damage = 2;
        else if (count > 0)
          damage = 3;
      }

      entity.attackEntityFrom(damageSourceBeeRadioactive, damage);

    }

    Random rand = housing.getWorld().rand;
    // Radioactivity destroys environment
View Full Code Here

Examples of net.minecraft.entity.EntityLivingBase.attackEntityFrom()

          damage = 2;
        else if (count > 0)
          damage = 3;
      }

      entity.attackEntityFrom(damageSourceBeeAggressive, damage);
    }

    return storedData;
  }
View Full Code Here

Examples of net.minecraft.entity.EntityLivingBase.attackEntityFrom()

            if (entity.isDead)
                return;
            if (entity != this.riddenByEntity && (cartVelocityIsGreaterThan(0.2f) || getEntityData().getBoolean("HighSpeed")) && MiscTools.isKillabledEntity(entity)) {
                EntityLivingBase living = (EntityLivingBase) entity;
                if (RailcraftConfig.locomotiveDamageMobs())
                    living.attackEntityFrom(DamageSourceTrain.INSTANCE, getDamageToRoadKill(living));
                if (living.getHealth() > 0) {
                    float yaw = (rotationYaw - 90) * (float) Math.PI / 180.0F;
                    living.addVelocity(-MathHelper.sin(yaw) * KNOCKBACK * 0.5F, 0.2D, MathHelper.cos(yaw) * KNOCKBACK * 0.5F);
                }
                return;
View Full Code Here

Examples of net.minecraft.entity.EntityLivingBase.attackEntityFrom()

            EntityLivingBase el = (EntityLivingBase) pos.entityHit;
            penetration -= dmg;
            el.knockBack( p, 0, -direction.xCoord, -direction.zCoord );
            // el.knockBack( p, 0, vec3.xCoord,
            // vec3.zCoord );
            el.attackEntityFrom( dmgSrc, dmg );
            if ( !el.isEntityAlive() )
              hasDestroyedSomething = true;
          }
          else if ( pos.entityHit instanceof EntityItem )
          {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.