diff --git a/TerminatorPlus-API/src/main/java/net/nuggetmc/tplus/api/agent/legacyagent/EnumTargetGoal.java b/TerminatorPlus-API/src/main/java/net/nuggetmc/tplus/api/agent/legacyagent/EnumTargetGoal.java index a708bd1..02eb72f 100644 --- a/TerminatorPlus-API/src/main/java/net/nuggetmc/tplus/api/agent/legacyagent/EnumTargetGoal.java +++ b/TerminatorPlus-API/src/main/java/net/nuggetmc/tplus/api/agent/legacyagent/EnumTargetGoal.java @@ -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); diff --git a/TerminatorPlus-API/src/main/java/net/nuggetmc/tplus/api/agent/legacyagent/LegacyAgent.java b/TerminatorPlus-API/src/main/java/net/nuggetmc/tplus/api/agent/legacyagent/LegacyAgent.java index 4cff264..0833d46 100644 --- a/TerminatorPlus-API/src/main/java/net/nuggetmc/tplus/api/agent/legacyagent/LegacyAgent.java +++ b/TerminatorPlus-API/src/main/java/net/nuggetmc/tplus/api/agent/legacyagent/LegacyAgent.java @@ -1463,6 +1463,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()) {