ArrowDamage module

ArrowDamage: Minecraft 26.3 cheat module, full source for every implementation (1 client: OfflineClient).

1 implementationCOMBAT

Clients with this module

Full module source: 1 implementation

Every implementation below is the complete module file, verbatim. Expand a client to read its code.

OfflineClientCOMBATsrc/main/java/com/jellypudding/offlineclient/modules/combat/ArrowDamage.javaJava · 69 lines · 3.1 KB

Makes your arrows fly faster and hit harder.

SettingsStrengthTridents
ArrowDamage.javaJava · Minecraft 26.2 · 69 lines · 3.1 KB · complete file, verbatimOriginal ↗
1
package com.jellypudding.offlineclient.modules.combat;
2
3
import com.jellypudding.offlineclient.event.Subscribe;
4
import com.jellypudding.offlineclient.event.events.PacketSendEvent;
5
import com.jellypudding.offlineclient.module.Category;
6
import com.jellypudding.offlineclient.module.Module;
7
import com.jellypudding.offlineclient.setting.BoolSetting;
8
import com.jellypudding.offlineclient.setting.NumberSetting;
9
import net.minecraft.client.multiplayer.ClientPacketListener;
10
import net.minecraft.network.protocol.game.ServerboundMovePlayerPacket;
11
import net.minecraft.network.protocol.game.ServerboundPlayerActionPacket;
12
import net.minecraft.network.protocol.game.ServerboundPlayerCommandPacket;
13
import net.minecraft.world.item.ItemStack;
14
import net.minecraft.world.item.Items;
15
import net.minecraft.world.phys.Vec3;
16
17
// A burst of position packets just before the arrow leaves. The server hands
18
// the arrow the speed it thinks you moved at. Patched on some servers.
19
public final class ArrowDamage extends Module {
20
21
    // The furthest the server lets one packet move you. Strength ten is the full jump.
22
    private static final double FULL_STEP = Math.sqrt(500);
23
    private static final int WARM_UP_PACKETS = 4;
24
25
    private final NumberSetting strength = new NumberSetting("Strength",
26
        "How hard the arrow is pushed. Ten is the most a server accepts.", 10, 0.1, 10, 0.1)
27
        .min(0.1).max(10);
28
    private final BoolSetting tridents = new BoolSetting("Tridents",
29
        "Also boosts a thrown trident. One that flies too far is easily lost.", false);
30
31
    public ArrowDamage() {
32
        super("ArrowDamage", "Makes your arrows fly faster and hit harder.", Category.COMBAT);
33
        addSettings(strength, tridents);
34
        searchTags("arrow dmg", "bow damage", "arrow speed");
35
    }
36
37
    private boolean boosts(ItemStack stack) {
38
        return stack.is(Items.BOW) || (tridents.isOn() && stack.is(Items.TRIDENT));
39
    }
40
41
    // The release packet is what fires the arrow. The burst goes out in front of it.
42
    @Subscribe
43
    private void onPacketSend(PacketSendEvent event) {
44
        if (mc.player == null
45
            || !(event.getPacket() instanceof ServerboundPlayerActionPacket packet)
46
            || packet.getAction() != ServerboundPlayerActionPacket.Action.RELEASE_USE_ITEM
47
            || !boosts(mc.player.getMainHandItem())) {
48
            return;
49
        }
50
        ClientPacketListener connection = mc.player.connection;
51
        connection.send(new ServerboundPlayerCommandPacket(mc.player,
52
            ServerboundPlayerCommandPacket.Action.START_SPRINTING));
53
        double x = mc.player.getX();
54
        double y = mc.player.getY();
55
        double z = mc.player.getZ();
56
        Vec3 push = mc.player.getViewVector(1).scale(strength.getValue() / 10 * FULL_STEP);
57
        for (int i = 0; i < WARM_UP_PACKETS; i++) {
58
            sendPosition(x, y, z, true);
59
        }
60
        sendPosition(x - push.x, y, z - push.z, true);
61
        sendPosition(x, y, z, false);
62
    }
63
64
    private void sendPosition(double x, double y, double z, boolean onGround) {
65
        mc.player.connection.send(new ServerboundMovePlayerPacket.Pos(x, y, z, onGround,
66
            mc.player.horizontalCollision));
67
    }
68
}
69