MaceKill module

MaceKill: Minecraft 26.3 cheat module, full source for every implementation (2 clients: Combatant, LiquidBounce (Kotlin)).

2 implementationsCOMBAT

Full module source: 2 implementations

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

CombatantCOMBATsrc/main/java/combatant/client/features/module/modules/combat/MaceKill.javaJava · 139 lines · 4.8 KB
Settingsheight
MaceKill.javaJava · Minecraft 26.2 · 139 lines · 4.8 KB · complete file, verbatimOriginal ↗
1
/*
2
 * This file is part of the Combatant Client distribution.
3
 * Combatant modifications copyright (c) 2026 pivosos2007.
4
 *
5
 * Portions of this file are based on LiquidBounce
6
 * (https://github.com/CCBlueX/LiquidBounce).
7
 * Copyright (c) 2015-2026 CCBlueX.
8
 *
9
 * LiquidBounce portions are licensed under GPLv3-or-later.
10
 * Combatant modifications are licensed under GPLv3.
11
 * See THIRD_PARTY_NOTICES.md for details.
12
 */
13
14
package combatant.client.features.module.modules.combat;
15
16
import net.minecraft.client.Minecraft;
17
import net.minecraft.network.protocol.game.ServerboundInteractPacket;
18
import net.minecraft.network.protocol.game.ServerboundMovePlayerPacket;
19
import net.minecraft.world.entity.Entity;
20
import net.minecraft.world.item.ItemStack;
21
import net.minecraft.world.item.Items;
22
import net.minecraft.world.phys.AABB;
23
import net.minecraft.world.phys.shapes.VoxelShape;
24
import combatant.client.config.values.NumberValue;
25
import combatant.client.events.EventHandler;
26
import combatant.client.events.impl.PacketEvent;
27
import combatant.client.features.module.Module;
28
import combatant.client.features.module.ModuleCategory;
29
import combatant.client.features.module.ModuleInfo;
30
31
//Такая хуйня на более менее ач работать не будет
32
// thx liquidbounce
33
//todo Description
34
@ModuleInfo(
35
        id = "macekill",
36
        displayName = "MaceKill",
37
        category = ModuleCategory.COMBAT
38
)
39
public final class MaceKill extends Module {
40
    public static boolean cancelCrit;
41
42
    private final Minecraft mc = Minecraft.getInstance();
43
    private final NumberValue<Integer> fallHeight =
44
            num("height", 22, 1, 170);
45
46
    @EventHandler
47
    public void onPacketSend(PacketEvent.Send event) {
48
        if (!isEnabled()) return;
49
        if (!(event.getPacket() instanceof ServerboundInteractPacket packet)) return;
50
        if (!isAttack(packet)) return;
51
52
        Entity ent = getEntity(packet);
53
        if (ent == null || cancelCrit) return;
54
55
        if (!isHoldingMace()) return;
56
57
        doCrit();
58
    }
59
60
    private void doCrit() {
61
        if (mc == null || mc.player == null || mc.level == null) return;
62
        int height = determineHeight();
63
        if (height <= 0) return;
64
65
        // Paper/Spigot exploit: send multiple groundless packets for large heights
66
        if (height > 10) {
67
            int repeats = (int) Math.ceil(Math.abs(height / 10.0));
68
            for (int i = 0; i < repeats; i++) {
69
                sendOnGroundOnly(false);
70
            }
71
        } else {
72
            // Do it at least twice to neutralize horizontal distance
73
            boolean onGround = mc.player.onGround();
74
            sendOnGroundOnly(onGround);
75
            sendOnGroundOnly(onGround);
76
        }
77
78
        // Teleport to the calculated height
79
        sendPosition(mc.player.getX(), mc.player.getY() + height, mc.player.getZ(), false);
80
        // Ensure the player returns to ground state.
81
        sendPosition(mc.player.getX(), mc.player.getY(), mc.player.getZ(), false);
82
    }
83
84
    private void sendOnGroundOnly(boolean onGround) {
85
        if (mc == null || mc.player == null || mc.getConnection() == null) return;
86
        mc.getConnection().send(
87
                new ServerboundMovePlayerPacket.StatusOnly(onGround, mc.player.horizontalCollision)
88
        );
89
    }
90
91
    private void sendPosition(double x, double y, double z, boolean onGround) {
92
        if (mc == null || mc.player == null || mc.getConnection() == null) return;
93
        mc.getConnection().send(
94
                new ServerboundMovePlayerPacket.Pos(
95
                        x, y, z, onGround, mc.player.horizontalCollision
96
                )
97
        );
98
    }
99
100
    private int determineHeight() {
101
        if (mc == null || mc.player == null || mc.level == null) return 0;
102
103
        AABB bb = mc.player.getBoundingBox();
104
        int max = fallHeight.get();
105
        for (int i = max; i >= 1; i--) {
106
            AABB shifted = bb.move(0.0, i, 0.0);
107
            if (isBoxClear(shifted)) {
108
                return i;
109
            }
110
        }
111
        return 0;
112
    }
113
114
    private boolean isBoxClear(AABB box) {
115
        if (mc == null || mc.player == null || mc.level == null) return false;
116
        for (VoxelShape shape : mc.level.getBlockCollisions(mc.player, box)) {
117
            if (!shape.isEmpty()) return false;
118
        }
119
        return true;
120
    }
121
122
    private boolean isHoldingMace() {
123
        if (mc == null || mc.player == null) return false;
124
        ItemStack mainHand = mc.player.getMainHandItem();
125
        return mainHand != null && mainHand.getItem() == Items.MACE;
126
    }
127
128
    private Entity getEntity(ServerboundInteractPacket packet) {
129
        if (mc == null || mc.level == null) return null;
130
        int id = packet.entityId();
131
        return mc.level.getEntity(id);
132
    }
133
134
    private boolean isAttack(ServerboundInteractPacket packet) {
135
        return packet.hand() == null && packet.location() == null;
136
    }
137
138
}
139
LiquidBounce (Kotlin)COMBATsrc/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/combat/ModuleMaceKill.ktKotlin · 89 lines · 3.2 KB

Instant kill when using the Mace

SettingsFallHeight
ModuleMaceKill.ktKotlin · Minecraft 26.2 · 89 lines · 3.2 KB · complete file, verbatimOriginal ↗
1
/*
2
 * This file is part of LiquidBounce (https://github.com/CCBlueX/LiquidBounce)
3
 *
4
 * Copyright (c) 2015 - 2026 CCBlueX
5
 *
6
 * LiquidBounce is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation, either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * LiquidBounce is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with LiquidBounce. If not, see <https://www.gnu.org/licenses/>.
18
 */
19
package net.ccbluex.liquidbounce.features.module.modules.combat
20
21
import net.ccbluex.liquidbounce.event.events.AttackEntityEvent
22
import net.ccbluex.liquidbounce.event.handler
23
import net.ccbluex.liquidbounce.features.module.ClientModule
24
import net.ccbluex.liquidbounce.features.module.ModuleCategories
25
import net.ccbluex.liquidbounce.utils.entity.warp
26
import net.ccbluex.liquidbounce.utils.math.allEmpty
27
import net.minecraft.world.item.Items
28
import kotlin.math.abs
29
import kotlin.math.ceil
30
31
/**
32
 * Makes the mace powerful by faking fall height.
33
 */
34
object ModuleMaceKill : ClientModule("MaceKill", ModuleCategories.COMBAT) {
35
36
    private val fallHeight by int("FallHeight", 22, 1..170).apply { tagBy(this) }
37
38
    @Suppress("unused")
39
    private val attackHandler = handler<AttackEntityEvent> { event ->
40
        // Check if player is holding a mace
41
        val mainHandStack = player.mainHandItem
42
43
        if (mainHandStack.item != Items.MACE) return@handler
44
45
        val height = determineHeight()
46
47
        // Use Paper/Spigot teleport exploit if height is greater than 10
48
        if (height > 10) {
49
            repeat(ceil(abs(height / 10.0)).toInt()) {
50
                player.warp(null, onGround = false)
51
            }
52
        } else {
53
            // Do it at least twice to neutralize horizontal distance
54
            repeat(2) { player.warp(null, onGround = player.onGround()) }
55
        }
56
57
        // Teleport to the calculated height
58
        player.warp(player.position().add(0.0, height.toDouble(), 0.0), onGround = false)
59
60
        // Make sure we get back to the ground
61
        player.warp(player.position(), onGround = false)
62
    }
63
64
    /**
65
     * In this case we can easily determine the height
66
     * by checking if the player would collide with a block
67
     * from the highest possible fall height to 1.
68
     *
69
     * We do not have to check in-between heights, because
70
     * we immediately teleport through the block and
71
     * Minecraft has no collision check for that.
72
     */
73
    private fun determineHeight(): Int {
74
        val boundingBox = player.boundingBox
75
        for (i in fallHeight downTo 1) {
76
            // Offset bounding box by i blocks
77
            val newBoundingBox = boundingBox.move(0.0, i.toDouble(), 0.0)
78
79
            // Check if the player would collide with a block
80
            if (world.getBlockCollisions(player, newBoundingBox).allEmpty()) {
81
                return i
82
            }
83
        }
84
85
        return 0
86
    }
87
88
}
89