ItemHighlight module

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

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.

OfflineClientRENDERsrc/main/java/com/jellypudding/offlineclient/modules/render/ItemHighlight.javaJava · 50 lines · 2.2 KB

Paints a colour behind the items you pick in any inventory and the hotbar.

SettingsItemsColourStrengthHotbar
ItemHighlight.javaJava · Minecraft 26.2 · 50 lines · 2.2 KB · complete file, verbatimOriginal ↗
1
package com.jellypudding.offlineclient.modules.render;
2
3
import com.jellypudding.offlineclient.module.Category;
4
import com.jellypudding.offlineclient.module.Module;
5
import com.jellypudding.offlineclient.setting.BoolSetting;
6
import com.jellypudding.offlineclient.setting.ColorSetting;
7
import com.jellypudding.offlineclient.setting.NumberSetting;
8
import com.jellypudding.offlineclient.setting.RegistryListSetting;
9
import com.jellypudding.offlineclient.util.ColorUtil;
10
import net.minecraft.core.registries.BuiltInRegistries;
11
import net.minecraft.world.item.Item;
12
import net.minecraft.world.item.ItemStack;
13
import net.minecraft.world.item.Items;
14
15
import java.util.List;
16
17
// AbstractContainerScreenMixin paints the slot before the item goes on top.
18
public final class ItemHighlight extends Module {
19
20
    private final RegistryListSetting<Item> items = new RegistryListSetting<>("Items",
21
        "The items to pick out in any container screen.", BuiltInRegistries.ITEM,
22
        List.of(Items.TOTEM_OF_UNDYING, Items.ENCHANTED_GOLDEN_APPLE, Items.END_CRYSTAL,
23
            Items.EXPERIENCE_BOTTLE, Items.SHULKER_BOX));
24
    private final ColorSetting color = new ColorSetting("Colour",
25
        "Colour painted behind a matching item.", 130, false);
26
    private final NumberSetting strength = new NumberSetting("Strength",
27
        "How solid the paint is.", 50, 10, 100, 5, "%").max(100);
28
    private final BoolSetting hotbar = new BoolSetting("Hotbar",
29
        "Also paints the hotbar whilst you play with no inventory open.", true);
30
31
    public ItemHighlight() {
32
        super("ItemHighlight", "Paints a colour behind the items you pick in any inventory and the hotbar.", Category.RENDER);
33
        addSettings(items, color, strength, hotbar);
34
        searchTags("inventory highlight", "slot colour");
35
    }
36
37
    // Zero when the hotbar is not painted or the stack is not one to pick out.
38
    public int hotbarColorFor(ItemStack stack) {
39
        return hotbar.isOn() ? colorFor(stack) : 0;
40
    }
41
42
    // Zero when the stack is not one to pick out.
43
    public int colorFor(ItemStack stack) {
44
        if (!isEnabled() || stack.isEmpty() || !items.contains(stack.getItem())) {
45
            return 0;
46
        }
47
        return ColorUtil.fade(color.getColor(), strength.getFloat() / 100f);
48
    }
49
}
50