From 03cb89a2e14ca09cc1274c2c5cd7ec6e7e52d780 Mon Sep 17 00:00:00 2001 From: bbbPriv Date: Wed, 31 Dec 2025 22:35:44 +0100 Subject: [PATCH 1/8] Update KillAura.java Fully working Elytra Target --- .../systems/modules/combat/KillAura.java | 144 ++++++++++++++++-- 1 file changed, 132 insertions(+), 12 deletions(-) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/KillAura.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/KillAura.java index 769dff7ea8..a1c7429b0a 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/KillAura.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/KillAura.java @@ -39,6 +39,7 @@ import net.minecraft.util.Hand; import net.minecraft.util.math.Box; import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.GameMode; import java.util.ArrayList; @@ -49,6 +50,7 @@ public class KillAura extends Module { private final SettingGroup sgGeneral = settings.getDefaultGroup(); private final SettingGroup sgTargeting = settings.createGroup("Targeting"); private final SettingGroup sgTiming = settings.createGroup("Timing"); + private final SettingGroup sgElytra = settings.createGroup("Elytra Target"); // General @@ -248,6 +250,53 @@ public class KillAura extends Module { .build() ); + // Elytra Target + + private final Setting elytraTarget = sgElytra.add(new BoolSetting.Builder() + .name("elytra-target") + .description("Automatically flies towards the target when using Elytra.") + .defaultValue(false) + .build() + ); + + private final Setting extraRange = sgElytra.add(new DoubleSetting.Builder() + .name("extra-range") + .description("Extra range for the Elytra Target rotations.") + .defaultValue(2.0) + .min(0) + .sliderMax(10.0) + .visible(elytraTarget::get) + .build() + ); + + private final Setting predictMultiplier = sgElytra.add(new DoubleSetting.Builder() + .name("prediction") + .description("How much to predict target movement.") + .defaultValue(1.0) + .min(0) + .sliderMax(5.0) + .visible(elytraTarget::get) + .build() + ); + + private final Setting autoFirework = sgElytra.add(new BoolSetting.Builder() + .name("auto-firework") + .description("Automatically uses fireworks to maintain flight speed.") + .defaultValue(true) + .visible(elytraTarget::get) + .build() + ); + + private final Setting fireworkDelay = sgElytra.add(new IntSetting.Builder() + .name("firework-delay") + .description("Ticks between using fireworks.") + .defaultValue(5) + .min(1) + .sliderMax(20) + .visible(autoFirework::get) + .build() + ); + private final static ArrayList FILTER = new ArrayList<>(List.of(Items.DIAMOND_SWORD, Items.DIAMOND_AXE, Items.DIAMOND_PICKAXE, Items.DIAMOND_SHOVEL, Items.DIAMOND_HOE, Items.MACE, Items.DIAMOND_SPEAR, Items.TRIDENT)); private final List targets = new ArrayList<>(); private int switchTimer, hitTimer; @@ -255,6 +304,8 @@ public class KillAura extends Module { public boolean attacking, swapped; public static int previousSlot; + private int fireworkTimer = 0; + public KillAura() { super(Categories.Combat, "kill-aura", "Attacks specified entities around you."); } @@ -263,6 +314,7 @@ public KillAura() { public void onActivate() { previousSlot = -1; swapped = false; + fireworkTimer = 0; } @Override @@ -293,19 +345,16 @@ private void onTick(TickEvent.Pre event) { stopAttacking(); return; } + + // Target Selection + targets.clear(); if (onlyOnLook.get()) { Entity targeted = mc.targetedEntity; - - if (targeted == null || !entityCheck(targeted)) { - stopAttacking(); - return; + if (targeted != null && entityCheck(targeted, true)) { + targets.add(targeted); } - - targets.clear(); - targets.add(mc.targetedEntity); } else { - targets.clear(); - TargetUtils.getList(targets, this::entityCheck, priority.get(), maxTargets.get()); + TargetUtils.getList(targets, entity -> entityCheck(entity, true), priority.get(), maxTargets.get()); } if (targets.isEmpty()) { @@ -315,6 +364,18 @@ private void onTick(TickEvent.Pre event) { Entity primary = targets.getFirst(); + boolean isElytraActive = elytraTarget.get() && ((LivingEntity)mc.player).isGliding(); + if (isElytraActive) { + runElytraTarget(primary); + } + + // Re-check entity for attack range (normal range) + if (!entityCheck(primary, false)) { + stopAttacking(); + return; + } + + // Auto Switch if (autoSwitch.get()) { FindItemResult weaponResult = new FindItemResult(mc.player.getInventory().getSelectedSlot(), -1); if (attackWhenHolding.get() == AttackItems.Weapons) weaponResult = InvUtils.find(this::acceptableWeapon, 0, 8); @@ -338,7 +399,11 @@ private void onTick(TickEvent.Pre event) { } attacking = true; - if (rotation.get() == RotationMode.Always) Rotations.rotate(Rotations.getYaw(primary), Rotations.getPitch(primary, Target.Body)); + + if (!isElytraActive) { + if (rotation.get() == RotationMode.Always) Rotations.rotate(Rotations.getYaw(primary), Rotations.getPitch(primary, Target.Body)); + } + if (pauseOnCombat.get() && PathManagers.get().isPathing() && !wasPathing) { PathManagers.get().pause(); wasPathing = true; @@ -347,6 +412,56 @@ private void onTick(TickEvent.Pre event) { if (delayCheck()) targets.forEach(this::attack); } + private void runElytraTarget(Entity target) { + if (target == null) return; + + // Eyes pos + Vec3d targetPos = new Vec3d(target.getX(), target.getY() + target.getEyeHeight(target.getPose()), target.getZ()); + + if (predictMultiplier.get() > 0) { + targetPos = targetPos.add(target.getVelocity().multiply(predictMultiplier.get())); + } + + Vec3d playerPos = new Vec3d(mc.player.getX(), mc.player.getY(), mc.player.getZ()); + Vec3d directionToTarget = targetPos.subtract(playerPos).normalize(); + double distance = playerPos.distanceTo(targetPos); + double idealDist = 1; + + Vec3d steerPos = targetPos; + if (distance < idealDist) { + steerPos = targetPos.subtract(directionToTarget.multiply(idealDist - distance)); + } + + Rotations.rotate(Rotations.getYaw(steerPos), Rotations.getPitch(steerPos), 10, null); + + // velocity adjustment + Vec3d steerVec = steerPos.subtract(playerPos).normalize(); + double currentSpeed = mc.player.getVelocity().length(); + + if (currentSpeed > 0.1) { + Vec3d newVelocity = steerVec.multiply(currentSpeed); + mc.player.setVelocity(newVelocity.x, newVelocity.y, newVelocity.z); + } + + // Auto Firework + if (autoFirework.get()) { + if (fireworkTimer > 0) { + fireworkTimer--; + } else { + if (currentSpeed < 1.0 || distance > idealDist + 10) { + FindItemResult firework = InvUtils.find(item -> item.getItem() == Items.FIREWORK_ROCKET); + if (firework.found()) { + int prevSlot = mc.player.getInventory().getSelectedSlot(); + InvUtils.swap(firework.slot(), false); + mc.interactionManager.interactItem(mc.player, Hand.MAIN_HAND); + InvUtils.swap(prevSlot, false); + fireworkTimer = fireworkDelay.get(); + } + } + } + } + } + @EventHandler private void onSendPacket(PacketEvent.Send event) { if (event.packet instanceof UpdateSelectedSlotC2SPacket) { @@ -380,16 +495,21 @@ private boolean shouldShieldBreak() { return false; } - private boolean entityCheck(Entity entity) { + private boolean entityCheck(Entity entity, boolean useExtraRange) { if (entity.equals(mc.player) || entity.equals(mc.getCameraEntity())) return false; if ((entity instanceof LivingEntity livingEntity && livingEntity.isDead()) || !entity.isAlive()) return false; + double currentRange = range.get(); + if (useExtraRange && elytraTarget.get() && ((LivingEntity)mc.player).isGliding()) { + currentRange += extraRange.get(); + } + Box hitbox = entity.getBoundingBox(); if (!PlayerUtils.isWithin( MathHelper.clamp(mc.player.getX(), hitbox.minX, hitbox.maxX), MathHelper.clamp(mc.player.getY(), hitbox.minY, hitbox.maxY), MathHelper.clamp(mc.player.getZ(), hitbox.minZ, hitbox.maxZ), - range.get() + currentRange )) return false; if (!entities.get().contains(entity.getType())) return false; From fa7d23b4b5bf580872c4c7cfdabe7a9442d3df3e Mon Sep 17 00:00:00 2001 From: bbbPriv Date: Wed, 31 Dec 2025 22:45:39 +0100 Subject: [PATCH 2/8] Update KillAura.java --- .../meteorclient/systems/modules/combat/KillAura.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/KillAura.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/KillAura.java index a1c7429b0a..5cf9a9f27c 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/KillAura.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/KillAura.java @@ -281,7 +281,7 @@ public class KillAura extends Module { private final Setting autoFirework = sgElytra.add(new BoolSetting.Builder() .name("auto-firework") - .description("Automatically uses fireworks to maintain flight speed.") + .description("Automatically uses fireworks to maintain flight speed and chase targets.") .defaultValue(true) .visible(elytraTarget::get) .build() From 06e9596bf8eba6d8a5944360b827e7d4bbce03ad Mon Sep 17 00:00:00 2001 From: bbbPriv Date: Wed, 31 Dec 2025 22:46:23 +0100 Subject: [PATCH 3/8] Update KillAura.java --- .../meteorclient/systems/modules/combat/KillAura.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/KillAura.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/KillAura.java index 5cf9a9f27c..710763ac58 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/KillAura.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/KillAura.java @@ -281,7 +281,7 @@ public class KillAura extends Module { private final Setting autoFirework = sgElytra.add(new BoolSetting.Builder() .name("auto-firework") - .description("Automatically uses fireworks to maintain flight speed and chase targets.") + .description("Automatically uses fireworks to maintain flight speed and chase target.") .defaultValue(true) .visible(elytraTarget::get) .build() From 854056d97945900bba19702a05ecfa0fcabe90b5 Mon Sep 17 00:00:00 2001 From: bbbPriv Date: Thu, 1 Jan 2026 00:50:05 +0100 Subject: [PATCH 4/8] Update KillAura.java --- .../systems/modules/combat/KillAura.java | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/KillAura.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/KillAura.java index 710763ac58..f57a6b3aa1 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/KillAura.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/KillAura.java @@ -272,7 +272,7 @@ public class KillAura extends Module { private final Setting predictMultiplier = sgElytra.add(new DoubleSetting.Builder() .name("prediction") .description("How much to predict target movement.") - .defaultValue(1.0) + .defaultValue(1.5) .min(0) .sliderMax(5.0) .visible(elytraTarget::get) @@ -281,7 +281,7 @@ public class KillAura extends Module { private final Setting autoFirework = sgElytra.add(new BoolSetting.Builder() .name("auto-firework") - .description("Automatically uses fireworks to maintain flight speed and chase target.") + .description("Uses fireworks to maintain speed and automatically chase targets that get too far away.") .defaultValue(true) .visible(elytraTarget::get) .build() @@ -346,7 +346,7 @@ private void onTick(TickEvent.Pre event) { return; } - // Target Selection + // 1. SELECT TARGETS (Using extra range if gliding) targets.clear(); if (onlyOnLook.get()) { Entity targeted = mc.targetedEntity; @@ -364,14 +364,19 @@ private void onTick(TickEvent.Pre event) { Entity primary = targets.getFirst(); + // 2. RUN ELYTRA LOGIC (ROTATION + FIREWORKS) + // This is now independent of the attack return check boolean isElytraActive = elytraTarget.get() && ((LivingEntity)mc.player).isGliding(); if (isElytraActive) { runElytraTarget(primary); } - // Re-check entity for attack range (normal range) + // 3. COMBAT RANGE CHECK + // We only continue if we are within the ACTUAL attack range if (!entityCheck(primary, false)) { - stopAttacking(); + // Note: We don't call stopAttacking() here because we want + // the module to stay active for rotations/fireworks + attacking = false; return; } @@ -394,7 +399,7 @@ private void onTick(TickEvent.Pre event) { } if (!acceptableWeapon(mc.player.getMainHandStack())) { - stopAttacking(); + attacking = false; return; } @@ -415,7 +420,6 @@ private void onTick(TickEvent.Pre event) { private void runElytraTarget(Entity target) { if (target == null) return; - // Eyes pos Vec3d targetPos = new Vec3d(target.getX(), target.getY() + target.getEyeHeight(target.getPose()), target.getZ()); if (predictMultiplier.get() > 0) { @@ -434,7 +438,6 @@ private void runElytraTarget(Entity target) { Rotations.rotate(Rotations.getYaw(steerPos), Rotations.getPitch(steerPos), 10, null); - // velocity adjustment Vec3d steerVec = steerPos.subtract(playerPos).normalize(); double currentSpeed = mc.player.getVelocity().length(); @@ -443,12 +446,13 @@ private void runElytraTarget(Entity target) { mc.player.setVelocity(newVelocity.x, newVelocity.y, newVelocity.z); } - // Auto Firework + // FIREWORK LOGIC if (autoFirework.get()) { if (fireworkTimer > 0) { fireworkTimer--; } else { - if (currentSpeed < 1.0 || distance > idealDist + 10) { + // If moving slow OR target is escaping (distance > hitRange + buffer) + if (currentSpeed < 1.0 || distance > (range.get() + 2.0)) { FindItemResult firework = InvUtils.find(item -> item.getItem() == Items.FIREWORK_ROCKET); if (firework.found()) { int prevSlot = mc.player.getInventory().getSelectedSlot(); From 4624ee1f73ce4e54eeec35042d54f78e6cfdfda9 Mon Sep 17 00:00:00 2001 From: bbbPriv Date: Thu, 1 Jan 2026 00:51:12 +0100 Subject: [PATCH 5/8] Delete src/main/java/meteordevelopment/meteorclient/systems/modules/combat/KillAura.java --- .../systems/modules/combat/KillAura.java | 622 ------------------ 1 file changed, 622 deletions(-) delete mode 100644 src/main/java/meteordevelopment/meteorclient/systems/modules/combat/KillAura.java diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/KillAura.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/KillAura.java deleted file mode 100644 index f57a6b3aa1..0000000000 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/KillAura.java +++ /dev/null @@ -1,622 +0,0 @@ -/* - * This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client). - * Copyright (c) Meteor Development. - */ - -package meteordevelopment.meteorclient.systems.modules.combat; - -import meteordevelopment.meteorclient.events.packets.PacketEvent; -import meteordevelopment.meteorclient.events.world.TickEvent; -import meteordevelopment.meteorclient.pathing.PathManagers; -import meteordevelopment.meteorclient.settings.*; -import meteordevelopment.meteorclient.systems.friends.Friends; -import meteordevelopment.meteorclient.systems.modules.Categories; -import meteordevelopment.meteorclient.systems.modules.Module; -import meteordevelopment.meteorclient.systems.modules.Modules; -import meteordevelopment.meteorclient.utils.entity.EntityUtils; -import meteordevelopment.meteorclient.utils.entity.SortPriority; -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 meteordevelopment.meteorclient.utils.world.TickRate; -import meteordevelopment.orbit.EventHandler; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityType; -import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.Tameable; -import net.minecraft.entity.mob.EndermanEntity; -import net.minecraft.entity.mob.PiglinEntity; -import net.minecraft.entity.mob.ZombifiedPiglinEntity; -import net.minecraft.entity.passive.AnimalEntity; -import net.minecraft.entity.passive.WolfEntity; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.item.*; -import net.minecraft.network.packet.c2s.play.UpdateSelectedSlotC2SPacket; -import net.minecraft.registry.tag.ItemTags; -import net.minecraft.util.Hand; -import net.minecraft.util.math.Box; -import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; -import net.minecraft.world.GameMode; - -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -public class KillAura extends Module { - private final SettingGroup sgGeneral = settings.getDefaultGroup(); - private final SettingGroup sgTargeting = settings.createGroup("Targeting"); - private final SettingGroup sgTiming = settings.createGroup("Timing"); - private final SettingGroup sgElytra = settings.createGroup("Elytra Target"); - - // General - - private final Setting attackWhenHolding = sgGeneral.add(new EnumSetting.Builder() - .name("attack-when-holding") - .description("Only attacks an entity when a specified item is in your hand.") - .defaultValue(AttackItems.Weapons) - .build() - ); - - private final Setting> weapons = sgGeneral.add(new ItemListSetting.Builder() - .name("selected-weapon-types") - .description("Which types of weapons to attack with (if you select the diamond sword, any type of sword may be used to attack).") - .defaultValue(Items.DIAMOND_SWORD, Items.DIAMOND_AXE, Items.TRIDENT) - .filter(FILTER::contains) - .visible(() -> attackWhenHolding.get() == AttackItems.Weapons) - .build() - ); - - private final Setting rotation = sgGeneral.add(new EnumSetting.Builder() - .name("rotate") - .description("Determines when you should rotate towards the target.") - .defaultValue(RotationMode.Always) - .build() - ); - - private final Setting autoSwitch = sgGeneral.add(new BoolSetting.Builder() - .name("auto-switch") - .description("Switches to an acceptable weapon when attacking the target.") - .defaultValue(false) - .build() - ); - - private final Setting swapBack = sgGeneral.add(new BoolSetting.Builder() - .name("swap-back") - .description("Switches to your previous slot when done attacking the target.") - .defaultValue(false) - .visible(autoSwitch::get) - .build() - ); - - private final Setting shieldMode = sgGeneral.add(new EnumSetting.Builder() - .name("shield-mode") - .description("Will try and use an axe to break target shields.") - .defaultValue(ShieldMode.Break) - .visible(autoSwitch::get) - .build() - ); - - private final Setting onlyOnClick = sgGeneral.add(new BoolSetting.Builder() - .name("only-on-click") - .description("Only attacks when holding left click.") - .defaultValue(false) - .build() - ); - - private final Setting onlyOnLook = sgGeneral.add(new BoolSetting.Builder() - .name("only-on-look") - .description("Only attacks when looking at an entity.") - .defaultValue(false) - .build() - ); - - private final Setting pauseOnCombat = sgGeneral.add(new BoolSetting.Builder() - .name("pause-baritone") - .description("Freezes Baritone temporarily until you are finished attacking the entity.") - .defaultValue(true) - .build() - ); - - // Targeting - - private final Setting>> entities = sgTargeting.add(new EntityTypeListSetting.Builder() - .name("entities") - .description("Entities to attack.") - .onlyAttackable() - .defaultValue(EntityType.PLAYER) - .build() - ); - - private final Setting priority = sgTargeting.add(new EnumSetting.Builder() - .name("priority") - .description("How to filter targets within range.") - .defaultValue(SortPriority.ClosestAngle) - .build() - ); - - private final Setting maxTargets = sgTargeting.add(new IntSetting.Builder() - .name("max-targets") - .description("How many entities to target at once.") - .defaultValue(1) - .min(1) - .sliderRange(1, 5) - .visible(() -> !onlyOnLook.get()) - .build() - ); - - private final Setting range = sgTargeting.add(new DoubleSetting.Builder() - .name("range") - .description("The maximum range the entity can be to attack it.") - .defaultValue(4.5) - .min(0) - .sliderMax(6) - .build() - ); - - private final Setting wallsRange = sgTargeting.add(new DoubleSetting.Builder() - .name("walls-range") - .description("The maximum range the entity can be attacked through walls.") - .defaultValue(3.5) - .min(0) - .sliderMax(6) - .build() - ); - - private final Setting mobAgeFilter = sgTargeting.add(new EnumSetting.Builder() - .name("mob-age-filter") - .description("Determines the age of the mobs to target (baby, adult, or both).") - .defaultValue(EntityAge.Adult) - .build() - ); - - private final Setting ignoreNamed = sgTargeting.add(new BoolSetting.Builder() - .name("ignore-named") - .description("Whether or not to attack mobs with a name.") - .defaultValue(false) - .build() - ); - - private final Setting ignorePassive = sgTargeting.add(new BoolSetting.Builder() - .name("ignore-passive") - .description("Will only attack sometimes passive mobs if they are targeting you.") - .defaultValue(true) - .build() - ); - - private final Setting ignoreTamed = sgTargeting.add(new BoolSetting.Builder() - .name("ignore-tamed") - .description("Will avoid attacking mobs you tamed.") - .defaultValue(false) - .build() - ); - - // Timing - - private final Setting pauseOnLag = sgTiming.add(new BoolSetting.Builder() - .name("pause-on-lag") - .description("Pauses if the server is lagging.") - .defaultValue(true) - .build() - ); - - private final Setting pauseOnUse = sgTiming.add(new BoolSetting.Builder() - .name("pause-on-use") - .description("Does not attack while using an item.") - .defaultValue(false) - .build() - ); - - private final Setting pauseOnCA = sgTiming.add(new BoolSetting.Builder() - .name("pause-on-CA") - .description("Does not attack while CA is placing.") - .defaultValue(true) - .build() - ); - - private final Setting tpsSync = sgTiming.add(new BoolSetting.Builder() - .name("TPS-sync") - .description("Tries to sync attack delay with the server's TPS.") - .defaultValue(true) - .build() - ); - - private final Setting customDelay = sgTiming.add(new BoolSetting.Builder() - .name("custom-delay") - .description("Use a custom delay instead of the vanilla cooldown.") - .defaultValue(false) - .build() - ); - - private final Setting hitDelay = sgTiming.add(new IntSetting.Builder() - .name("hit-delay") - .description("How fast you hit the entity in ticks.") - .defaultValue(11) - .min(0) - .sliderMax(60) - .visible(customDelay::get) - .build() - ); - - private final Setting switchDelay = sgTiming.add(new IntSetting.Builder() - .name("switch-delay") - .description("How many ticks to wait before hitting an entity after switching hotbar slots.") - .defaultValue(0) - .min(0) - .sliderMax(10) - .build() - ); - - // Elytra Target - - private final Setting elytraTarget = sgElytra.add(new BoolSetting.Builder() - .name("elytra-target") - .description("Automatically flies towards the target when using Elytra.") - .defaultValue(false) - .build() - ); - - private final Setting extraRange = sgElytra.add(new DoubleSetting.Builder() - .name("extra-range") - .description("Extra range for the Elytra Target rotations.") - .defaultValue(2.0) - .min(0) - .sliderMax(10.0) - .visible(elytraTarget::get) - .build() - ); - - private final Setting predictMultiplier = sgElytra.add(new DoubleSetting.Builder() - .name("prediction") - .description("How much to predict target movement.") - .defaultValue(1.5) - .min(0) - .sliderMax(5.0) - .visible(elytraTarget::get) - .build() - ); - - private final Setting autoFirework = sgElytra.add(new BoolSetting.Builder() - .name("auto-firework") - .description("Uses fireworks to maintain speed and automatically chase targets that get too far away.") - .defaultValue(true) - .visible(elytraTarget::get) - .build() - ); - - private final Setting fireworkDelay = sgElytra.add(new IntSetting.Builder() - .name("firework-delay") - .description("Ticks between using fireworks.") - .defaultValue(5) - .min(1) - .sliderMax(20) - .visible(autoFirework::get) - .build() - ); - - private final static ArrayList FILTER = new ArrayList<>(List.of(Items.DIAMOND_SWORD, Items.DIAMOND_AXE, Items.DIAMOND_PICKAXE, Items.DIAMOND_SHOVEL, Items.DIAMOND_HOE, Items.MACE, Items.DIAMOND_SPEAR, Items.TRIDENT)); - private final List targets = new ArrayList<>(); - private int switchTimer, hitTimer; - private boolean wasPathing = false; - public boolean attacking, swapped; - public static int previousSlot; - - private int fireworkTimer = 0; - - public KillAura() { - super(Categories.Combat, "kill-aura", "Attacks specified entities around you."); - } - - @Override - public void onActivate() { - previousSlot = -1; - swapped = false; - fireworkTimer = 0; - } - - @Override - public void onDeactivate() { - targets.clear(); - stopAttacking(); - } - - @EventHandler - private void onTick(TickEvent.Pre event) { - if (!mc.player.isAlive() || PlayerUtils.getGameMode() == GameMode.SPECTATOR) { - stopAttacking(); - return; - } - if (pauseOnUse.get() && (mc.interactionManager.isBreakingBlock() || mc.player.isUsingItem())) { - stopAttacking(); - return; - } - if (onlyOnClick.get() && !mc.options.attackKey.isPressed()) { - stopAttacking(); - return; - } - if (TickRate.INSTANCE.getTimeSinceLastTick() >= 1f && pauseOnLag.get()) { - stopAttacking(); - return; - } - if (pauseOnCA.get() && Modules.get().get(CrystalAura.class).isActive() && Modules.get().get(CrystalAura.class).kaTimer > 0) { - stopAttacking(); - return; - } - - // 1. SELECT TARGETS (Using extra range if gliding) - targets.clear(); - if (onlyOnLook.get()) { - Entity targeted = mc.targetedEntity; - if (targeted != null && entityCheck(targeted, true)) { - targets.add(targeted); - } - } else { - TargetUtils.getList(targets, entity -> entityCheck(entity, true), priority.get(), maxTargets.get()); - } - - if (targets.isEmpty()) { - stopAttacking(); - return; - } - - Entity primary = targets.getFirst(); - - // 2. RUN ELYTRA LOGIC (ROTATION + FIREWORKS) - // This is now independent of the attack return check - boolean isElytraActive = elytraTarget.get() && ((LivingEntity)mc.player).isGliding(); - if (isElytraActive) { - runElytraTarget(primary); - } - - // 3. COMBAT RANGE CHECK - // We only continue if we are within the ACTUAL attack range - if (!entityCheck(primary, false)) { - // Note: We don't call stopAttacking() here because we want - // the module to stay active for rotations/fireworks - attacking = false; - return; - } - - // Auto Switch - if (autoSwitch.get()) { - FindItemResult weaponResult = new FindItemResult(mc.player.getInventory().getSelectedSlot(), -1); - if (attackWhenHolding.get() == AttackItems.Weapons) weaponResult = InvUtils.find(this::acceptableWeapon, 0, 8); - - if (shouldShieldBreak()) { - FindItemResult axeResult = InvUtils.find(itemStack -> itemStack.getItem() instanceof AxeItem, 0, 8); - if (axeResult.found()) weaponResult = axeResult; - } - - if (!swapped) { - previousSlot = mc.player.getInventory().getSelectedSlot(); - swapped = true; - } - - InvUtils.swap(weaponResult.slot(), false); - } - - if (!acceptableWeapon(mc.player.getMainHandStack())) { - attacking = false; - return; - } - - attacking = true; - - if (!isElytraActive) { - if (rotation.get() == RotationMode.Always) Rotations.rotate(Rotations.getYaw(primary), Rotations.getPitch(primary, Target.Body)); - } - - if (pauseOnCombat.get() && PathManagers.get().isPathing() && !wasPathing) { - PathManagers.get().pause(); - wasPathing = true; - } - - if (delayCheck()) targets.forEach(this::attack); - } - - private void runElytraTarget(Entity target) { - if (target == null) return; - - Vec3d targetPos = new Vec3d(target.getX(), target.getY() + target.getEyeHeight(target.getPose()), target.getZ()); - - if (predictMultiplier.get() > 0) { - targetPos = targetPos.add(target.getVelocity().multiply(predictMultiplier.get())); - } - - Vec3d playerPos = new Vec3d(mc.player.getX(), mc.player.getY(), mc.player.getZ()); - Vec3d directionToTarget = targetPos.subtract(playerPos).normalize(); - double distance = playerPos.distanceTo(targetPos); - double idealDist = 1; - - Vec3d steerPos = targetPos; - if (distance < idealDist) { - steerPos = targetPos.subtract(directionToTarget.multiply(idealDist - distance)); - } - - Rotations.rotate(Rotations.getYaw(steerPos), Rotations.getPitch(steerPos), 10, null); - - Vec3d steerVec = steerPos.subtract(playerPos).normalize(); - double currentSpeed = mc.player.getVelocity().length(); - - if (currentSpeed > 0.1) { - Vec3d newVelocity = steerVec.multiply(currentSpeed); - mc.player.setVelocity(newVelocity.x, newVelocity.y, newVelocity.z); - } - - // FIREWORK LOGIC - if (autoFirework.get()) { - if (fireworkTimer > 0) { - fireworkTimer--; - } else { - // If moving slow OR target is escaping (distance > hitRange + buffer) - if (currentSpeed < 1.0 || distance > (range.get() + 2.0)) { - FindItemResult firework = InvUtils.find(item -> item.getItem() == Items.FIREWORK_ROCKET); - if (firework.found()) { - int prevSlot = mc.player.getInventory().getSelectedSlot(); - InvUtils.swap(firework.slot(), false); - mc.interactionManager.interactItem(mc.player, Hand.MAIN_HAND); - InvUtils.swap(prevSlot, false); - fireworkTimer = fireworkDelay.get(); - } - } - } - } - } - - @EventHandler - private void onSendPacket(PacketEvent.Send event) { - if (event.packet instanceof UpdateSelectedSlotC2SPacket) { - switchTimer = switchDelay.get(); - } - } - - private void stopAttacking() { - if (!attacking) return; - - attacking = false; - if (wasPathing) { - PathManagers.get().resume(); - wasPathing = false; - } - if (swapBack.get() && swapped) { - InvUtils.swap(previousSlot, false); - swapped = false; - } - } - - private boolean shouldShieldBreak() { - for (Entity target : targets) { - if (target instanceof PlayerEntity player) { - if (player.isBlocking() && shieldMode.get() == ShieldMode.Break) { - return true; - } - } - } - - return false; - } - - private boolean entityCheck(Entity entity, boolean useExtraRange) { - if (entity.equals(mc.player) || entity.equals(mc.getCameraEntity())) return false; - if ((entity instanceof LivingEntity livingEntity && livingEntity.isDead()) || !entity.isAlive()) return false; - - double currentRange = range.get(); - if (useExtraRange && elytraTarget.get() && ((LivingEntity)mc.player).isGliding()) { - currentRange += extraRange.get(); - } - - Box hitbox = entity.getBoundingBox(); - if (!PlayerUtils.isWithin( - MathHelper.clamp(mc.player.getX(), hitbox.minX, hitbox.maxX), - MathHelper.clamp(mc.player.getY(), hitbox.minY, hitbox.maxY), - MathHelper.clamp(mc.player.getZ(), hitbox.minZ, hitbox.maxZ), - currentRange - )) return false; - - if (!entities.get().contains(entity.getType())) return false; - if (ignoreNamed.get() && entity.hasCustomName()) return false; - if (!PlayerUtils.canSeeEntity(entity) && !PlayerUtils.isWithin(entity, wallsRange.get())) return false; - if (ignoreTamed.get()) { - if (entity instanceof Tameable tameable - && tameable.getOwner() != null - && tameable.getOwner().equals(mc.player) - ) return false; - } - if (ignorePassive.get()) { - if (entity instanceof EndermanEntity enderman && !enderman.isAngry()) return false; - if (entity instanceof PiglinEntity piglin && !piglin.isAttacking()) return false; - if (entity instanceof ZombifiedPiglinEntity zombifiedPiglin && !zombifiedPiglin.isAttacking()) return false; - if (entity instanceof WolfEntity wolf && !wolf.isAttacking()) return false; - } - if (entity instanceof PlayerEntity player) { - if (player.isCreative()) return false; - if (!Friends.get().shouldAttack(player)) return false; - if (shieldMode.get() == ShieldMode.Ignore && player.isBlocking()) return false; - } - if (entity instanceof AnimalEntity animal) { - return switch (mobAgeFilter.get()) { - case Baby -> animal.isBaby(); - case Adult -> !animal.isBaby(); - case Both -> true; - }; - } - return true; - } - - private boolean delayCheck() { - if (switchTimer > 0) { - switchTimer--; - return false; - } - - float delay = (customDelay.get()) ? hitDelay.get() : 0.5f; - if (tpsSync.get()) delay /= (TickRate.INSTANCE.getTickRate() / 20); - - if (customDelay.get()) { - if (hitTimer < delay) { - hitTimer++; - return false; - } else return true; - } else return mc.player.getAttackCooldownProgress(delay) >= 1; - } - - private void attack(Entity target) { - if (rotation.get() == RotationMode.OnHit) Rotations.rotate(Rotations.getYaw(target), Rotations.getPitch(target, Target.Body)); - - mc.interactionManager.attackEntity(mc.player, target); - mc.player.swingHand(Hand.MAIN_HAND); - - hitTimer = 0; - } - - private boolean acceptableWeapon(ItemStack stack) { - if (shouldShieldBreak()) return stack.getItem() instanceof AxeItem; - if (attackWhenHolding.get() == AttackItems.All) return true; - - if (weapons.get().contains(Items.DIAMOND_SWORD) && stack.isIn(ItemTags.SWORDS)) return true; - if (weapons.get().contains(Items.DIAMOND_AXE) && stack.isIn(ItemTags.AXES)) return true; - if (weapons.get().contains(Items.DIAMOND_PICKAXE) && stack.isIn(ItemTags.PICKAXES)) return true; - if (weapons.get().contains(Items.DIAMOND_SHOVEL) && stack.isIn(ItemTags.SHOVELS)) return true; - if (weapons.get().contains(Items.DIAMOND_HOE) && stack.isIn(ItemTags.HOES)) return true; - if (weapons.get().contains(Items.MACE) && stack.getItem() instanceof MaceItem) return true; - if (weapons.get().contains(Items.DIAMOND_SPEAR) && stack.isIn(ItemTags.SPEARS)) return true; - return weapons.get().contains(Items.TRIDENT) && stack.getItem() instanceof TridentItem; - } - - public Entity getTarget() { - if (!targets.isEmpty()) return targets.getFirst(); - return null; - } - - @Override - public String getInfoString() { - if (!targets.isEmpty()) return EntityUtils.getName(getTarget()); - return null; - } - - public enum AttackItems { - Weapons, - All - } - - public enum RotationMode { - Always, - OnHit, - None - } - - public enum ShieldMode { - Ignore, - Break, - None - } - - public enum EntityAge { - Baby, - Adult, - Both - } -} From cb1f9520c52858c45d3b0a7bda056c3eb57461de Mon Sep 17 00:00:00 2001 From: bbbPriv Date: Thu, 1 Jan 2026 00:54:20 +0100 Subject: [PATCH 6/8] Create KillAura.java --- .../systems/modules/combat/KillAura.java | 615 ++++++++++++++++++ 1 file changed, 615 insertions(+) create mode 100644 src/main/java/meteordevelopment/meteorclient/systems/modules/combat/KillAura.java diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/KillAura.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/KillAura.java new file mode 100644 index 0000000000..e4315b39e3 --- /dev/null +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/KillAura.java @@ -0,0 +1,615 @@ +/* + * This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client). + * Copyright (c) Meteor Development. + */ + +package meteordevelopment.meteorclient.systems.modules.combat; + +import meteordevelopment.meteorclient.events.packets.PacketEvent; +import meteordevelopment.meteorclient.events.world.TickEvent; +import meteordevelopment.meteorclient.pathing.PathManagers; +import meteordevelopment.meteorclient.settings.*; +import meteordevelopment.meteorclient.systems.friends.Friends; +import meteordevelopment.meteorclient.systems.modules.Categories; +import meteordevelopment.meteorclient.systems.modules.Module; +import meteordevelopment.meteorclient.systems.modules.Modules; +import meteordevelopment.meteorclient.utils.entity.EntityUtils; +import meteordevelopment.meteorclient.utils.entity.SortPriority; +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 meteordevelopment.meteorclient.utils.world.TickRate; +import meteordevelopment.orbit.EventHandler; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.Tameable; +import net.minecraft.entity.mob.EndermanEntity; +import net.minecraft.entity.mob.PiglinEntity; +import net.minecraft.entity.mob.ZombifiedPiglinEntity; +import net.minecraft.entity.passive.AnimalEntity; +import net.minecraft.entity.passive.WolfEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.*; +import net.minecraft.network.packet.c2s.play.UpdateSelectedSlotC2SPacket; +import net.minecraft.registry.tag.ItemTags; +import net.minecraft.util.Hand; +import net.minecraft.util.math.Box; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.Vec3d; +import net.minecraft.world.GameMode; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +public class KillAura extends Module { + private final SettingGroup sgGeneral = settings.getDefaultGroup(); + private final SettingGroup sgTargeting = settings.createGroup("Targeting"); + private final SettingGroup sgTiming = settings.createGroup("Timing"); + private final SettingGroup sgElytra = settings.createGroup("Elytra Target"); + + // General + + private final Setting attackWhenHolding = sgGeneral.add(new EnumSetting.Builder() + .name("attack-when-holding") + .description("Only attacks an entity when a specified item is in your hand.") + .defaultValue(AttackItems.Weapons) + .build() + ); + + private final Setting> weapons = sgGeneral.add(new ItemListSetting.Builder() + .name("selected-weapon-types") + .description("Which types of weapons to attack with (if you select the diamond sword, any type of sword may be used to attack).") + .defaultValue(Items.DIAMOND_SWORD, Items.DIAMOND_AXE, Items.TRIDENT) + .filter(FILTER::contains) + .visible(() -> attackWhenHolding.get() == AttackItems.Weapons) + .build() + ); + + private final Setting rotation = sgGeneral.add(new EnumSetting.Builder() + .name("rotate") + .description("Determines when you should rotate towards the target.") + .defaultValue(RotationMode.Always) + .build() + ); + + private final Setting autoSwitch = sgGeneral.add(new BoolSetting.Builder() + .name("auto-switch") + .description("Switches to an acceptable weapon when attacking the target.") + .defaultValue(false) + .build() + ); + + private final Setting swapBack = sgGeneral.add(new BoolSetting.Builder() + .name("swap-back") + .description("Switches to your previous slot when done attacking the target.") + .defaultValue(false) + .visible(autoSwitch::get) + .build() + ); + + private final Setting shieldMode = sgGeneral.add(new EnumSetting.Builder() + .name("shield-mode") + .description("Will try and use an axe to break target shields.") + .defaultValue(ShieldMode.Break) + .visible(autoSwitch::get) + .build() + ); + + private final Setting onlyOnClick = sgGeneral.add(new BoolSetting.Builder() + .name("only-on-click") + .description("Only attacks when holding left click.") + .defaultValue(false) + .build() + ); + + private final Setting onlyOnLook = sgGeneral.add(new BoolSetting.Builder() + .name("only-on-look") + .description("Only attacks when looking at an entity.") + .defaultValue(false) + .build() + ); + + private final Setting pauseOnCombat = sgGeneral.add(new BoolSetting.Builder() + .name("pause-baritone") + .description("Freezes Baritone temporarily until you are finished attacking the entity.") + .defaultValue(true) + .build() + ); + + // Targeting + + private final Setting>> entities = sgTargeting.add(new EntityTypeListSetting.Builder() + .name("entities") + .description("Entities to attack.") + .onlyAttackable() + .defaultValue(EntityType.PLAYER) + .build() + ); + + private final Setting priority = sgTargeting.add(new EnumSetting.Builder() + .name("priority") + .description("How to filter targets within range.") + .defaultValue(SortPriority.ClosestAngle) + .build() + ); + + private final Setting maxTargets = sgTargeting.add(new IntSetting.Builder() + .name("max-targets") + .description("How many entities to target at once.") + .defaultValue(1) + .min(1) + .sliderRange(1, 5) + .visible(() -> !onlyOnLook.get()) + .build() + ); + + private final Setting range = sgTargeting.add(new DoubleSetting.Builder() + .name("range") + .description("The maximum range the entity can be to attack it.") + .defaultValue(4.5) + .min(0) + .sliderMax(6) + .build() + ); + + private final Setting wallsRange = sgTargeting.add(new DoubleSetting.Builder() + .name("walls-range") + .description("The maximum range the entity can be attacked through walls.") + .defaultValue(3.5) + .min(0) + .sliderMax(6) + .build() + ); + + private final Setting mobAgeFilter = sgTargeting.add(new EnumSetting.Builder() + .name("mob-age-filter") + .description("Determines the age of the mobs to target (baby, adult, or both).") + .defaultValue(EntityAge.Adult) + .build() + ); + + private final Setting ignoreNamed = sgTargeting.add(new BoolSetting.Builder() + .name("ignore-named") + .description("Whether or not to attack mobs with a name.") + .defaultValue(false) + .build() + ); + + private final Setting ignorePassive = sgTargeting.add(new BoolSetting.Builder() + .name("ignore-passive") + .description("Will only attack sometimes passive mobs if they are targeting you.") + .defaultValue(true) + .build() + ); + + private final Setting ignoreTamed = sgTargeting.add(new BoolSetting.Builder() + .name("ignore-tamed") + .description("Will avoid attacking mobs you tamed.") + .defaultValue(false) + .build() + ); + + // Timing + + private final Setting pauseOnLag = sgTiming.add(new BoolSetting.Builder() + .name("pause-on-lag") + .description("Pauses if the server is lagging.") + .defaultValue(true) + .build() + ); + + private final Setting pauseOnUse = sgTiming.add(new BoolSetting.Builder() + .name("pause-on-use") + .description("Does not attack while using an item.") + .defaultValue(false) + .build() + ); + + private final Setting pauseOnCA = sgTiming.add(new BoolSetting.Builder() + .name("pause-on-CA") + .description("Does not attack while CA is placing.") + .defaultValue(true) + .build() + ); + + private final Setting tpsSync = sgTiming.add(new BoolSetting.Builder() + .name("TPS-sync") + .description("Tries to sync attack delay with the server's TPS.") + .defaultValue(true) + .build() + ); + + private final Setting customDelay = sgTiming.add(new BoolSetting.Builder() + .name("custom-delay") + .description("Use a custom delay instead of the vanilla cooldown.") + .defaultValue(false) + .build() + ); + + private final Setting hitDelay = sgTiming.add(new IntSetting.Builder() + .name("hit-delay") + .description("How fast you hit the entity in ticks.") + .defaultValue(11) + .min(0) + .sliderMax(60) + .visible(customDelay::get) + .build() + ); + + private final Setting switchDelay = sgTiming.add(new IntSetting.Builder() + .name("switch-delay") + .description("How many ticks to wait before hitting an entity after switching hotbar slots.") + .defaultValue(0) + .min(0) + .sliderMax(10) + .build() + ); + + // Elytra Target + + private final Setting elytraTarget = sgElytra.add(new BoolSetting.Builder() + .name("elytra-target") + .description("Automatically flies towards the target when using Elytra.") + .defaultValue(false) + .build() + ); + + private final Setting extraRange = sgElytra.add(new DoubleSetting.Builder() + .name("extra-range") + .description("Extra range for the Elytra Target rotations.") + .defaultValue(2.0) + .min(0) + .sliderMax(10.0) + .visible(elytraTarget::get) + .build() + ); + + private final Setting predictMultiplier = sgElytra.add(new DoubleSetting.Builder() + .name("prediction") + .description("How much to predict target movement.") + .defaultValue(1.5) + .min(0) + .sliderMax(5.0) + .visible(elytraTarget::get) + .build() + ); + + private final Setting autoFirework = sgElytra.add(new BoolSetting.Builder() + .name("auto-firework") + .description("Uses fireworks to maintain speed and automatically chase targets that get too far away.") + .defaultValue(true) + .visible(elytraTarget::get) + .build() + ); + + private final Setting fireworkDelay = sgElytra.add(new IntSetting.Builder() + .name("firework-delay") + .description("Ticks between using fireworks.") + .defaultValue(5) + .min(1) + .sliderMax(20) + .visible(autoFirework::get) + .build() + ); + + private final static ArrayList FILTER = new ArrayList<>(List.of(Items.DIAMOND_SWORD, Items.DIAMOND_AXE, Items.DIAMOND_PICKAXE, Items.DIAMOND_SHOVEL, Items.DIAMOND_HOE, Items.MACE, Items.DIAMOND_SPEAR, Items.TRIDENT)); + private final List targets = new ArrayList<>(); + private int switchTimer, hitTimer; + private boolean wasPathing = false; + public boolean attacking, swapped; + public static int previousSlot; + + private int fireworkTimer = 0; + + public KillAura() { + super(Categories.Combat, "kill-aura", "Attacks specified entities around you."); + } + + @Override + public void onActivate() { + previousSlot = -1; + swapped = false; + fireworkTimer = 0; + } + + @Override + public void onDeactivate() { + targets.clear(); + stopAttacking(); + } + + @EventHandler + private void onTick(TickEvent.Pre event) { + if (!mc.player.isAlive() || PlayerUtils.getGameMode() == GameMode.SPECTATOR) { + stopAttacking(); + return; + } + if (pauseOnUse.get() && (mc.interactionManager.isBreakingBlock() || mc.player.isUsingItem())) { + stopAttacking(); + return; + } + if (onlyOnClick.get() && !mc.options.attackKey.isPressed()) { + stopAttacking(); + return; + } + if (TickRate.INSTANCE.getTimeSinceLastTick() >= 1f && pauseOnLag.get()) { + stopAttacking(); + return; + } + if (pauseOnCA.get() && Modules.get().get(CrystalAura.class).isActive() && Modules.get().get(CrystalAura.class).kaTimer > 0) { + stopAttacking(); + return; + } + + targets.clear(); + if (onlyOnLook.get()) { + Entity targeted = mc.targetedEntity; + if (targeted != null && entityCheck(targeted, true)) { + targets.add(targeted); + } + } else { + TargetUtils.getList(targets, entity -> entityCheck(entity, true), priority.get(), maxTargets.get()); + } + + if (targets.isEmpty()) { + stopAttacking(); + return; + } + + Entity primary = targets.getFirst(); + + boolean isElytraActive = elytraTarget.get() && ((LivingEntity)mc.player).isGliding(); + if (isElytraActive) { + runElytraTarget(primary); + } + + if (!entityCheck(primary, false)) { + attacking = false; + return; + } + + // Auto Switch + if (autoSwitch.get()) { + FindItemResult weaponResult = new FindItemResult(mc.player.getInventory().getSelectedSlot(), -1); + if (attackWhenHolding.get() == AttackItems.Weapons) weaponResult = InvUtils.find(this::acceptableWeapon, 0, 8); + + if (shouldShieldBreak()) { + FindItemResult axeResult = InvUtils.find(itemStack -> itemStack.getItem() instanceof AxeItem, 0, 8); + if (axeResult.found()) weaponResult = axeResult; + } + + if (!swapped) { + previousSlot = mc.player.getInventory().getSelectedSlot(); + swapped = true; + } + + InvUtils.swap(weaponResult.slot(), false); + } + + if (!acceptableWeapon(mc.player.getMainHandStack())) { + attacking = false; + return; + } + + attacking = true; + + if (!isElytraActive) { + if (rotation.get() == RotationMode.Always) Rotations.rotate(Rotations.getYaw(primary), Rotations.getPitch(primary, Target.Body)); + } + + if (pauseOnCombat.get() && PathManagers.get().isPathing() && !wasPathing) { + PathManagers.get().pause(); + wasPathing = true; + } + + if (delayCheck()) targets.forEach(this::attack); + } + + private void runElytraTarget(Entity target) { + if (target == null) return; + + // Eyes pos + Vec3d targetPos = new Vec3d(target.getX(), target.getY() + target.getEyeHeight(target.getPose()), target.getZ()); + + if (predictMultiplier.get() > 0) { + targetPos = targetPos.add(target.getVelocity().multiply(predictMultiplier.get())); + } + + Vec3d playerPos = new Vec3d(mc.player.getX(), mc.player.getY(), mc.player.getZ()); + Vec3d directionToTarget = targetPos.subtract(playerPos).normalize(); + double distance = playerPos.distanceTo(targetPos); + double idealDist = 1; + + Vec3d steerPos = targetPos; + if (distance < idealDist) { + steerPos = targetPos.subtract(directionToTarget.multiply(idealDist - distance)); + } + + Rotations.rotate(Rotations.getYaw(steerPos), Rotations.getPitch(steerPos), 10, null); + + Vec3d steerVec = steerPos.subtract(playerPos).normalize(); + double currentSpeed = mc.player.getVelocity().length(); + + if (currentSpeed > 0.1) { + Vec3d newVelocity = steerVec.multiply(currentSpeed); + mc.player.setVelocity(newVelocity.x, newVelocity.y, newVelocity.z); + } + + // Auto Firework + if (autoFirework.get()) { + if (fireworkTimer > 0) { + fireworkTimer--; + } else { + if (currentSpeed < 1.0 || distance > (range.get() + 2.0)) { + FindItemResult firework = InvUtils.find(item -> item.getItem() == Items.FIREWORK_ROCKET); + if (firework.found()) { + int prevSlot = mc.player.getInventory().getSelectedSlot(); + InvUtils.swap(firework.slot(), false); + mc.interactionManager.interactItem(mc.player, Hand.MAIN_HAND); + InvUtils.swap(prevSlot, false); + fireworkTimer = fireworkDelay.get(); + } + } + } + } + } + + @EventHandler + private void onSendPacket(PacketEvent.Send event) { + if (event.packet instanceof UpdateSelectedSlotC2SPacket) { + switchTimer = switchDelay.get(); + } + } + + private void stopAttacking() { + if (!attacking) return; + + attacking = false; + if (wasPathing) { + PathManagers.get().resume(); + wasPathing = false; + } + if (swapBack.get() && swapped) { + InvUtils.swap(previousSlot, false); + swapped = false; + } + } + + private boolean shouldShieldBreak() { + for (Entity target : targets) { + if (target instanceof PlayerEntity player) { + if (player.isBlocking() && shieldMode.get() == ShieldMode.Break) { + return true; + } + } + } + + return false; + } + + private boolean entityCheck(Entity entity, boolean useExtraRange) { + if (entity.equals(mc.player) || entity.equals(mc.getCameraEntity())) return false; + if ((entity instanceof LivingEntity livingEntity && livingEntity.isDead()) || !entity.isAlive()) return false; + + double currentRange = range.get(); + if (useExtraRange && elytraTarget.get() && ((LivingEntity)mc.player).isGliding()) { + currentRange += extraRange.get(); + } + + Box hitbox = entity.getBoundingBox(); + if (!PlayerUtils.isWithin( + MathHelper.clamp(mc.player.getX(), hitbox.minX, hitbox.maxX), + MathHelper.clamp(mc.player.getY(), hitbox.minY, hitbox.maxY), + MathHelper.clamp(mc.player.getZ(), hitbox.minZ, hitbox.maxZ), + currentRange + )) return false; + + if (!entities.get().contains(entity.getType())) return false; + if (ignoreNamed.get() && entity.hasCustomName()) return false; + if (!PlayerUtils.canSeeEntity(entity) && !PlayerUtils.isWithin(entity, wallsRange.get())) return false; + if (ignoreTamed.get()) { + if (entity instanceof Tameable tameable + && tameable.getOwner() != null + && tameable.getOwner().equals(mc.player) + ) return false; + } + if (ignorePassive.get()) { + if (entity instanceof EndermanEntity enderman && !enderman.isAngry()) return false; + if (entity instanceof PiglinEntity piglin && !piglin.isAttacking()) return false; + if (entity instanceof ZombifiedPiglinEntity zombifiedPiglin && !zombifiedPiglin.isAttacking()) return false; + if (entity instanceof WolfEntity wolf && !wolf.isAttacking()) return false; + } + if (entity instanceof PlayerEntity player) { + if (player.isCreative()) return false; + if (!Friends.get().shouldAttack(player)) return false; + if (shieldMode.get() == ShieldMode.Ignore && player.isBlocking()) return false; + } + if (entity instanceof AnimalEntity animal) { + return switch (mobAgeFilter.get()) { + case Baby -> animal.isBaby(); + case Adult -> !animal.isBaby(); + case Both -> true; + }; + } + return true; + } + + private boolean delayCheck() { + if (switchTimer > 0) { + switchTimer--; + return false; + } + + float delay = (customDelay.get()) ? hitDelay.get() : 0.5f; + if (tpsSync.get()) delay /= (TickRate.INSTANCE.getTickRate() / 20); + + if (customDelay.get()) { + if (hitTimer < delay) { + hitTimer++; + return false; + } else return true; + } else return mc.player.getAttackCooldownProgress(delay) >= 1; + } + + private void attack(Entity target) { + if (rotation.get() == RotationMode.OnHit) Rotations.rotate(Rotations.getYaw(target), Rotations.getPitch(target, Target.Body)); + + mc.interactionManager.attackEntity(mc.player, target); + mc.player.swingHand(Hand.MAIN_HAND); + + hitTimer = 0; + } + + private boolean acceptableWeapon(ItemStack stack) { + if (shouldShieldBreak()) return stack.getItem() instanceof AxeItem; + if (attackWhenHolding.get() == AttackItems.All) return true; + + if (weapons.get().contains(Items.DIAMOND_SWORD) && stack.isIn(ItemTags.SWORDS)) return true; + if (weapons.get().contains(Items.DIAMOND_AXE) && stack.isIn(ItemTags.AXES)) return true; + if (weapons.get().contains(Items.DIAMOND_PICKAXE) && stack.isIn(ItemTags.PICKAXES)) return true; + if (weapons.get().contains(Items.DIAMOND_SHOVEL) && stack.isIn(ItemTags.SHOVELS)) return true; + if (weapons.get().contains(Items.DIAMOND_HOE) && stack.isIn(ItemTags.HOES)) return true; + if (weapons.get().contains(Items.MACE) && stack.getItem() instanceof MaceItem) return true; + if (weapons.get().contains(Items.DIAMOND_SPEAR) && stack.isIn(ItemTags.SPEARS)) return true; + return weapons.get().contains(Items.TRIDENT) && stack.getItem() instanceof TridentItem; + } + + public Entity getTarget() { + if (!targets.isEmpty()) return targets.getFirst(); + return null; + } + + @Override + public String getInfoString() { + if (!targets.isEmpty()) return EntityUtils.getName(getTarget()); + return null; + } + + public enum AttackItems { + Weapons, + All + } + + public enum RotationMode { + Always, + OnHit, + None + } + + public enum ShieldMode { + Ignore, + Break, + None + } + + public enum EntityAge { + Baby, + Adult, + Both + } +} From 66dd2efb9be0da088ddb99b5131c67767199ee45 Mon Sep 17 00:00:00 2001 From: bbbPriv Date: Mon, 5 Jan 2026 00:33:49 +0100 Subject: [PATCH 7/8] Update Criticals.java Updated NCP mode added --- .../systems/modules/combat/Criticals.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/Criticals.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/Criticals.java index 02e60af412..0b49bea5d1 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/Criticals.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/Criticals.java @@ -104,6 +104,10 @@ private void onSendPacket(PacketEvent.Send event) { sendPacket(0.0625); sendPacket(0); } + case UpdatedNCP -> { + sendPacket(0.0000008); + sendPacket(0); + } case Bypass -> { sendPacket(0.11); sendPacket(0.1100013579); @@ -174,8 +178,14 @@ private void sendPacket(double height) { double y = mc.player.getY(); double z = mc.player.getZ(); - PlayerMoveC2SPacket packet = new PlayerMoveC2SPacket.PositionAndOnGround(x, y + height, z, false, mc.player.horizontalCollision); - ((IPlayerMoveC2SPacket) packet).meteor$setTag(1337); + PlayerMoveC2SPacket packet; + + if (mode.get() == Mode.UpdatedNCP) { + packet = new PlayerMoveC2SPacket.PositionAndOnGround(x, y + height, z, false, false); + } else { + packet = new PlayerMoveC2SPacket.PositionAndOnGround(x, y + height, z, false, mc.player.horizontalCollision); + ((IPlayerMoveC2SPacket) packet).meteor$setTag(1337); + } mc.player.networkHandler.sendPacket(packet); } @@ -195,6 +205,7 @@ public String getInfoString() { public enum Mode { None, Packet, + UpdatedNCP, Bypass, Jump, MiniJump From 924b37fc69e260b1ac8d9d82b50b8d081e68528c Mon Sep 17 00:00:00 2001 From: bbbPriv Date: Mon, 5 Jan 2026 00:34:10 +0100 Subject: [PATCH 8/8] Update Criticals.java --- .../meteorclient/systems/modules/combat/Criticals.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/Criticals.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/Criticals.java index 0b49bea5d1..8a53aaf4cc 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/Criticals.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/Criticals.java @@ -184,9 +184,9 @@ private void sendPacket(double height) { packet = new PlayerMoveC2SPacket.PositionAndOnGround(x, y + height, z, false, false); } else { packet = new PlayerMoveC2SPacket.PositionAndOnGround(x, y + height, z, false, mc.player.horizontalCollision); - ((IPlayerMoveC2SPacket) packet).meteor$setTag(1337); } + ((IPlayerMoveC2SPacket) packet).meteor$setTag(1337); mc.player.networkHandler.sendPacket(packet); }