本文整理汇总了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();
}
}
示例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();
}
}
示例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));
}
}
示例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;
}
}
}
}
示例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);
}
}
}
示例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);
}
示例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();
}
}
}
示例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();
}
}
}
示例9: shouldExecute
import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public boolean shouldExecute()
{
EntityLivingBase entitylivingbase = this.blaze.getAttackTarget();
return entitylivingbase != null && entitylivingbase.isEntityAlive();
}
示例10: shouldExecute
import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public boolean shouldExecute()
{
EntityLivingBase entitylivingbase = this.theEntity.getAttackTarget();
return entitylivingbase != null && entitylivingbase.isEntityAlive();
}
示例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();
}
示例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);
}
}
}
示例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))));
}
示例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;
}
示例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;
}