Nearest raider option

This commit is contained in:
ThisTestUser
2022-12-23 12:16:32 -05:00
parent 2f38e556ae
commit 910b53f54f
2 changed files with 12 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ public enum EnumTargetGoal {
NEAREST_VULNERABLE_PLAYER("Locate the nearest real player that is in either Survival or Adventure mode."),
NEAREST_PLAYER("Locate the nearest real online player, despite the gamemode."),
NEAREST_HOSTILE("Locate the nearest hostile entity."),
NEAREST_RAIDER("Locate the nearest raider."),
NEAREST_MOB("Locate the nearest mob."),
NEAREST_BOT("Locate the nearest bot."),
NEAREST_BOT_DIFFER("Locate the nearest bot with a different username."),
@@ -20,6 +21,7 @@ public enum EnumTargetGoal {
this.put("nearestvulnerableplayer", NEAREST_VULNERABLE_PLAYER);
this.put("nearestplayer", NEAREST_PLAYER);
this.put("nearesthostile", NEAREST_HOSTILE);
this.put("nearestraider", NEAREST_RAIDER);
this.put("nearestmob", NEAREST_MOB);
this.put("nearestbot", NEAREST_BOT);
this.put("nearestbotdiffer", NEAREST_BOT_DIFFER);

View File

@@ -1464,6 +1464,16 @@ public class LegacyAgent extends Agent {
break;
}
case NEAREST_RAIDER: {
for (LivingEntity entity : bot.getBukkitEntity().getWorld().getLivingEntities()) {
if ((entity instanceof Raider || (entity instanceof Vex vex && vex.getSummoner() instanceof Raider)) && validateCloserEntity(entity, loc, result)) {
result = entity;
}
}
break;
}
case NEAREST_MOB: {
for (LivingEntity entity : bot.getBukkitEntity().getWorld().getLivingEntities()) {
if (entity instanceof Mob && validateCloserEntity(entity, loc, result)) {