Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Commit

Permalink
TriggerBot now check Entity type and AntiBot
Browse files Browse the repository at this point in the history
  • Loading branch information
Nekiplay committed Apr 8, 2024
1 parent 509bc99 commit b0991b3
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import meteordevelopment.meteorclient.utils.player.PlayerUtils;
import meteordevelopment.orbit.EventHandler;
import nekiplay.meteorplus.features.modules.misc.MultiTasks;
import nekiplay.meteorplus.features.modules.misc.Teams;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
Expand Down Expand Up @@ -98,7 +99,16 @@ private boolean entityCheck(Entity entity) {
if (entity instanceof PlayerEntity) {
if (((PlayerEntity) entity).isCreative()) return false;
if (!Friends.get().shouldAttack((PlayerEntity) entity)) return false;
AntiBotPlus antiBotPlus = Modules.get().get(AntiBotPlus.class);
Teams teams = Modules.get().get(Teams.class);
if (antiBotPlus != null && antiBotPlus.isBot(entity)) {
return false;
}
if (teams != null && teams.isInYourTeam(entity)) {
return false;
}
}

return !(entity instanceof AnimalEntity) || babies.get() || !((AnimalEntity) entity).isBaby();
}

Expand All @@ -123,7 +133,7 @@ private void onTick(TickEvent.Pre event) {
MultiTasks multiTasks = Modules.get().get(MultiTasks.class);
if (!multiTasks.isActive() && (mc.player.isUsingItem() || mc.interactionManager.isBreakingBlock())) return;

if (delayCheck()) hitEntity(mc.targetedEntity);
if (delayCheck() && entityCheck(mc.targetedEntity)) hitEntity(mc.targetedEntity);
}

private void hitEntity(Entity target) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@

import meteordevelopment.meteorclient.events.world.TickEvent;
import meteordevelopment.meteorclient.systems.friends.Friends;
import meteordevelopment.meteorclient.systems.modules.Modules;
import meteordevelopment.meteorclient.systems.modules.combat.KillAura;
import meteordevelopment.meteorclient.utils.entity.Target;
import meteordevelopment.meteorclient.utils.entity.TargetUtils;
import meteordevelopment.meteorclient.utils.player.FindItemResult;
import meteordevelopment.meteorclient.utils.player.InvUtils;
import meteordevelopment.meteorclient.utils.player.PlayerUtils;
import meteordevelopment.meteorclient.utils.player.Rotations;
import nekiplay.meteorplus.features.modules.combat.AntiBotPlus;
import nekiplay.meteorplus.features.modules.combat.killaura.KillAuraPlus;
import nekiplay.meteorplus.features.modules.combat.killaura.KillAuraPlusMode;
import nekiplay.meteorplus.features.modules.combat.killaura.KillAuraPlusModes;
import nekiplay.meteorplus.features.modules.misc.Teams;
import nekiplay.meteorplus.utils.Perlin2D;
import nekiplay.meteorplus.utils.RaycastUtils;
import nekiplay.meteorplus.utils.RotationUtils;
Expand Down Expand Up @@ -58,9 +61,13 @@ public void onTick(TickEvent.Post event) {
target = TargetUtils.getPlayerTarget(settings.range.get(), settings.priority.get());
TargetUtils.getList(targets, this::entityCheck, settings.priority.get(), settings.maxTargets.get());


if (targets.size() > 0) {
Entity primary = targets.get(0);

AntiBotPlus antiBotPlus = Modules.get().get(AntiBotPlus.class);
Teams teams = Modules.get().get(Teams.class);

List<Entity> targets2 = targets;

if(settings.fov.get() < 360.0)
Expand Down Expand Up @@ -161,6 +168,15 @@ private boolean delayCheck() {
private void attack(Entity target) {
if (Math.random() > settings.hitChance.get() / 100) return;

AntiBotPlus antiBotPlus = Modules.get().get(AntiBotPlus.class);
Teams teams = Modules.get().get(Teams.class);
if (antiBotPlus != null && antiBotPlus.isBot(target)) {
return;
}
if (teams != null && teams.isInYourTeam(target)) {
return;
}

if (settings.rotation.get() == KillAuraPlus.RotationMode.OnHit) rotate(target, () -> hitEntity(target));
else hitEntity(target);
}
Expand Down Expand Up @@ -345,7 +361,21 @@ else if (lastRotate != null) {
}

public Entity getTarget() {
if (!targets.isEmpty()) return targets.get(0);
for (Entity target : targets) {
boolean allow = true;
AntiBotPlus antiBotPlus = Modules.get().get(AntiBotPlus.class);
Teams teams = Modules.get().get(Teams.class);
if (antiBotPlus != null && antiBotPlus.isBot(target)) {
allow = false;
}
if (teams != null && teams.isInYourTeam(target)) {
allow = false;
}
if (allow) {
return target;
}
}

return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ else if (dimension == Dimension.Nether) {
}

private static Value posString(double x, double y, double z) {
return Value.string(String.format("X: %.0f Y: %.0f Z: %.0f", x, y, z));
return Value.string(String.format("X: %.0f Y: %.0f Z: %.0f", x + ConfigModifier.get().x_spoof.get(), y, z + ConfigModifier.get().z_spoof.get()));
}

private static Value getItem(Starscript ss, int argCount) {
Expand Down

0 comments on commit b0991b3

Please sign in to comment.