ECrystal module

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