MoreKnockback module

MoreKnockback: Minecraft 26.3 cheat module, full source for every implementation (1 client: MelaHack (ThunderHack fork)).

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.

MelaHack (ThunderHack fork)COMBATsrc/main/java/thunder/hack/features/modules/combat/MoreKnockback.javaJava · 76 lines · 3.5 KB

Makes you deal more knockback.

SettingsInMoveHurtTimeChance
MoreKnockback.javaJava · Minecraft 26.2 · 76 lines · 3.5 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.features.modules.combat;
2
3
import meteordevelopment.orbit.EventHandler;
4
import net.minecraft.core.BlockPos;
5
import net.minecraft.network.protocol.game.ServerboundInteractPacket;
6
import net.minecraft.network.protocol.game.ServerboundPlayerCommandPacket;
7
import net.minecraft.world.effect.MobEffects;
8
import net.minecraft.world.entity.LivingEntity;
9
import net.minecraft.world.entity.boss.enderdragon.EndCrystal;
10
import net.minecraft.world.level.block.Blocks;
11
import thunder.hack.core.manager.client.ModuleManager;
12
import thunder.hack.events.impl.PacketEvent;
13
import thunder.hack.features.modules.Module;
14
import thunder.hack.setting.Setting;
15
import thunder.hack.utility.math.MathUtility;
16
import thunder.hack.utility.player.MovementUtility;
17
18
import static thunder.hack.features.modules.combat.Criticals.getEntity;
19
import static thunder.hack.features.modules.combat.Criticals.getInteractType;
20
21
public class MoreKnockback extends Module {
22
    public MoreKnockback() {
23
        super("MoreKnockback", Category.COMBAT);
24
    }
25
26
    public Setting<Boolean> inMove = new Setting<>("InMove", true);
27
    public Setting<Integer> hurtTime = new Setting<>("HurtTime", 10, 0, 10);
28
    public Setting<Integer> chance = new Setting<>("Chance", 100, 0, 100);
29
30
    @EventHandler
31
    public void onSendPacket(PacketEvent.Send event) {
32
        if ((!MovementUtility.isMoving() || inMove.getValue())
33
                && event.getPacket() instanceof ServerboundInteractPacket
34
                && getInteractType(event.getPacket()) == Criticals.InteractType.ATTACK
35
                && !(getEntity(event.getPacket()) instanceof EndCrystal)
36
                && getEntity(event.getPacket()) instanceof LivingEntity lent
37
                && lent.hurtTime <= hurtTime.getValue()
38
                && MathUtility.random(0, 100) >= (100 - chance.getValue())
39
                && !canCrit()) {
40
41
            if (mc.player.isSprinting()) sendPacket(new ServerboundPlayerCommandPacket(mc.player, ServerboundPlayerCommandPacket.Action.STOP_SPRINTING));
42
            sendPacket(new ServerboundPlayerCommandPacket(mc.player, ServerboundPlayerCommandPacket.Action.START_SPRINTING));
43
            sendPacket(new ServerboundPlayerCommandPacket(mc.player, ServerboundPlayerCommandPacket.Action.STOP_SPRINTING));
44
            sendPacket(new ServerboundPlayerCommandPacket(mc.player, ServerboundPlayerCommandPacket.Action.START_SPRINTING));
45
            debug("wtap");
46
            mc.player.setSprinting(true);
47
            mc.player.wasSprinting = true;
48
        }
49
    }
50
51
    private boolean canCrit() {
52
        boolean reasonForSkipCrit =
53
                        mc.player.getAbilities().flying
54
                        || (mc.player.isFallFlying()
55
                        || ModuleManager.elytraPlus.isEnabled())
56
                        || mc.player.hasEffect(MobEffects.BLINDNESS)
57
                        || mc.level.getBlockState(BlockPos.containing(mc.player.position())).getBlock() == Blocks.COBWEB
58
                        || mc.player.isInLava()
59
                        || mc.player.isUnderWater();
60
61
        if (mc.player.getAttackStrengthScale(0.5f) < 0.9f)
62
            return false;
63
64
        if (ModuleManager.criticals.isEnabled() && !ModuleManager.criticals.mode.is(Criticals.Mode.Grim))
65
            return true;
66
67
        if (ModuleManager.criticals.isEnabled() && ModuleManager.criticals.mode.is(Criticals.Mode.Grim) && !mc.player.onGround())
68
            return true;
69
70
        if (!reasonForSkipCrit)
71
            return !mc.player.onGround() && mc.player.fallDistance > 0f;
72
73
        return false;
74
    }
75
}
76