Fix Attack Invisible

This commit is contained in:
Kam committed 2025-04-06 22:47:48 -04:00
1 parent ada1409f58
commit f2a87243d5
1 file changed
+1 -1
@@ -34,7 +34,7 @@ public class NPCAttackSelector implements IEntitySelector {
if (this.npc.ais.directLOS && !this.npc.getEntitySenses().canSee(entity))
return false;
if (!npc.stats.attackInvisible && ((EntityLivingBase) entity).isPotionActive(Potion.invisibility) && npc.getDistanceSqToEntity(entity) < 9)
if (!npc.stats.attackInvisible && ((EntityLivingBase) entity).isPotionActive(Potion.invisibility) && !npc.isInRange(entity, 3.0))
return false;
//prevent the npc from going on an endless killing spree