Package net.minecraft.server.v1_7_R4

Examples of net.minecraft.server.v1_7_R4.EntityLiving


  }

  @Override
  public boolean isAffected()
  {
    EntityLiving handle = this.m_entity.getHandle();
    return !(handle instanceof EntityAnimal) || ((EntityAnimal)handle).cc();
  }
View Full Code Here


  public boolean shouldExecute()
  {
    if(this.getEntityHandle() == null)
      return false;

    EntityLiving target = NMSUtil.getGoalTarget(this.getEntityHandle());
    if(target == null)
      return false;

    this.m_target = target;
    return false;
View Full Code Here

  }

  @Override
  public boolean update()
  {
    EntityLiving entity = this.getEntityHandle();
    NMSUtil.getControllerLook(this.getEntityHandle()).a(this.m_target, 30, 30);
    double minDist = entity.width * entity.width * 4;
    double dist = entity.e(this.m_target.locX, this.m_target.boundingBox.b, this.m_target.locZ);
    float speed = 0.23F;

    if(dist > minDist && dist < 16)
      speed = 0.4F;
    else if(dist < 255)
View Full Code Here

    if(!this.isTamed())
      return false;
    else
    {
      EntityLiving owner = this.getTamer();
      if(owner == null)
        return false;
      else
      {
        this.m_ownerAttacker = owner.getLastDamager();
        int lastAttackedTick = owner.aK();
        return lastAttackedTick != this.m_lastAttackedTick && this.isSuitableTarget(this.m_ownerAttacker, false);
      }
    }
  }
View Full Code Here

   *
   * @param inMotion
   */
  public void ride(float[] inMotion)
  {
    EntityLiving entity = this.m_entity.getHandle();
    if(entity.passenger == null)
      return;

    this.m_entity.setYaw(entity.passenger.yaw);
    this.m_entity.setPitch(entity.passenger.pitch);
View Full Code Here

  public boolean shouldExecute()
  {
    if(this.m_creeper == null)
      return false;

    EntityLiving target = this.m_creeper.getGoalTarget();
    return this.m_creeper.q() > 0 || target != null && this.m_creeper.e(target) < this.m_minDistanceSqr;
  }
View Full Code Here

  public LivingEntity getTarget()
  {
    if(this.m_entity == null)
      return null;

    EntityLiving target = NMSUtil.getGoalTarget(this.m_entity);
    if(target != null)
      return (LivingEntity)target.getBukkitEntity();

    return null;
  }
View Full Code Here

  public void update()
  {
    if(!this.hasPath() || !this.getEntity().isSpawned())
      return;

    EntityLiving entity = this.getEntity().getHandle();
    if(!NMSUtil.getNavigation(this.m_entity.getHandle()).g() || NMSUtil.getControllerMove(this.m_entity.getHandle()).a())
      return;

    BlockNode next = this.m_currentPath.next();
    if(next == null)
View Full Code Here

      return false;
    else if(!this.m_animal.onGround)
      return false;
    else
    {
      EntityLiving owner = this.m_animal.getOwner();
      if(owner == null)
        return true;

      return !(this.m_animal.e(owner) < 144 && NMSUtil.getGoalTarget(owner) != null) && this.m_canSit;
    }
View Full Code Here

  }

  @Override
  public boolean update()
  {
    EntityLiving entity = this.getEntityHandle();
    NMSUtil.getControllerLook(entity).a(this.m_target, 30, 30);
    if(--this.m_moveTick <= 0)
    {
      this.m_moveTick = 4 + entity.aI().nextInt(7);
      this.getRemoteEntity().move((LivingEntity)this.m_target.getBukkitEntity(), this.getRemoteEntity().getSpeed());
    }

    this.m_attackTick = Math.max(this.m_attackTick - 1, 0);
    double minDist = entity.width * 2 * entity.width * 2;
    if(this.m_attackTick <= 0 && entity.e(this.m_target.locX, this.m_target.boundingBox.b, this.m_target.locZ) <= minDist)
    {
      this.m_attackTick = 20;
      if(entity.be() != null)
        this.getEntityHandle().aR();

      this.attack((LivingEntity)this.m_target.getBukkitEntity());
    }
    return true;
View Full Code Here

TOP

Related Classes of net.minecraft.server.v1_7_R4.EntityLiving

Copyright © 2018 www.massapicom. 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.