Guard against null target in remant AI, fixes #600

This commit is contained in:
Electroblob77
2021-01-17 14:58:59 +00:00
parent 1304c11381
commit 21f7928b9c
@@ -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);