fake-player module

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

1 implementationPlayer

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 ClientPlayersrc/main/java/meteordevelopment/meteorclient/systems/modules/player/FakePlayer.javaJava · 97 lines · 3.2 KB

Spawns a client-side fake player for testing usages. No need to be active.

Settingsnamecopy-invhealth
FakePlayer.javaJava · Minecraft 26.2 · 97 lines · 3.2 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.player;
7
8
import meteordevelopment.meteorclient.gui.GuiTheme;
9
import meteordevelopment.meteorclient.gui.widgets.WWidget;
10
import meteordevelopment.meteorclient.gui.widgets.containers.WTable;
11
import meteordevelopment.meteorclient.gui.widgets.pressable.WButton;
12
import meteordevelopment.meteorclient.gui.widgets.pressable.WMinus;
13
import meteordevelopment.meteorclient.settings.*;
14
import meteordevelopment.meteorclient.systems.modules.Categories;
15
import meteordevelopment.meteorclient.systems.modules.Module;
16
import meteordevelopment.meteorclient.utils.entity.fakeplayer.FakePlayerEntity;
17
import meteordevelopment.meteorclient.utils.entity.fakeplayer.FakePlayerManager;
18
19
public class FakePlayer extends Module {
20
    private final SettingGroup sgGeneral = settings.getDefaultGroup();
21
22
    public final Setting<String> name = sgGeneral.add(new StringSetting.Builder()
23
        .name("name")
24
        .description("The name of the fake player.")
25
        .defaultValue("seasnail8169")
26
        .build()
27
    );
28
29
    public final Setting<Boolean> copyInv = sgGeneral.add(new BoolSetting.Builder()
30
        .name("copy-inv")
31
        .description("Copies your inventory to the fake player.")
32
        .defaultValue(true)
33
        .build()
34
    );
35
36
    public final Setting<Integer> health = sgGeneral.add(new IntSetting.Builder()
37
        .name("health")
38
        .description("The fake player's default health.")
39
        .defaultValue(20)
40
        .min(1)
41
        .sliderRange(1, 100)
42
        .build()
43
    );
44
45
    private WTable table;
46
47
    public FakePlayer() {
48
        super(Categories.Player, "fake-player", "Spawns a client-side fake player for testing usages. No need to be active.");
49
    }
50
51
    @Override
52
    public void onDeactivate() {
53
        FakePlayerManager.clear();
54
        if (table != null) table.clear();
55
    }
56
57
    @Override
58
    public WWidget getWidget(GuiTheme theme) {
59
        table = theme.table();
60
        fillTable(theme, table);
61
62
        return table;
63
    }
64
65
    private void fillTable(GuiTheme theme, WTable table) {
66
        for (FakePlayerEntity fakePlayer : FakePlayerManager.getFakePlayers()) {
67
            table.add(theme.label(fakePlayer.getName().getString()));
68
            WMinus delete = table.add(theme.minus()).expandCellX().right().widget();
69
            delete.action = () -> {
70
                FakePlayerManager.remove(fakePlayer);
71
                table.clear();
72
                fillTable(theme, table);
73
            };
74
            table.row();
75
        }
76
77
        WButton spawn = table.add(theme.button("Spawn")).expandCellX().right().widget();
78
        spawn.action = () -> {
79
            FakePlayerManager.add(name.get(), health.get(), copyInv.get());
80
            table.clear();
81
            fillTable(theme, table);
82
        };
83
84
        WButton clear = table.add(theme.button("Clear All")).right().widget();
85
        clear.action = () -> {
86
            FakePlayerManager.clear();
87
            table.clear();
88
            fillTable(theme, table);
89
        };
90
    }
91
92
    @Override
93
    public String getInfoString() {
94
        return String.valueOf(FakePlayerManager.count());
95
    }
96
}
97