9
0
mirror of https://github.com/Auxilor/EcoMobs.git synced 2025-12-22 16:39:25 +00:00

Made the boss instantly target the nearest player

This commit is contained in:
Auxilor
2021-03-20 10:35:28 +00:00
parent d4e175fa28
commit 2a7cfa9962

View File

@@ -508,6 +508,12 @@ public class EcoBoss extends PluginDependent {
}
}).runTaskTimer(0, 1);
for (Entity nearbyEntity : entity.getNearbyEntities(15, 15, 15)) {
if (nearbyEntity instanceof Player && entity instanceof Mob) {
((Mob) entity).setTarget((LivingEntity) nearbyEntity);
}
}
if (this.isBossbarEnabled()) {
createBossBar(entity);
}