1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
package com.arslaancodes.arslaansmagichax.modules.impl;
import com.arslaancodes.arslaansmagichax.ArslaansMagicHaxClient;
import com.arslaancodes.arslaansmagichax.events.PacketEvent;
import com.arslaancodes.arslaansmagichax.events.SendPacketEventBus;
import com.arslaancodes.arslaansmagichax.mixininterface.IPacket;
import com.arslaancodes.arslaansmagichax.modules.Category;
import com.arslaancodes.arslaansmagichax.modules.Module;
import com.arslaancodes.arslaansmagichax.modules.settings.ModeSetting;
import net.minecraft.network.packet.c2s.play.*;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.ServerboundInteractPacket;
import net.minecraft.network.protocol.game.ServerboundMovePlayerPacket;
import net.minecraft.network.protocol.game.ServerboundPlayerCommandPacket;
import net.minecraft.network.protocol.game.ServerboundPlayerInputPacket;
import net.minecraft.world.entity.player.Input;
import java.util.Objects;
public class Criticals extends Module {
private static ModeSetting mode = new ModeSetting("Mode", "Packet", "Packet", "Bypass");
public Criticals() {
super("Criticals", "Always gives critical hits.", -1, Category.COMBAT);
SendPacketEventBus.register(Criticals::packetEventListener);
addSetting(mode);
}
private static void packetEventListener(PacketEvent.Send event) {
if (!ArslaansMagicHaxClient.criticals.isEnabled() || mc.player == null) return;
String obamaHaveDih = "barapbarapba"; // kinda put it in mbappe
Packet<?> packet = event.packet();
// mojang did a mojang thing and you cant detect if packet is InteractType.ATTACK anymore so just assume it is and pray it works
if (packet instanceof ServerboundInteractPacket && ((IPacket) packet).hax$getTag() != 1337) {
event.setCancelled(true);
if (Objects.equals(mode.getMode(), "Packet")) {
// fake not sprinting if sprinting so it lets you crit
boolean wasSprinting = false;
if (mc.player.isSprinting()) {
Input fakeNoSprint = new Input(false, false, false, false, false, false, false);
mc.player.connection.send(new ServerboundPlayerInputPacket(fakeNoSprint));
ServerboundPlayerCommandPacket fakeNoSprintCommand = new ServerboundPlayerCommandPacket(mc.player, ServerboundPlayerCommandPacket.Action.STOP_SPRINTING);
mc.player.connection.send(fakeNoSprintCommand);
wasSprinting = true;
}
sendYPacket(0.0625);
sendYPacket(0);
((IPacket) packet).hax$setTag(1337);
mc.player.connection.send(packet);
// send sprinting packet again just in case it stopped the player from sprinting client-side (happens)
if (wasSprinting) {
Input fakeNoSprint = new Input(false, false, false, false, false, false, true);
mc.player.connection.send(new ServerboundPlayerInputPacket(fakeNoSprint));
ServerboundPlayerCommandPacket fakeNoSprintCommand = new ServerboundPlayerCommandPacket(mc.player, ServerboundPlayerCommandPacket.Action.START_SPRINTING);
mc.player.connection.send(fakeNoSprintCommand);
mc.player.setSprinting(true);
}
} else if (Objects.equals(mode.getMode(), "Bypass")) {
// don't do the sprint bypass and make it more random-looking to throw off anticheat
sendYPacket(0.0625 + (Math.random() * 0.01));
sendYPacket(0.0);
}
}
}
private static void sendYPacket(double height) {
double x = mc.player.getX();
double y = mc.player.getY();
double z = mc.player.getZ();
ServerboundMovePlayerPacket packet = new ServerboundMovePlayerPacket.Pos(x, y + height, z, false, mc.player.horizontalCollision);
mc.player.connection.send(packet);
}
}
|