Skip to content
This repository was archived by the owner on Nov 6, 2024. It is now read-only.

Commit

Permalink
Merge pull request #200 from EbatteSratte/main
Browse files Browse the repository at this point in the history
AntiAfk
  • Loading branch information
Pan4ur authored Jan 20, 2024
2 parents 3b21a18 + b00e05e commit 39520e2
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/thunder/hack/core/impl/ModuleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public class ModuleManager implements IManager {
public static FakePlayer fakePlayer = new FakePlayer();
public static ElytraSwap elytraSwap = new ElytraSwap();
public static ElytraPlus elytraPlus = new ElytraPlus();
public static AntiAfk antiAfk = new AntiAfk();
public static CevBreaker cevBreaker = new CevBreaker();
public static AutoSprint autoSprint = new AutoSprint();
public static AutoGApple autoGApple = new AutoGApple();
Expand Down
45 changes: 45 additions & 0 deletions src/main/java/thunder/hack/modules/misc/AntiAfk.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package thunder.hack.modules.misc;

import thunder.hack.modules.Module;
import thunder.hack.setting.Setting;

import java.util.Random;

public class AntiAfk extends Module {
public AntiAfk() {
super("AntiAfk", Category.MISC);
}
private final Setting<Boolean> spin = new Setting<>("Spin", false);
public Setting<Float> speed = new Setting<>("Speed", 5f, 1f, 7f);
private final Setting<Boolean> jump = new Setting<>("Jump", false);
private final Setting<Boolean> swing = new Setting<>("Swing", false);
private final Setting<Boolean> alwayssneak = new Setting<>("AlwaysSneak", false);
private float prevYaw;
private final Random random = new Random();

@Override
public void onEnable() {
prevYaw = mc.player.getYaw();
if(alwayssneak.getValue()){mc.options.sneakKey.setPressed(true);}
}

@Override
public void onUpdate(){
if(spin.getValue()){
prevYaw += speed.getValue();
mc.player.setYaw(prevYaw);
}
if(jump.getValue()){
if (mc.options.jumpKey.isPressed()) mc.options.jumpKey.setPressed(false);
else if (random.nextInt(99) == 0) mc.options.jumpKey.setPressed(true);
}
if(swing.getValue()){
if (random.nextInt(99) == 0) mc.player.swingHand(mc.player.getActiveHand());
}
}

@Override
public void onDisable() {
if(alwayssneak.getValue()){mc.options.sneakKey.setPressed(false);}
}
}

0 comments on commit 39520e2

Please sign in to comment.