Totem module

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

1 implementationHUD

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.

NicotineHUDsrc/client/java/nicotine/mod/mods/hud/Totem.javaJava · 46 lines · 1.3 KB
Totem.javaJava · Minecraft 26.3 · 46 lines · 1.3 KB · complete file, verbatimOriginal ↗
1
package nicotine.mod.mods.hud;
2
3
import net.minecraft.world.item.Items;
4
import nicotine.events.GuiRenderAfterEvent;
5
import nicotine.mod.HUDMod;
6
import nicotine.mod.ModCategory;
7
import nicotine.mod.ModManager;
8
import nicotine.util.EventBus;
9
10
import static nicotine.util.Common.mc;
11
12
public class Totem extends HUDMod {
13
14
    public Totem() {
15
        super(ModCategory.HUD, "Totem");
16
    }
17
18
    @Override
19
    protected void init() {
20
        EventBus.register(GuiRenderAfterEvent.class, event -> {
21
            if (!this.enabled)
22
                return true;
23
24
            int posX = (mc.getWindow().getGuiScaledWidth() / 2) - 8;
25
26
            if (ModManager.getMod("ECrystal").enabled)
27
                posX = mc.getWindow().getGuiScaledWidth() / 2;
28
29
            int posY = mc.getWindow().getGuiScaledHeight() - 75;
30
31
            int totemCount = 0;
32
33
            for (int i = 0; i <= 45; i++) {
34
                if (mc.player.getInventory().getItem(i).getItem() == Items.TOTEM_OF_UNDYING) {
35
                    totemCount++;
36
                }
37
            }
38
39
            event.drawContext.fakeItem(Items.TOTEM_OF_UNDYING.getDefaultInstance(), posX, posY);
40
            event.drawContext.itemDecorations(mc.font, Items.TOTEM_OF_UNDYING.getDefaultInstance(), posX, posY, String.valueOf(totemCount));
41
42
            return true;
43
        });
44
    }
45
}
46