hand-view module

hand-view: Minecraft 26.3 cheat module, full source for every implementation (1 client: Meteor Client).

1 implementationRender

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.

Meteor ClientRendersrc/main/java/meteordevelopment/meteorclient/systems/modules/render/HandView.javaJava · 250 lines · 8.0 KB

Alters the way items are rendered in your hands.

Settingsserver-rotationsold-animationsskip-swapping-animationdisable-eating-animationsword-slashswing-modeswing-speedmain-hand-progressoff-hand-progressscalepositionrotation
HandView.javaJava · Minecraft 26.2 · 250 lines · 8.0 KB · complete file, verbatimOriginal ↗
1
/*
2
 * This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client).
3
 * Copyright (c) Meteor Development.
4
 */
5
6
package meteordevelopment.meteorclient.systems.modules.render;
7
8
import com.mojang.blaze3d.vertex.PoseStack;
9
import com.mojang.math.Axis;
10
import meteordevelopment.meteorclient.events.render.ArmRenderEvent;
11
import meteordevelopment.meteorclient.events.render.HeldItemRendererEvent;
12
import meteordevelopment.meteorclient.settings.*;
13
import meteordevelopment.meteorclient.systems.modules.Categories;
14
import meteordevelopment.meteorclient.systems.modules.Module;
15
import meteordevelopment.meteorclient.utils.player.Rotations;
16
import meteordevelopment.orbit.EventHandler;
17
import net.minecraft.world.InteractionHand;
18
import org.joml.Vector3d;
19
20
public class HandView extends Module {
21
    private final SettingGroup sgGeneral = settings.getDefaultGroup();
22
    private final SettingGroup sgMainHand = settings.createGroup("Main Hand");
23
    private final SettingGroup sgOffHand = settings.createGroup("Off Hand");
24
    private final SettingGroup sgArm = settings.createGroup("Arm");
25
26
    // General
27
28
    private final Setting<Boolean> followRotations = sgGeneral.add(new BoolSetting.Builder()
29
        .name("server-rotations")
30
        .description("Makes your hands follow your serverside rotations.")
31
        .defaultValue(false)
32
        .build()
33
    );
34
35
    public final Setting<Boolean> oldAnimations = sgGeneral.add(new BoolSetting.Builder()
36
        .name("old-animations")
37
        .description("Changes hit animations to those like 1.8")
38
        .defaultValue(false)
39
        .build()
40
    );
41
42
    public final Setting<Boolean> skipSwapping = sgGeneral.add(new BoolSetting.Builder()
43
        .name("skip-swapping-animation")
44
        .description("Whether or not to skip the item swapping animation")
45
        .defaultValue(false)
46
        .build()
47
    );
48
49
    private final Setting<Boolean> disableFoodAnimation = sgGeneral.add(new BoolSetting.Builder()
50
        .name("disable-eating-animation")
51
        .description("Disables the eating animation. Potentially desirable if it goes offscreen.")
52
        .defaultValue(false)
53
        .build()
54
    );
55
56
    public final Setting<Boolean> swordSlash = sgGeneral.add(new BoolSetting.Builder()
57
        .name("sword-slash")
58
        .description("Replaces the sword swing animation with the offhand idle animation.")
59
        .defaultValue(false)
60
        .build()
61
    );
62
63
    public final Setting<SwingMode> swingMode = sgGeneral.add(new EnumSetting.Builder<SwingMode>()
64
        .name("swing-mode")
65
        .description("Modifies your client & server hand swinging.")
66
        .defaultValue(SwingMode.None)
67
        .build()
68
    );
69
70
    public final Setting<Integer> swingSpeed = sgGeneral.add(new IntSetting.Builder()
71
        .name("swing-speed")
72
        .description("The swing speed of your hands.")
73
        .defaultValue(6)
74
        .range(0, 20)
75
        .sliderMax(20)
76
        .build()
77
    );
78
79
    public final Setting<Double> mainSwing = sgGeneral.add(new DoubleSetting.Builder()
80
        .name("main-hand-progress")
81
        .description("The swing progress of your main hand.")
82
        .defaultValue(0)
83
        .range(0, 1)
84
        .sliderMax(1)
85
        .build()
86
    );
87
88
    public final Setting<Double> offSwing = sgGeneral.add(new DoubleSetting.Builder()
89
        .name("off-hand-progress")
90
        .description("The swing progress of your off hand.")
91
        .defaultValue(0)
92
        .range(0, 1)
93
        .sliderMax(1)
94
        .build()
95
    );
96
97
    // Main Hand
98
99
    private final Setting<Vector3d> scaleMain = sgMainHand.add(new Vector3dSetting.Builder()
100
        .name("scale")
101
        .description("The scale of your main hand.")
102
        .defaultValue(1, 1, 1)
103
        .sliderMax(5)
104
        .decimalPlaces(1)
105
        .build()
106
    );
107
108
    private final Setting<Vector3d> posMain = sgMainHand.add(new Vector3dSetting.Builder()
109
        .name("position")
110
        .description("The position of your main hand.")
111
        .defaultValue(0, 0, 0)
112
        .sliderRange(-3, 3)
113
        .decimalPlaces(1)
114
        .build()
115
    );
116
117
    private final Setting<Vector3d> rotMain = sgMainHand.add(new Vector3dSetting.Builder()
118
        .name("rotation")
119
        .description("The rotation of your main hand.")
120
        .defaultValue(0, 0, 0)
121
        .sliderRange(-180, 180)
122
        .decimalPlaces(0)
123
        .build()
124
    );
125
126
    // Offhand
127
128
    private final Setting<Vector3d> scaleOff = sgOffHand.add(new Vector3dSetting.Builder()
129
        .name("scale")
130
        .description("The scale of your off hand.")
131
        .defaultValue(1, 1, 1)
132
        .sliderMax(5)
133
        .decimalPlaces(1)
134
        .build()
135
    );
136
137
    private final Setting<Vector3d> posOff = sgOffHand.add(new Vector3dSetting.Builder()
138
        .name("position")
139
        .description("The position of your off hand.")
140
        .defaultValue(0, 0, 0)
141
        .sliderRange(-3, 3)
142
        .decimalPlaces(1)
143
        .build()
144
    );
145
146
    private final Setting<Vector3d> rotOff = sgOffHand.add(new Vector3dSetting.Builder()
147
        .name("rotation")
148
        .description("The rotation of your off hand.")
149
        .defaultValue(0, 0, 0)
150
        .sliderRange(-180, 180)
151
        .decimalPlaces(0)
152
        .build()
153
    );
154
155
    // Arm
156
157
    private final Setting<Vector3d> scaleArm = sgArm.add(new Vector3dSetting.Builder()
158
        .name("scale")
159
        .defaultValue(1, 1, 1)
160
        .sliderMax(5)
161
        .decimalPlaces(1)
162
        .build()
163
    );
164
165
    private final Setting<Vector3d> posArm = sgArm.add(new Vector3dSetting.Builder()
166
        .name("position")
167
        .defaultValue(0, 0, 0)
168
        .sliderRange(-3, 3)
169
        .decimalPlaces(1)
170
        .build()
171
    );
172
173
    private final Setting<Vector3d> rotArm = sgArm.add(new Vector3dSetting.Builder()
174
        .name("rotation")
175
        .defaultValue(0, 0, 0)
176
        .sliderRange(-180, 180)
177
        .decimalPlaces(0)
178
        .build()
179
    );
180
181
    public HandView() {
182
        super(Categories.Render, "hand-view", "Alters the way items are rendered in your hands.");
183
    }
184
185
    @EventHandler
186
    private void onHeldItemRender(HeldItemRendererEvent event) {
187
        if (Rotations.rotating && followRotations.get()) {
188
            applyServerRotations(event.matrix);
189
        }
190
191
        if (event.hand == InteractionHand.MAIN_HAND) {
192
            rotate(event.matrix, rotMain.get());
193
            scale(event.matrix, scaleMain.get());
194
            translate(event.matrix, posMain.get());
195
        } else {
196
            rotate(event.matrix, rotOff.get());
197
            scale(event.matrix, scaleOff.get());
198
            translate(event.matrix, posOff.get());
199
        }
200
    }
201
202
    @EventHandler
203
    private void onRenderArm(ArmRenderEvent event) {
204
        rotate(event.matrix, rotArm.get());
205
        scale(event.matrix, scaleArm.get());
206
        translate(event.matrix, posArm.get());
207
    }
208
209
    private void rotate(PoseStack matrix, Vector3d rotation) {
210
        matrix.mulPose(Axis.XP.rotationDegrees((float) rotation.x));
211
        matrix.mulPose(Axis.YP.rotationDegrees((float) rotation.y));
212
        matrix.mulPose(Axis.ZP.rotationDegrees((float) rotation.z));
213
    }
214
215
    private void scale(PoseStack matrix, Vector3d scale) {
216
        matrix.scale((float) scale.x, (float) scale.y, (float) scale.z);
217
    }
218
219
    private void translate(PoseStack matrix, Vector3d translation) {
220
        matrix.translate((float) translation.x, (float) translation.y, (float) translation.z);
221
    }
222
223
    private void applyServerRotations(PoseStack matrix) {
224
        matrix.mulPose(Axis.XP.rotationDegrees(mc.player.getXRot() - Rotations.serverPitch));
225
        matrix.mulPose(Axis.YP.rotationDegrees(mc.player.getYRot() - Rotations.serverYaw));
226
    }
227
228
    public boolean oldAnimations() {
229
        return isActive() && oldAnimations.get();
230
    }
231
232
    public boolean skipSwapping() {
233
        return isActive() && skipSwapping.get();
234
    }
235
236
    public boolean disableFoodAnimation() {
237
        return isActive() && disableFoodAnimation.get();
238
    }
239
240
    public boolean swordSlash() {
241
        return isActive() && swordSlash.get();
242
    }
243
244
    public enum SwingMode {
245
        Offhand,
246
        Mainhand,
247
        None
248
    }
249
}
250