Guard against null target in remant AI, fixes #600
This commit is contained in:
@@ -225,6 +225,7 @@ public class EntityRemnant extends EntityMob {
|
||||
@Override
|
||||
public void startExecuting(){
|
||||
EntityLivingBase entitylivingbase = EntityRemnant.this.getAttackTarget();
|
||||
if(entitylivingbase == null) return;
|
||||
Vec3d vec3d = entitylivingbase.getPositionEyes(1.0F);
|
||||
EntityRemnant.this.moveHelper.setMoveTo(vec3d.x, vec3d.y, vec3d.z, 1.0D);
|
||||
EntityRemnant.this.setAttacking(true);
|
||||
@@ -241,6 +242,8 @@ public class EntityRemnant extends EntityMob {
|
||||
|
||||
EntityLivingBase entitylivingbase = EntityRemnant.this.getAttackTarget();
|
||||
|
||||
if(entitylivingbase == null) return;
|
||||
|
||||
if(EntityRemnant.this.getEntityBoundingBox().intersects(entitylivingbase.getEntityBoundingBox())){
|
||||
EntityRemnant.this.attackEntityAsMob(entitylivingbase);
|
||||
EntityRemnant.this.setAttacking(false);
|
||||
|
||||
Reference in New Issue
Block a user