Skip to content

Commit e7667a8

Browse files
committed
AutoFly
1 parent 35daf3c commit e7667a8

File tree

11 files changed

+1582
-31
lines changed

11 files changed

+1582
-31
lines changed

README.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ I'm pleased to note that many of the features and improvements below are complet
8888
- BedrockEscape
8989
- PacketFirewall
9090
- KickForensics
91-
- HideWurst
91+
- HideWurst
9292
- LootRunner
9393
- Redstone, Bed, Sign & Workstation ESP
9494
- PearlESP (Not a simple trajectory hack)
@@ -676,14 +676,23 @@ This hack is still undergoing development and has only been tested in the end. A
676676
- Disabled by default; enable in ClickGUI > Other > Packet Firewall.
677677
- Great for understanding and potentially evading some anti-cheats.
678678

679-
### HideWurst
680-
681-
- Disables all Wurst rendering (ESP, HackList, HUD, overlays, glow outlines) while keeping hacks enabled.
682-
- Can hide Wurst's UI mixins (menus, containers, overlays) without disabling the hacks.
683-
- Can hide Wurst from ModMenu's mod list.
684-
- Use HideModMenu to hide additional mods by keyword (comma-separated list).
685-
- Useful for recording/streaming or just hiding visuals without turning off your active hacks.
679+
### HideWurst
686680

681+
- Disables all Wurst rendering (ESP, HackList, HUD, overlays, glow outlines) while keeping hacks enabled.
682+
- Can hide Wurst's UI mixins (menus, containers, overlays) without disabling the hacks.
683+
- Can hide Wurst from ModMenu's mod list.
684+
- Use HideModMenu to hide additional mods by keyword (comma-separated list).
685+
- Useful for recording/streaming or just hiding visuals without turning off your active hacks.
686+
687+
### AutoFly
688+
689+
- AutoFly follows SeedMapper exports or manually entered coordinates, automatically tuning Flight height/speed and showing a crosshair status.
690+
- Able to adjust mid flight so you can get yourself unstuck if it failed to do it itself.
691+
- Auto lands and turns off flight when complete.
692+
- Comes with custom commands:
693+
- `.autofly <x> <y> <z> [height] [speed]` or `.autofly <x> <z> [height] [speed]` to AutoFly to a given waypoint (relative `~` values are supported as well as comma separated entries).
694+
- `.autofly next`/`.autofly prev(ious)` cycles the SeedMapper export list, while `.autofly stop|off|disable` turns off AutoFly.
695+
687696
## What's changed or improved in this fork?
688697

689698
### ChestESP

src/main/java/net/wurstclient/command/CmdList.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public final class CmdList
1919
public final AddAltCmd addAltCmd = new AddAltCmd();
2020
public final AnnoyCmd annoyCmd = new AnnoyCmd();
2121
public final AuthorCmd authorCmd = new AuthorCmd();
22+
public final AutoFlyCmd autoFlyCmd = new AutoFlyCmd();
2223
public final BindCmd bindCmd = new BindCmd();
2324
public final BindsCmd bindsCmd = new BindsCmd();
2425
public final BlinkCmd blinkCmd = new BlinkCmd();
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
/*
2+
* Copyright (c) 2014-2026 Wurst-Imperium and contributors.
3+
*
4+
* This source code is subject to the terms of the GNU General Public
5+
* License, version 3. If a copy of the GPL was not distributed with this
6+
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
7+
*/
8+
package net.wurstclient.commands;
9+
10+
import net.minecraft.core.BlockPos;
11+
import net.wurstclient.command.CmdError;
12+
import net.wurstclient.command.CmdError;
13+
import net.wurstclient.command.CmdException;
14+
import net.wurstclient.command.CmdSyntaxError;
15+
import net.wurstclient.command.Command;
16+
import net.wurstclient.util.MathUtils;
17+
18+
public final class AutoFlyCmd extends Command
19+
{
20+
public AutoFlyCmd()
21+
{
22+
super("autofly", "Fly to a waypoint using AutoFly.",
23+
".autofly <x> <y> <z> [height] [speed]",
24+
".autofly <x> <z> [height] [speed]");
25+
}
26+
27+
@Override
28+
public void call(String[] args) throws CmdException
29+
{
30+
if(MC.player == null)
31+
throw new CmdError("Join a world before using .autofly.");
32+
String[] normalized = normalizeArgs(args);
33+
if(normalized.length == 1)
34+
{
35+
String cmd = normalized[0];
36+
if(cmd.equalsIgnoreCase("next"))
37+
{
38+
ensureAutoFlyEnabled();
39+
WURST.getHax().autoFlyHack.cycleNextWaypoint();
40+
return;
41+
}
42+
43+
if(cmd.equalsIgnoreCase("previous") || cmd.equalsIgnoreCase("prev"))
44+
{
45+
ensureAutoFlyEnabled();
46+
WURST.getHax().autoFlyHack.cyclePreviousWaypoint();
47+
return;
48+
}
49+
50+
if(cmd.equalsIgnoreCase("stop") || cmd.equalsIgnoreCase("off")
51+
|| cmd.equalsIgnoreCase("disable"))
52+
{
53+
if(WURST.getHax().autoFlyHack.isEnabled())
54+
WURST.getHax().autoFlyHack.setEnabled(false);
55+
return;
56+
}
57+
}
58+
59+
if(normalized.length < 2)
60+
throw new CmdSyntaxError("Invalid coordinates.");
61+
62+
boolean hasY = normalized.length == 3 || normalized.length == 4
63+
|| normalized.length == 5;
64+
int idxHeight = hasY ? 3 : 2;
65+
66+
if(normalized.length > idxHeight + 2)
67+
throw new CmdSyntaxError("Too many arguments.");
68+
69+
BlockPos pos = hasY ? parseXyz(normalized) : parseXz(normalized);
70+
71+
Double height = null;
72+
Double speed = null;
73+
if(normalized.length > idxHeight)
74+
height = parseDouble(normalized[idxHeight], "height");
75+
if(normalized.length > idxHeight + 1)
76+
speed = parseDouble(normalized[idxHeight + 1], "speed");
77+
78+
WURST.getHax().autoFlyHack.setTargetFromCommand(pos, hasY, height,
79+
speed);
80+
}
81+
82+
private BlockPos parseXyz(String[] args) throws CmdSyntaxError
83+
{
84+
int x = parseCoord(args[0], MC.player.blockPosition().getX());
85+
int y = parseCoord(args[1], MC.player.blockPosition().getY());
86+
int z = parseCoord(args[2], MC.player.blockPosition().getZ());
87+
return new BlockPos(x, y, z);
88+
}
89+
90+
private BlockPos parseXz(String[] args) throws CmdSyntaxError
91+
{
92+
int x = parseCoord(args[0], MC.player.blockPosition().getX());
93+
int z = parseCoord(args[1], MC.player.blockPosition().getZ());
94+
int y = MC.player.blockPosition().getY();
95+
return new BlockPos(x, y, z);
96+
}
97+
98+
private int parseCoord(String raw, int base) throws CmdSyntaxError
99+
{
100+
if(MathUtils.isInteger(raw))
101+
return Integer.parseInt(raw);
102+
if(raw.equals("~"))
103+
return base;
104+
if(raw.startsWith("~") && MathUtils.isInteger(raw.substring(1)))
105+
return base + Integer.parseInt(raw.substring(1));
106+
throw new CmdSyntaxError("Invalid coordinates.");
107+
}
108+
109+
private Double parseDouble(String raw, String label) throws CmdSyntaxError
110+
{
111+
if(!MathUtils.isDouble(raw))
112+
throw new CmdSyntaxError("Invalid " + label + ".");
113+
return Double.parseDouble(raw);
114+
}
115+
116+
private String[] normalizeArgs(String[] args)
117+
{
118+
if(args == null || args.length == 0)
119+
return new String[0];
120+
java.util.List<String> out = new java.util.ArrayList<>();
121+
for(String arg : args)
122+
{
123+
if(arg == null)
124+
continue;
125+
String[] parts = arg.split(",");
126+
for(String p : parts)
127+
{
128+
String trimmed = p.trim();
129+
if(!trimmed.isEmpty())
130+
out.add(trimmed);
131+
}
132+
}
133+
return out.toArray(new String[0]);
134+
}
135+
136+
private void ensureAutoFlyEnabled() throws CmdError
137+
{
138+
if(!WURST.getHax().autoFlyHack.isEnabled())
139+
throw new CmdError("AutoFly must be enabled to cycle waypoints.");
140+
}
141+
}

src/main/java/net/wurstclient/hack/HackList.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public final class HackList implements UpdateListener
6262
public final AutoEatHack autoEatHack = new AutoEatHack();
6363
public final AutoFarmHack autoFarmHack = new AutoFarmHack();
6464
public final AutoFishHack autoFishHack = new AutoFishHack();
65+
public final AutoFlyHack autoFlyHack = new AutoFlyHack();
6566
public final AutoMaceHack autoMaceHack = new AutoMaceHack();
6667
public final AutoMineHack autoMineHack = new AutoMineHack();
6768
public final AutoPotionHack autoPotionHack = new AutoPotionHack();

0 commit comments

Comments
 (0)