Fixed flying aggro range now working for larger aggro ranges

This commit is contained in:
luisc committed 2021-12-08 06:25:28 -06:00
1 parent 90eec7a57b
commit 29db4bfe33
1 file changed
+4
@@ -1,10 +1,12 @@
package noppes.npcs.ai;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.pathfinding.PathEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import noppes.npcs.CustomNpcs;
import noppes.npcs.constants.AiMutex;
import noppes.npcs.entity.EntityNPCInterface;
@@ -55,7 +57,9 @@ public class EntityAIAttackTarget extends EntityAIBase
}
else{
this.entityTarget = entitylivingbase;
this.attacker.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(((EntityNPCInterface) this.attacker).stats.aggroRange);
this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(entitylivingbase);
this.attacker.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(CustomNpcs.NpcNavRange);
return this.entityPathEntity != null;
}
}