ExtraRange module

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

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.

NicotinePlayersrc/client/java/nicotine/mod/mods/player/ExtraRange.javaJava · 62 lines · 1.8 KB

Lets you interact with stuff from further away

SettingsBlockEntity
ExtraRange.javaJava · Minecraft 26.3 · 62 lines · 1.8 KB · complete file, verbatimOriginal ↗
1
package nicotine.mod.mods.player;
2
3
import net.minecraft.world.entity.ai.attributes.Attributes;
4
import nicotine.events.ClientLevelTickEvent;
5
import nicotine.mod.Mod;
6
import nicotine.mod.ModCategory;
7
import nicotine.mod.option.SliderOption;
8
import nicotine.util.EventBus;
9
10
import java.util.Arrays;
11
12
import static nicotine.util.Common.mc;
13
14
public class ExtraRange extends Mod {
15
16
    private final double BLOCK_INTERACT_RANGE = 4.5;
17
    private final double ENTITY_INTERACT_RANGE = 3.0;
18
19
    private final SliderOption block = new SliderOption(
20
            "Block",
21
            0.0f,
22
            0.0f,
23
            1.5f,
24
            true
25
    );
26
    private final SliderOption entity = new SliderOption(
27
            "Entity",
28
            0.0f,
29
            0.0f,
30
            1.5f,
31
            true
32
    );
33
34
    public ExtraRange() {
35
        super(ModCategory.Player, "ExtraRange", "Lets you interact with stuff from further away");
36
        this.addOptions(Arrays.asList(block, entity));
37
    }
38
39
    @Override
40
    public void toggle() {
41
        this.enabled = !this.enabled;
42
43
        if (!enabled && mc.level != null) {
44
            mc.player.getAttribute(Attributes.BLOCK_INTERACTION_RANGE).setBaseValue(BLOCK_INTERACT_RANGE);
45
            mc.player.getAttribute(Attributes.ENTITY_INTERACTION_RANGE).setBaseValue(ENTITY_INTERACT_RANGE);
46
        }
47
    }
48
49
    @Override
50
    protected void init() {
51
        EventBus.register(ClientLevelTickEvent.class, event -> {
52
            if (!this.enabled)
53
                return true;
54
55
            mc.player.getAttribute(Attributes.BLOCK_INTERACTION_RANGE).setBaseValue(BLOCK_INTERACT_RANGE + block.value);
56
            mc.player.getAttribute(Attributes.ENTITY_INTERACTION_RANGE).setBaseValue(ENTITY_INTERACT_RANGE + entity.value);
57
58
            return true;
59
        });
60
    }
61
}
62