Package net.minecraft.entity

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


      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

      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

          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

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

      entity.attackEntityFrom(damageSourceBeeRadioactive, damage);

    }

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

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

      entity.attackEntityFrom(damageSourceBeeAggressive, damage);
    }

    return storedData;
  }
View Full Code Here

            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

            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

                    useMasterEnergy(SUCKING_POWER_COST, true);
                }

                EntityLivingBase entity = MiscTools.getEntityAt(worldObj, EntityLivingBase.class, xCoord, yCoord + 1, zCoord);
                if (entity != null && useMasterEnergy(KILLING_POWER_COST, false))
                    if (entity.attackEntityFrom(DamageSourceCrusher.INSTANCE, 10))
                        useMasterEnergy(SUCKING_POWER_COST, true);
            }

            if (isMaster()) {
                if (clock % 16 == 0)
View Full Code Here

                double size = 0.8;
                List entities = worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getBoundingBox(i - size, posY, k - size, i + size, posY + 2, k + size));
                for (Object e : entities) {
                    if (e instanceof EntityLivingBase) {
                        EntityLivingBase ent = (EntityLivingBase) e;
                        ent.attackEntityFrom(DamageSourceBore.INSTANCE, 2);
                    }
                }
            }

            setMoving(hasFuel() && getDelay() == 0);
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.