Skip to content

Commit f541170

Browse files
committed
Added SafeTP Hack
1 parent 13735a6 commit f541170

File tree

4 files changed

+160
-0
lines changed

4 files changed

+160
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ I have no other experience in the field of Minecraft and have never used any oth
189189

190190
![Chest](https://i.imgur.com/6u9S2OD.png)
191191

192+
### SafeTP
193+
- Combines Blink, your desired teleport command and a timer into a single function
194+
- Allows you to teleport without worrying about the movement restrictions during the countdown
195+
192196
## What’s changed or improved in this fork?
193197

194198
### ItemESP (Expanded)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ public final class HackList implements UpdateListener
174174
public final ReachHack reachHack = new ReachHack();
175175
public final RemoteViewHack remoteViewHack = new RemoteViewHack();
176176
public final RestockHack restockHack = new RestockHack();
177+
public final SafeTpHack safeTpHack = new SafeTpHack();
177178
public final SafeWalkHack safeWalkHack = new SafeWalkHack();
178179
public final ScaffoldWalkHack scaffoldWalkHack = new ScaffoldWalkHack();
179180
public final SearchHack searchHack = new SearchHack();
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
/*
2+
* Copyright (c) 2014-2025 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.hacks;
9+
10+
import net.minecraft.client.network.ClientPlayNetworkHandler;
11+
import net.wurstclient.Category;
12+
import net.wurstclient.SearchTags;
13+
import net.wurstclient.events.UpdateListener;
14+
import net.wurstclient.hack.Hack;
15+
import net.wurstclient.settings.SliderSetting;
16+
import net.wurstclient.settings.SliderSetting.ValueDisplay;
17+
import net.wurstclient.settings.TextFieldSetting;
18+
import net.wurstclient.util.ChatUtils;
19+
20+
@SearchTags({"safe tp", "safe teleport"})
21+
public final class SafeTpHack extends Hack implements UpdateListener
22+
{
23+
private final TextFieldSetting command = new TextFieldSetting("Command",
24+
"description.wurst.setting.safetp.command", "/t spawn",
25+
value -> value != null && !value.trim().isEmpty());
26+
private final SliderSetting waitTime = new SliderSetting("Wait time",
27+
"description.wurst.setting.safetp.wait_time", 5.5, 1, 15, 0.25,
28+
ValueDisplay.DECIMAL.withSuffix("s"));
29+
30+
private int ticksRemaining;
31+
private boolean weActivatedBlink;
32+
33+
public SafeTpHack()
34+
{
35+
super("SafeTP");
36+
setCategory(Category.OTHER);
37+
addSetting(command);
38+
addSetting(waitTime);
39+
}
40+
41+
@Override
42+
public String getRenderName()
43+
{
44+
if(isEnabled())
45+
{
46+
int secondsLeft =
47+
Math.max((int)Math.ceil(ticksRemaining / 20.0), 0);
48+
return getName() + " [" + secondsLeft + "s]";
49+
}
50+
51+
return super.getRenderName();
52+
}
53+
54+
@Override
55+
protected void onEnable()
56+
{
57+
if(MC.player == null)
58+
{
59+
setEnabled(false);
60+
return;
61+
}
62+
63+
ClientPlayNetworkHandler netHandler = MC.getNetworkHandler();
64+
if(netHandler == null)
65+
{
66+
setEnabled(false);
67+
return;
68+
}
69+
70+
String value = command.getValue().trim();
71+
if(value.isEmpty())
72+
{
73+
ChatUtils.error("SafeTP command cannot be empty.");
74+
setEnabled(false);
75+
return;
76+
}
77+
78+
BlinkHack blinkHack = WURST.getHax().blinkHack;
79+
boolean blinkAlreadyEnabled = blinkHack.isEnabled();
80+
weActivatedBlink = false;
81+
82+
if(!blinkAlreadyEnabled)
83+
{
84+
blinkHack.setEnabled(true);
85+
if(!blinkHack.isEnabled())
86+
{
87+
ChatUtils.error("SafeTP could not enable Blink.");
88+
setEnabled(false);
89+
return;
90+
}
91+
92+
weActivatedBlink = true;
93+
}
94+
95+
ticksRemaining = Math.max((int)Math.ceil(waitTime.getValue() * 20), 1);
96+
97+
String commandToSend =
98+
value.startsWith("/") ? value.substring(1) : value;
99+
commandToSend = commandToSend.trim();
100+
if(commandToSend.isEmpty())
101+
{
102+
ChatUtils.error("SafeTP command cannot be empty.");
103+
setEnabled(false);
104+
return;
105+
}
106+
107+
netHandler.sendChatCommand(commandToSend);
108+
109+
EVENTS.add(UpdateListener.class, this);
110+
}
111+
112+
@Override
113+
protected void onDisable()
114+
{
115+
EVENTS.remove(UpdateListener.class, this);
116+
ticksRemaining = 0;
117+
118+
BlinkHack blinkHack = WURST.getHax().blinkHack;
119+
if(weActivatedBlink && blinkHack.isEnabled())
120+
blinkHack.cancel();
121+
122+
weActivatedBlink = false;
123+
}
124+
125+
@Override
126+
public void onUpdate()
127+
{
128+
if(MC.player == null || MC.getNetworkHandler() == null)
129+
{
130+
setEnabled(false);
131+
return;
132+
}
133+
134+
BlinkHack blinkHack = WURST.getHax().blinkHack;
135+
if(!blinkHack.isEnabled())
136+
{
137+
setEnabled(false);
138+
return;
139+
}
140+
141+
if(ticksRemaining <= 0)
142+
{
143+
setEnabled(false);
144+
return;
145+
}
146+
147+
ticksRemaining--;
148+
149+
if(ticksRemaining <= 0)
150+
setEnabled(false);
151+
}
152+
}

src/main/resources/assets/wurst/translations/en_us.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@
155155
"description.wurst.hack.redstoneesp": "Highlights nearby redstone blocks",
156156
"description.wurst.hack.remoteview": "Allows you to see the world as someone else.\nUse the .rv command to make it target a specific entity.",
157157
"description.wurst.hack.restock": "Automatically restocks your hand with the selected items from your inventory. Works better with FastPlace.",
158+
"description.wurst.hack.safetp": "Activates Blink for five seconds and sends your teleport command move and attack while the teleport countdown is running",
158159
"description.wurst.hack.safewalk": "Prevents you from falling off edges.",
159160
"description.wurst.hack.scaffoldwalk": "Automatically places blocks below your feet.",
160161
"description.wurst.hack.search": "Helps you to find specific blocks by highlighting them in rainbow or fixed color. Use the Query input to search for partial keywords or create your own list of blocks to highlight.",
@@ -308,6 +309,8 @@
308309
"description.wurst.setting.remoteview.filter_villagers": "Won't view villagers and wandering traders.",
309310
"description.wurst.setting.remoteview.filter_zombie_piglins": "Won't view zombified piglins.",
310311
"description.wurst.setting.remoteview.filter_zombie_villagers": "Won't view zombified villagers.",
312+
"description.wurst.setting.safetp.command": "Command that SafeTP should send when it starts. A leading slash is optional.",
313+
"description.wurst.setting.safetp.wait_time": "How long Blink should stay active after sending the teleport command.",
311314
"description.wurst.setting.treebot.swing_hand": "How TreeBot should swing your hand when breaking logs and leaves.",
312315
"description.wurst.setting.triggerbot.swing_hand": "How TriggerBot should swing your hand when attacking. (This setting will be ignored if \"Simulate mouse click\" is enabled.)",
313316
"gui.wurst.altmanager.empty.message": "Would you like some random alts to get started?",

0 commit comments

Comments
 (0)