AntiPush module

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

1 implementationMOVEMENT

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.

OfflineClientMOVEMENTsrc/main/java/com/jellypudding/offlineclient/modules/movement/AntiPush.javaJava · 95 lines · 4.0 KB

Stops water and entities from pushing you around.

SettingsEntitiesEntity pushWater currentsCurrent horizontalCurrent verticalBubble columnsGeysersSinking
AntiPush.javaJava · Minecraft 26.2 · 95 lines · 4.0 KB · complete file, verbatimOriginal ↗
1
package com.jellypudding.offlineclient.modules.movement;
2
3
import com.jellypudding.offlineclient.event.Subscribe;
4
import com.jellypudding.offlineclient.event.events.PostMotionEvent;
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.world.phys.Vec3;
10
11
// Entities and currents live in EntityMixin and LocalPlayerMixin.
12
// Geysers live in PotentSulfurBlockEntityMixin.
13
public final class AntiPush extends Module {
14
15
    private final BoolSetting entities = new BoolSetting("Entities",
16
        "Players and mobs cannot shove you whilst you still push them.", true);
17
    private final NumberSetting entityPush = new NumberSetting("Entity push",
18
        "How much of a shove you still take.", 0, 0, 100, 1, "%")
19
        .under(entities);
20
    private final BoolSetting currents = new BoolSetting("Water currents",
21
        "Flowing water and lava cannot drag you.", true);
22
    private final NumberSetting currentHorizontal = new NumberSetting("Current horizontal",
23
        "How much sideways drag you still take from a current.", 0, 0, 100, 1, "%")
24
        .under(currents);
25
    private final NumberSetting currentVertical = new NumberSetting("Current vertical",
26
        "How much upward or downward drag you still take from a current.", 0, 0, 100, 1, "%")
27
        .under(currents);
28
    private final BoolSetting bubbleColumns = new BoolSetting("Bubble columns",
29
        "Bubble columns cannot lift you or pull you down.", true);
30
    private final BoolSetting geysers = new BoolSetting("Geysers",
31
        "Sulfur geysers cannot launch you into the air.", true);
32
    private final BoolSetting sinking = new BoolSetting("Sinking",
33
        "Float in place in water or lava unless you hold jump or sneak.", false);
34
35
    public AntiPush() {
36
        super("AntiPush", "Stops water and entities from pushing you around.", Category.MOVEMENT);
37
        addSettings(entities, entityPush, currents, currentHorizontal, currentVertical,
38
            bubbleColumns, geysers, sinking);
39
        searchTags("anti water push", "anti entity push", "bubble", "collision", "shove", "sulfur",
40
            "velocity", "float");
41
    }
42
43
    // True when no shove at all should land. The cheap path that skips the push outright.
44
    public boolean blocksEntities() {
45
        return isEnabled() && entities.isOn() && entityPush.getValue() <= 0;
46
    }
47
48
    // The share of a shove from another entity that still lands.
49
    public double entityPushScale() {
50
        return isEnabled() && entities.isOn() ? entityPush.getValue() / 100.0 : 1;
51
    }
52
53
    // True when no current at all should pull. The cheap path that skips the flow maths.
54
    public boolean blocksCurrents() {
55
        return isEnabled() && currents.isOn()
56
            && currentHorizontal.getValue() <= 0 && currentVertical.getValue() <= 0;
57
    }
58
59
    // The flow of a current with the kept share of each axis.
60
    public Vec3 scaleCurrent(Vec3 flow) {
61
        if (!isEnabled() || !currents.isOn()) {
62
            return flow;
63
        }
64
        double h = currentHorizontal.getValue() / 100.0;
65
        double v = currentVertical.getValue() / 100.0;
66
        return flow.multiply(h, v, h);
67
    }
68
69
    public boolean blocksBubbleColumns() {
70
        return isEnabled() && bubbleColumns.isOn();
71
    }
72
73
    public boolean blocksGeysers() {
74
        return isEnabled() && geysers.isOn();
75
    }
76
77
    // Fluid gravity lands after the move each tick. Clearing it here leaves no sink at all.
78
    @Subscribe
79
    private void onPostMotion(PostMotionEvent event) {
80
        if (!inGame() || !sinking.isOn()) {
81
            return;
82
        }
83
        if (mc.options.keyJump.isDown() || mc.options.keyShift.isDown()) {
84
            return;
85
        }
86
        if (!mc.player.isInWater() && !mc.player.isInLava()) {
87
            return;
88
        }
89
        Vec3 delta = mc.player.getDeltaMovement();
90
        if (delta.y < 0) {
91
            mc.player.setDeltaMovement(delta.x, 0, delta.z);
92
        }
93
    }
94
}
95