slippy module

slippy: Minecraft 26.3 cheat module, full source for every implementation (2 clients: Meteor Client, OfflineClient).

2 implementationsMovementMOVEMENT

Clients with this module

Full module source: 2 implementations

Every implementation below is the complete module file, verbatim. Expand a client to read its code.

Meteor ClientMovementsrc/main/java/meteordevelopment/meteorclient/systems/modules/movement/Slippy.javaJava · 54 lines · 1.8 KB

Changes the base friction level of blocks.

Settingsfrictionlist-modeignored-blocksallowed-blocks
Slippy.javaJava · Minecraft 26.2 · 54 lines · 1.8 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.movement;
7
8
import meteordevelopment.meteorclient.settings.*;
9
import meteordevelopment.meteorclient.systems.modules.Categories;
10
import meteordevelopment.meteorclient.systems.modules.Module;
11
import meteordevelopment.meteorclient.utils.misc.ListMode;
12
import net.minecraft.world.level.block.Block;
13
14
import java.util.List;
15
16
public class Slippy extends Module {
17
    private final SettingGroup sgGeneral = settings.getDefaultGroup();
18
19
    public final Setting<Double> friction = sgGeneral.add(new DoubleSetting.Builder()
20
        .name("friction")
21
        .description("The base friction level.")
22
        .range(0.01, 1.10)
23
        .sliderRange(0.01, 1.10)
24
        .defaultValue(1)
25
        .build()
26
    );
27
28
    public final Setting<ListMode> listMode = sgGeneral.add(new EnumSetting.Builder<ListMode>()
29
        .name("list-mode")
30
        .description("The mode to select blocks.")
31
        .defaultValue(ListMode.Blacklist)
32
        .build()
33
    );
34
35
    public final Setting<List<Block>> ignoredBlocks = sgGeneral.add(new BlockListSetting.Builder()
36
        .name("ignored-blocks")
37
        .description("Decide which blocks not to slip on")
38
        .visible(() -> listMode.get() == ListMode.Blacklist)
39
        .build()
40
    );
41
42
    public final Setting<List<Block>> allowedBlocks = sgGeneral.add(new BlockListSetting.Builder()
43
        .name("allowed-blocks")
44
        .description("Decide which blocks to slip on")
45
        .visible(() -> listMode.get() == ListMode.Whitelist)
46
        .build()
47
    );
48
49
    public Slippy() {
50
        super(Categories.Movement, "slippy", "Changes the base friction level of blocks.");
51
    }
52
53
}
54
OfflineClientMOVEMENTsrc/main/java/com/jellypudding/offlineclient/modules/movement/Slippy.javaJava · 54 lines · 2.4 KB

Makes the ground as slippery as ice or worse.

SettingsFrictionList modeIgnored blocksSlippery blocks
Slippy.javaJava · Minecraft 26.2 · 54 lines · 2.4 KB · complete file, verbatimOriginal ↗
1
package com.jellypudding.offlineclient.modules.movement;
2
3
import com.jellypudding.offlineclient.module.Category;
4
import com.jellypudding.offlineclient.module.Module;
5
import com.jellypudding.offlineclient.setting.EnumSetting;
6
import com.jellypudding.offlineclient.setting.NumberSetting;
7
import com.jellypudding.offlineclient.setting.RegistryListSetting;
8
import net.minecraft.core.registries.BuiltInRegistries;
9
import net.minecraft.world.level.block.Block;
10
11
import java.util.List;
12
13
// Behaviour lives in LivingEntityMixin. Only the local player reads the changed friction.
14
public final class Slippy extends Module {
15
16
    public enum ListMode { BLACKLIST, WHITELIST }
17
18
    private final NumberSetting friction = new NumberSetting("Friction",
19
        "The friction every block gets. Plain ground is 0.6 and ice is 0.98.", 1, 0.01, 1.1, 0.01, "")
20
        .min(0.01).max(1.1);
21
    private final EnumSetting<ListMode> listMode = new EnumSetting<>("List mode",
22
        "What the block list means.", ListMode.BLACKLIST)
23
        .describe(ListMode.BLACKLIST, "Every block is slippery except the listed ones.")
24
        .describe(ListMode.WHITELIST, "Only the listed blocks are slippery.");
25
    private final RegistryListSetting<Block> ignoredBlocks = new RegistryListSetting<>("Ignored blocks",
26
        "Blocks that keep their normal friction.", BuiltInRegistries.BLOCK, List.of())
27
        .under(listMode, ListMode.BLACKLIST);
28
    private final RegistryListSetting<Block> slipperyBlocks = new RegistryListSetting<>("Slippery blocks",
29
        "Blocks that get the friction above.", BuiltInRegistries.BLOCK, List.of())
30
        .under(listMode, ListMode.WHITELIST);
31
32
    public Slippy() {
33
        super("Slippy", "Makes the ground as slippery as ice or worse.", Category.MOVEMENT);
34
        addSettings(friction, listMode, ignoredBlocks, slipperyBlocks);
35
        searchTags("ice", "friction", "slide", "slippery");
36
    }
37
38
    @Override
39
    public String getSuffix() {
40
        return friction.getValueString();
41
    }
42
43
    // The friction the block under the player should report.
44
    public float groundFriction(Block block, float vanilla) {
45
        if (!isEnabled()) {
46
            return vanilla;
47
        }
48
        boolean listed = listMode.is(ListMode.WHITELIST)
49
            ? slipperyBlocks.contains(block) : ignoredBlocks.contains(block);
50
        boolean slippery = listed == listMode.is(ListMode.WHITELIST);
51
        return slippery ? friction.getFloat() : vanilla;
52
    }
53
}
54