Exemplo n.º 1
0
  @Override
  public boolean attackEntityFrom(DamageSource source, float damage) {
    super.attackEntityFrom(source, damage);

    if (source.getSourceOfDamage() instanceof EntityLivingBase) {
      setTarget(source.getSourceOfDamage());

      // Alert other spiders that this one is being attacked.
      List<Entity> entities =
          RadixLogic.getAllEntitiesWithinDistanceOfCoordinates(worldObj, posX, posY, posZ, 15);

      for (Entity entity : entities) {
        if (entity instanceof EntitySpiderEx) {
          EntitySpiderEx spider = (EntitySpiderEx) entity;

          if (spider.owner.equals(owner)) {
            spider.setTarget(source.getSourceOfDamage());
          }
        }
      }
    }

    return true;
  }