Package org.bukkit.entity

Examples of org.bukkit.entity.LivingEntity


            this.pitch += this.random.nextInt(5) * (up ? 1 : -1);

            this.getBukkitEntity().launchProjectile(Arrow.class);
        } else {
            this.performAction(Animation.SWING_ARM);
            LivingEntity other = (LivingEntity) entity.getBukkitEntity();
            other.damage(this.getAttributeInstance(GenericAttributes.e).getValue());
        }
        hasAttacked = true;

        if (this.attackTimesLimit == -1)
            return;
View Full Code Here


        case PLAYER:
        case VILLAGER:
        case IRON_GOLEM:
        case SNOWMAN:
        case SHEEP: {
          LivingEntity living = (LivingEntity) i;
          double current = living.getHealth();
          double diff = living.getMaxHealth() - current;
          if ((canHeal) && (diff > 0)) {
            hasHealed = true;
            living.setHealth(current + 1);
            if (EntityType.PLAYER.equals(eType)) {
              Player player = (Player) living;
              player.sendMessage(ChatColor.DARK_GRAY
                  + "A priest heals you ...");
            }
View Full Code Here

  }

  @Override
  public boolean shouldExecute()
  {
    LivingEntity handle = this.getRemoteEntity().getBukkitEntity();
    if(!WorldUtilities.isInCircle(this.m_midSpot.getX(), this.m_midSpot.getZ(), handle.getLocation().getX(), handle.getLocation().getZ(), this.m_Radius) || super.shouldExecute())
    {
      int tries = 0;
      while(!WorldUtilities.isInCircle(this.m_midSpot.getX(), this.m_midSpot.getZ(), this.m_xPos, this.m_zPos, this.m_Radius) && tries <= 10)
      {
        Vec3D vector = RandomPositionGenerator.a(this.getEntityHandle(), 10, 7);
View Full Code Here

    return nearest;
  }

  protected EntityLiving createChild()
  {
    LivingEntity baby = null;
    if(this.getRemoteEntity().getFeatures().hasFeature(MateFeature.class))
    {
      MateFeature feature = this.getRemoteEntity().getFeatures().getFeature(MateFeature.class);
      baby = feature.makeBaby();
    }
View Full Code Here

  }

  @EventHandler(priority=EventPriority.HIGHEST, ignoreCancelled=true)
  public void projectileLaunch(ProjectileLaunchEvent event)
  {
    LivingEntity entity = event.getEntity().getShooter();
    AutoRefMatch match = plugin.getMatch(event.getEntity().getWorld());
    if (!(entity instanceof Player) || match == null) return;

    if (!match.isPlayer((Player) entity))
    { event.setCancelled(true); return; }
View Full Code Here

  }

  @EventHandler(priority= EventPriority.HIGHEST)
  public void projectileLaunch(ProjectileLaunchEvent event)
  {
    LivingEntity shooter = event.getEntity().getShooter();
    if (shooter != null && checkAdminPrivilege(shooter)) return;

    if (event.getEntity().getWorld() == plugin.getLobbyWorld())
      event.setCancelled(true);
  }
View Full Code Here

    if ((e instanceof Player)) return (Player) e;

    // damaging entity is an arrow, then who was bow?
    if ((e instanceof Projectile))
    {
      LivingEntity shooter = ((Projectile) e).getShooter();
      if ((shooter instanceof Player)) return (Player) shooter;
    }
    return null;
  }
View Full Code Here

  public static Location entityTeleport(Entity e)
  {
    Location loc = e.getLocation().clone();
    if (e instanceof LivingEntity)
    {
      LivingEntity live = (LivingEntity) e;
      loc.add(0, live.getEyeHeight(), 0);
    }
    return locationTeleport(loc);
  }
View Full Code Here

 
  @SuppressWarnings("null")
  private static boolean checkDamage(final EntityDamageEvent e) {
    if (!(e.getEntity() instanceof LivingEntity))
      return true;
    final LivingEntity en = (LivingEntity) e.getEntity();
    if (HealthUtils.getHealth(en) <= 0)
      return false;
//    if (en.getNoDamageTicks() <= en.getMaximumNoDamageTicks() / 2) {
//      lastDamages.put(en, e.getDamage());
//      return true;
View Full Code Here

  }
 
  @Override
  public void change(final Event e, final @Nullable Object[] delta, final ChangeMode mode) {
    if (mode == ChangeMode.SET || mode == ChangeMode.DELETE) {
      final LivingEntity target = delta == null ? null : (LivingEntity) delta[0];
      for (final LivingEntity entity : getExpr().getArray(e)) {
        if (getTime() >= 0 && e instanceof EntityTargetEvent && entity.equals(((EntityTargetEvent) e).getEntity()) && !Delay.isDelayed(e)) {
          ((EntityTargetEvent) e).setTarget(target);
        } else {
          if (entity instanceof Creature)
View Full Code Here

TOP

Related Classes of org.bukkit.entity.LivingEntity

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.