Pitch40 module

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

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.

NicotineMovementsrc/client/java/nicotine/mod/mods/movement/Pitch40.javaJava · 113 lines · 3.4 KB

If you start from a high enough position\nIt let's you efly forever without fireworks

SettingsYawLockThirdPerson
Pitch40.javaJava · Minecraft 26.3 · 113 lines · 3.4 KB · complete file, verbatimOriginal ↗
1
package nicotine.mod.mods.movement;
2
3
import com.mojang.blaze3d.platform.InputConstants;
4
import net.minecraft.client.CameraType;
5
import nicotine.events.ClientLevelTickEvent;
6
import nicotine.mod.Mod;
7
import nicotine.mod.ModCategory;
8
import nicotine.mod.option.KeybindOption;
9
import nicotine.mod.option.ToggleOption;
10
import nicotine.util.EventBus;
11
12
import java.util.Arrays;
13
14
import static nicotine.util.Common.mc;
15
16
public class Pitch40 extends Mod {
17
18
    private boolean start = false;
19
    private boolean constantPitch = true;
20
    private boolean lookUp = false;
21
    private float prevYaw = -1;
22
    private float pitchToAdjust = 0;
23
    private int tickDelay = 0;
24
25
    private final ToggleOption yawLock = new ToggleOption("YawLock");
26
    private final ToggleOption thirdPerson = new ToggleOption("ThirdPerson");
27
28
    public Pitch40() {
29
        super(ModCategory.Movement, "Pitch40", "If you start from a high enough position\nIt let's you efly forever without fireworks");
30
31
        this.keybind.keyCode = InputConstants.KEY_I;
32
        this.addOptions(Arrays.asList(yawLock, thirdPerson));
33
    }
34
35
    @Override
36
    public void toggle() {
37
        this.enabled = !this.enabled;
38
39
        start = false;
40
41
        if (!this.enabled) {
42
            mc.options.setCameraType(CameraType.FIRST_PERSON);
43
        }
44
    }
45
46
    @Override
47
    protected void init() {
48
        EventBus.register(ClientLevelTickEvent.class, event -> {
49
            if (!this.enabled)
50
                return true;
51
52
            if (mc.player.isFallFlying() && !mc.player.isInLiquid()) {
53
54
                if (thirdPerson.enabled) {
55
                    mc.options.setCameraType(CameraType.THIRD_PERSON_BACK);
56
                }
57
58
                if (yawLock.enabled) {
59
                    if (prevYaw == -1) {
60
                        prevYaw = mc.player.getYRot();
61
                    }
62
                    mc.player.setYRot(Math.round(prevYaw / 45) * 45);
63
                }
64
65
                if (!start) {
66
                    mc.player.setXRot(40);
67
                    tickDelay = 0;
68
                    start = true;
69
                    constantPitch = true;
70
                    lookUp = false;
71
                }
72
73
                if (constantPitch) {
74
                    if (lookUp) {
75
                        if (tickDelay < 30) {
76
                            pitchToAdjust = -40;
77
                            mc.player.setXRot(pitchToAdjust);
78
                        } else {
79
                            lookUp = false;
80
                            constantPitch = false;
81
                            tickDelay = 0;
82
                        }
83
                    } else {
84
                        if (tickDelay < 100) {
85
                            pitchToAdjust = 40;
86
                            mc.player.setXRot(pitchToAdjust);
87
                        } else {
88
                            lookUp = true;
89
                            constantPitch = false;
90
                            tickDelay = 0;
91
                        }
92
                    }
93
94
                    tickDelay++;
95
                } else {
96
                    pitchToAdjust += (lookUp ? -2.0f : 2.0f);
97
98
                    mc.player.setXRot(pitchToAdjust);
99
100
                    if (pitchToAdjust == 40 || pitchToAdjust == -40) {
101
                        constantPitch = true;
102
                    }
103
                }
104
105
            } else {
106
                start = false;
107
            }
108
109
            return true;
110
        });
111
    }
112
}
113