From 70c77c75d6911609c56419f6a62975f7bef73ac3 Mon Sep 17 00:00:00 2001 From: fapotaa Date: Sat, 25 Jul 2026 18:55:07 +0100 Subject: [PATCH] Update AntiAFK.java This modification improves the Anti-AFK module to be safer when wearing an Elytra. The Problem: The module's random jump feature could trigger two consecutive jumps within a very short time frame (less than 0.75 seconds). This would accidentally activate the Elytra mid-air, causing the player to start flying and slowly drift away from their original position. Over time, this could lead to falling off high ledges or moving into dangerous areas while AFK. The Solution: - Added a cooldown system between random jumps. - The minimum interval between any two jumps is now 1 full second (20 ticks). - This interval is longer than the total duration of a single jump in Minecraft (0.75 seconds), ensuring that two jumps cannot occur while the player is still in the air. The Result: - Elytra cannot be accidentally activated by back-to-back jumps. - The player stays completely stationary and safe while AFK. --- .../systems/modules/player/AntiAFK.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/player/AntiAFK.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/player/AntiAFK.java index d5fbc94826b..925b752411e 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/player/AntiAFK.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/player/AntiAFK.java @@ -16,6 +16,7 @@ import java.util.List; import java.util.Random; +private int jumpCooldown = 0; public class AntiAFK extends Module { private final SettingGroup sgActions = settings.createGroup("Actions"); @@ -176,12 +177,23 @@ public void onDeactivate() { @EventHandler private void onTick(TickEvent.Pre event) { if (!Utils.canUpdate()) return; - + // Jump if (jump.get()) { - if (mc.options.keyJump.isDown()) mc.options.keyJump.setDown(false); - else if (random.nextInt(99) == 0) mc.options.keyJump.setDown(true); + if (jumpCooldown > 0) { + jumpCooldown--; + } + else { + if (mc.options.keyJump.isDown()) { + mc.options.keyJump.setDown(false); + } + else if (random.nextInt(99) == 0) { + mc.options.keyJump.setDown(true); + jumpCooldown = 20; + } + } } + // Swing if (swing.get() && random.nextInt(99) == 0) {