ThirdPerson module

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

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.

NicotineRendersrc/client/java/nicotine/mod/mods/render/ThirdPerson.javaJava · 62 lines · 1.6 KB
SettingsDistanceDisableZoom
ThirdPerson.javaJava · Minecraft 26.3 · 62 lines · 1.6 KB · complete file, verbatimOriginal ↗
1
package nicotine.mod.mods.render;
2
3
import net.minecraft.client.CameraType;
4
import net.minecraft.world.entity.ai.attributes.Attributes;
5
import nicotine.events.ClientLevelTickEvent;
6
import nicotine.events.GetMaxZoomEvent;
7
import nicotine.mod.Mod;
8
import nicotine.mod.ModCategory;
9
import nicotine.mod.option.SliderOption;
10
import nicotine.mod.option.ToggleOption;
11
import nicotine.util.EventBus;
12
13
import java.util.Arrays;
14
15
import static nicotine.util.Common.mc;
16
17
public class ThirdPerson extends Mod {
18
    public ThirdPerson() {
19
        super(ModCategory.Render, "ThirdPerson");
20
        this.addOptions(Arrays.asList(distance, disableZoom));
21
    }
22
23
    private final double CAMERA_DISTANCE = 4.0;
24
25
    private final SliderOption distance = new SliderOption(
26
            "Distance",
27
            4,
28
            0,
29
            15
30
    );
31
32
    private final ToggleOption disableZoom = new ToggleOption("DisableZoom");
33
34
    @Override
35
    public void toggle() {
36
        super.toggle();
37
38
        if (!this.enabled) {
39
            mc.player.getAttribute(Attributes.CAMERA_DISTANCE).setBaseValue(CAMERA_DISTANCE);
40
        }
41
    }
42
43
    @Override
44
    protected void init() {
45
        EventBus.register(ClientLevelTickEvent.class, event -> {
46
            if (!this.enabled || mc.options.getCameraType() == CameraType.FIRST_PERSON)
47
                return true;
48
49
            mc.player.getAttribute(Attributes.CAMERA_DISTANCE).setBaseValue(distance.value);
50
51
            return true;
52
        });
53
54
        EventBus.register(GetMaxZoomEvent.class, event -> {
55
            if (!this.enabled || !disableZoom.enabled)
56
                return true;
57
58
            return false;
59
        });
60
    }
61
}
62