當前位置: 首頁>>代碼示例>>Java>>正文


Java EntityLivingBase.isEntityAlive方法代碼示例

本文整理匯總了Java中net.minecraft.entity.EntityLivingBase.isEntityAlive方法的典型用法代碼示例。如果您正苦於以下問題:Java EntityLivingBase.isEntityAlive方法的具體用法?Java EntityLivingBase.isEntityAlive怎麽用?Java EntityLivingBase.isEntityAlive使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.entity.EntityLivingBase的用法示例。


在下文中一共展示了EntityLivingBase.isEntityAlive方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: continueExecuting

import net.minecraft.entity.EntityLivingBase; //導入方法依賴的package包/類
/**
 * Returns whether an in-progress EntityAIBase should continue executing
 */
public boolean continueExecuting()
{
    EntityLivingBase entitylivingbase = this.field_179442_b.getAttackTarget();

    if (entitylivingbase == null)
    {
        return false;
    }
    else if (!entitylivingbase.isEntityAlive())
    {
        return false;
    }
    else
    {
        double d0 = this.func_179438_f();
        return this.field_179442_b.getDistanceSqToEntity(entitylivingbase) > d0 * d0 ? false : !(entitylivingbase instanceof EntityPlayerMP) || !((EntityPlayerMP)entitylivingbase).theItemInWorldManager.isCreative();
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:22,代碼來源:EntityAIFindEntityNearest.java

示例2: onUpdate

import net.minecraft.entity.EntityLivingBase; //導入方法依賴的package包/類
/**
 * Called to update the entity's position/logic.
 */
public void onUpdate()
{
    EntityLivingBase entitylivingbase = this.getThrower();

    if (entitylivingbase != null && entitylivingbase instanceof EntityPlayer && !entitylivingbase.isEntityAlive())
    {
        this.setDead();
    }
    else
    {
        super.onUpdate();
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:17,代碼來源:EntityEnderPearl.java

示例3: cast

import net.minecraft.entity.EntityLivingBase; //導入方法依賴的package包/類
@SuppressWarnings("ConstantConditions")
@Override
public void cast(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {
	final EntityLivingBase entity = (EntityLivingBase) sender.getCommandSenderEntity();
	if (entity.isEntityAlive() && entity.getHealth() < entity.getMaxHealth()) {
		entity.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 80, 0));
	}
}
 
開發者ID:Um-Mitternacht,項目名稱:Bewitchment,代碼行數:9,代碼來源:IncantationHeal.java

示例4: shouldContinueExecuting

import net.minecraft.entity.EntityLivingBase; //導入方法依賴的package包/類
/**
 * A method used to see if an entity is a suitable target through a number
 * of checks. Args : entity, canTargetInvinciblePlayer
 */
@Override
public boolean shouldContinueExecuting() {
	EntityLivingBase entitylivingbase = this.taskOwner.getAttackTarget();

	if (entitylivingbase == null)
		return false;
	else if (!entitylivingbase.isEntityAlive())
		return false;
	else if(!this.targetLock && this.taskOwner.ticksExisted % 13 == 0)
		return this.shouldExecute();
	else {
		Team team = this.taskOwner.getTeam();
		Team team1 = entitylivingbase.getTeam();

		if ((team != null && team1 == team) && !(this.taskOwner instanceof EntityMedic))
			return false;
		else {
			double d0 = this.getTargetDistance();

			if (this.taskOwner.getDistanceSqToEntity(entitylivingbase) > d0 * d0)
				return false;
			else {
				if (this.shouldCheckSight)
					if (this.taskOwner.getEntitySenses().canSee(entitylivingbase))
						this.targetUnseenTicks = 0;
					else if (++this.targetUnseenTicks > 60)
						return false;

				return !(entitylivingbase instanceof EntityPlayer)
						|| !((EntityPlayer) entitylivingbase).capabilities.disableDamage;
			}
		}
	}
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:39,代碼來源:EntityAINearestChecked.java

示例5: isSuitableTarget

import net.minecraft.entity.EntityLivingBase; //導入方法依賴的package包/類
@Override
protected boolean isSuitableTarget(EntityLivingBase target, boolean includeInvincibles) {
	if (target == null)
		return false;
	else if (target == this.taskOwner)
		return false;
	else if (!target.isEntityAlive())
		return false;
	else if (!this.taskOwner.canAttackClass(target.getClass()))
		return false;
	else{
		Team team = this.taskOwner.getTeam();
		Team team1 = target.getTeam();
		boolean medic = (this.taskOwner instanceof EntityMedic);
		if ((team != null && team1 == team) && !medic)
			return false;
		else {
			if (!medic && this.taskOwner instanceof IEntityOwnable
					&& ((IEntityOwnable) this.taskOwner).getOwnerId() != null) {
				if (target instanceof IEntityOwnable && ((IEntityOwnable) this.taskOwner).getOwnerId()
						.equals(((IEntityOwnable) target).getOwnerId()))
					return false;

				if (target == ((IEntityOwnable) this.taskOwner).getOwner())
					return false;
			} else if (target instanceof EntityPlayer && !includeInvincibles
					&& ((EntityPlayer) target).capabilities.disableDamage)
				return false;

			return !this.shouldCheckSight || this.taskOwner.getEntitySenses().canSee(target);
		}
	}
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:34,代碼來源:EntityAINearestChecked.java

示例6: drawEsp

import net.minecraft.entity.EntityLivingBase; //導入方法依賴的package包/類
public static void drawEsp(EntityLivingBase ent, float pTicks, int hexColor, int hexColorIn) {
    if (!ent.isEntityAlive()) {
        return;
    }
    double x = RenderUtils.getDiff(ent.lastTickPosX, ent.posX, pTicks, RenderManager.renderPosX);
    double y = RenderUtils.getDiff(ent.lastTickPosY, ent.posY, pTicks, RenderManager.renderPosY);
    double z = RenderUtils.getDiff(ent.lastTickPosZ, ent.posZ, pTicks, RenderManager.renderPosZ);
    RenderUtils.boundingBox((Entity)ent, x, y, z, hexColor, hexColorIn);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:10,代碼來源:RenderUtils.java

示例7: continueExecuting

import net.minecraft.entity.EntityLivingBase; //導入方法依賴的package包/類
/**
 * Returns whether an in-progress EntityAIBase should continue executing
 */
public boolean continueExecuting()
{
    EntityLivingBase entitylivingbase = this.field_179434_b.getAttackTarget();

    if (entitylivingbase == null)
    {
        return false;
    }
    else if (!entitylivingbase.isEntityAlive())
    {
        return false;
    }
    else if (entitylivingbase instanceof EntityPlayer && ((EntityPlayer)entitylivingbase).capabilities.disableDamage)
    {
        return false;
    }
    else
    {
        Team team = this.field_179434_b.getTeam();
        Team team1 = entitylivingbase.getTeam();

        if (team != null && team1 == team)
        {
            return false;
        }
        else
        {
            double d0 = this.func_179431_f();
            return this.field_179434_b.getDistanceSqToEntity(entitylivingbase) > d0 * d0 ? false : !(entitylivingbase instanceof EntityPlayerMP) || !((EntityPlayerMP)entitylivingbase).theItemInWorldManager.isCreative();
        }
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:36,代碼來源:EntityAIFindEntityNearestPlayer.java

示例8: continueExecuting

import net.minecraft.entity.EntityLivingBase; //導入方法依賴的package包/類
/**
 * Returns whether an in-progress EntityAIBase should continue executing
 */
public boolean continueExecuting()
{
    EntityLivingBase entitylivingbase = this.entityLiving.getAttackTarget();

    if (entitylivingbase == null)
    {
        return false;
    }
    else if (!entitylivingbase.isEntityAlive())
    {
        return false;
    }
    else if (entitylivingbase instanceof EntityPlayer && ((EntityPlayer)entitylivingbase).capabilities.disableDamage)
    {
        return false;
    }
    else
    {
        Team team = this.entityLiving.getTeam();
        Team team1 = entitylivingbase.getTeam();

        if (team != null && team1 == team)
        {
            return false;
        }
        else
        {
            double d0 = this.maxTargetRange();
            return this.entityLiving.getDistanceSqToEntity(entitylivingbase) > d0 * d0 ? false : !(entitylivingbase instanceof EntityPlayerMP) || !((EntityPlayerMP)entitylivingbase).interactionManager.isCreative();
        }
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:36,代碼來源:EntityAIFindEntityNearestPlayer.java

示例9: shouldExecute

import net.minecraft.entity.EntityLivingBase; //導入方法依賴的package包/類
public boolean shouldExecute()
{
    EntityLivingBase entitylivingbase = this.blaze.getAttackTarget();
    return entitylivingbase != null && entitylivingbase.isEntityAlive();
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:6,代碼來源:EntityBlaze.java

示例10: shouldExecute

import net.minecraft.entity.EntityLivingBase; //導入方法依賴的package包/類
public boolean shouldExecute()
{
    EntityLivingBase entitylivingbase = this.theEntity.getAttackTarget();
    return entitylivingbase != null && entitylivingbase.isEntityAlive();
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:6,代碼來源:EntityGuardian.java

示例11: shouldExecute

import net.minecraft.entity.EntityLivingBase; //導入方法依賴的package包/類
/**
 * Returns whether the EntityAIBase should begin execution.
 */
public boolean shouldExecute()
{
    EntityLivingBase entitylivingbase = this.blaze.getAttackTarget();
    return entitylivingbase != null && entitylivingbase.isEntityAlive();
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:9,代碼來源:EntityBlaze.java

示例12: isSuitableTarget

import net.minecraft.entity.EntityLivingBase; //導入方法依賴的package包/類
/**
 * A static method used to see if an entity is a suitable target through a number of checks.
 */
public static boolean isSuitableTarget(EntityLiving attacker, EntityLivingBase target, boolean includeInvincibles, boolean checkSight)
{
    if (target == null)
    {
        return false;
    }
    else if (target == attacker)
    {
        return false;
    }
    else if (!target.isEntityAlive())
    {
        return false;
    }
    else if (!attacker.canAttackClass(target.getClass()))
    {
        return false;
    }
    else
    {
        Team team = attacker.getTeam();
        Team team1 = target.getTeam();

        if (team != null && team1 == team)
        {
            return false;
        }
        else
        {
            if (attacker instanceof IEntityOwnable && StringUtils.isNotEmpty(((IEntityOwnable)attacker).getOwnerId()))
            {
                if (target instanceof IEntityOwnable && ((IEntityOwnable)attacker).getOwnerId().equals(((IEntityOwnable)target).getOwnerId()))
                {
                    return false;
                }

                if (target == ((IEntityOwnable)attacker).getOwner())
                {
                    return false;
                }
            }
            else if (target instanceof EntityPlayer && !includeInvincibles && ((EntityPlayer)target).capabilities.disableDamage)
            {
                return false;
            }

            return !checkSight || attacker.getEntitySenses().canSee(target);
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:54,代碼來源:EntityAITarget.java

示例13: continueExecuting

import net.minecraft.entity.EntityLivingBase; //導入方法依賴的package包/類
/**
 * Returns whether an in-progress EntityAIBase should continue executing
 */
public boolean continueExecuting()
{
    EntityLivingBase entitylivingbase = this.attacker.getAttackTarget();
    return entitylivingbase == null ? false : (!entitylivingbase.isEntityAlive() ? false : (!this.longMemory ? !this.attacker.getNavigator().noPath() : this.attacker.isWithinHomeDistanceFromPosition(new BlockPos(entitylivingbase))));
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:9,代碼來源:EntityAIAttackOnCollide.java

示例14: shouldExecute

import net.minecraft.entity.EntityLivingBase; //導入方法依賴的package包/類
/**
 * Returns whether the EntityAIBase should begin execution.
 */
public boolean shouldExecute()
{
    EntityLivingBase entitylivingbase = EntityShulker.this.getAttackTarget();
    return entitylivingbase != null && entitylivingbase.isEntityAlive() ? EntityShulker.this.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL : false;
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:9,代碼來源:EntityShulker.java

示例15: shouldExecute

import net.minecraft.entity.EntityLivingBase; //導入方法依賴的package包/類
public boolean shouldExecute()
{
    EntityLivingBase entitylivingbase = EntityShulker.this.getAttackTarget();
    return entitylivingbase != null && entitylivingbase.isEntityAlive() ? EntityShulker.this.world.getDifficulty() != EnumDifficulty.PEACEFUL : false;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:6,代碼來源:EntityShulker.java


注:本文中的net.minecraft.entity.EntityLivingBase.isEntityAlive方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。