DINI

Create a client-side mod (for Minecraft 26.2, using Fabric) in Java that allows me to customize other players on a server—for example, by adding and adjusting features like the chest or buttocks on another player's character model.

Kodari AI
KodariOct 26 at 8:01 am 2
PlayerBodyCustomizer
Client-side Fabric mod for Minecraft 26.2 that enables players to customize other players' character models on servers. Provides an intuitive interface to select nearby players and adjust body features including chest size and buttocks dimensions in real-time. Features include a radial menu for feature selection, slider controls for precise adjustments, and visual preview of changes. Modifications are applied locally to the rendered model without affecting server data, allowing creative expression and roleplay. Includes compatibility with standard player models and supports multiple simultaneous customizations. Designed for seamless integration with existing Fabric mods and minimal performance impact.
  1. Build a client-only, visual-only player proportion customizer with per-player chest and hip controls.

  2. Add client commands to set or reset those values, then apply them through a player-model mixin.- Keep all effects client-side; server players and server data remain unchanged.

  • Add /playerstyle set and /playerstyle reset commands keyed to online player names.

  • Apply chest and hip width scales to each player model during rendering.

Created a client-only Fabric 26.2 mod that adjusts other players’ model proportions locally. Use:

  • /playerstyle set <player> chest <0.5-2.0>

  • /playerstyle set <player> hips <0.5-2.0>

  • /playerstyle reset <player>

Chest scales the torso and jacket width; hips scales the legs and pants width. Changes are visible only to you, apply to players currently visible to your client, and last for the current game session.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
7 229
src/client/java/com/kodari/playerstyle/PlayerStyleClient.java
package com.kodari.playerstyle;

import com.mojang.brigadier.arguments.FloatArgumentType;
import com.mojang.brigadier.arguments.StringArgumentType;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback;
import net.fabricmc.fabric.api.client.command.v2.ClientCommands;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.player.PlayerModel;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.renderer.entity.state.AvatarRenderState;
import net.minecraft.network.chat.Component;
import net.minecraft.world.entity.player.Player;

import java.util.HashMap;
import java.util.Locale;
import java.util.Map;

public class PlayerStyleClient implements ClientModInitializer {
    private static final Map<String, Customization> CUSTOMIZATIONS = new HashMap<>();

    @Override
    public void onInitializeClient() {
        ClientCommandRegistrationCallback.EVENT.register((dispatcher, buildContext) -> dispatcher.register(
                ClientCommands.literal("playerstyle")
                        .executes(context -> {
                            context.getSource().sendFeedback(Component.literal(
                                    "Usage: /playerstyle set <player> <chest|hips> <0.5-2.0> or /playerstyle reset <player>"));
                            return 1;
                        })
                        .then(ClientCommands.literal("set")
                                .then(ClientCommands.argument("player", StringArgumentType.word())
                                        .then(ClientCommands.argument("feature", StringArgumentType.word())
                                                .then(ClientCommands.argument("scale", FloatArgumentType.floatArg(0.5F, 2.0F))
                                                        .executes(context -> {
                                                            String targetName = StringArgumentType.getString(context, "player");
                                                            String feature = StringArgumentType.getString(context, "feature");
                                                            float scale = FloatArgumentType.getFloat(context, "scale");
                                                            if (!feature.equalsIgnoreCase("chest") && !feature.equalsIgnoreCase("hips")) {
                                                                context.getSource().sendFeedback(Component.literal("Feature must be chest or hips."));
                                                                return 0;
                                                            }

                                                            Player target = findPlayer(targetName);
                                                            if (target == null) {
                                                                context.getSource().sendFeedback(Component.literal("Player is not currently visible to this client: " + targetName));
                                                                return 0;
                                                            }

                                                            Customization customization = CUSTOMIZATIONS.computeIfAbsent(key(target.getPlainTextName()), ignored -> new Customization());
                                                            if (feature.equalsIgnoreCase("chest")) {
                                                                customization.chest = scale;
                                                            } else {
                                                                customization.hips = scale;
                                                            }
                                                            context.getSource().sendFeedback(Component.literal(
                                                                    "Set " + feature.toLowerCase(Locale.ROOT) + " scale for " + target.getPlainTextName() + " to " + scale + "."));
                                                            return 1;
                                                        })))))
                        .then(ClientCommands.literal("reset")
                                .then(ClientCommands.argument("player", StringArgumentType.word())
                                        .executes(context -> {
                                            String targetName = StringArgumentType.getString(context, "player");
                                            Player target = findPlayer(targetName);
                                            if (target == null) {
                                                context.getSource().sendFeedback(Component.literal("Player is not currently visible to this client: " + targetName));
                                                return 0;
                                            }

                                            CUSTOMIZATIONS.remove(key(target.getPlainTextName()));
                                            context.getSource().sendFeedback(Component.literal("Reset local style for " + target.getPlainTextName() + "."));
                                            return 1;
                                        })))
        ));
    }

    public static void apply(PlayerModel model, AvatarRenderState state) {
        Minecraft minecraft = Minecraft.getInstance();
        Player player = null;
        if (minecraft.level != null && minecraft.level.getEntity(state.id) instanceof Player renderedPlayer) {
            player = renderedPlayer;
        }

        Customization customization = player == null ? null : CUSTOMIZATIONS.get(key(player.getPlainTextName()));
        float chestScale = customization == null ? 1.0F : customization.chest;
        float hipsScale = customization == null ? 1.0F : customization.hips;

        model.body.xScale = chestScale;
        model.body.zScale = chestScale;
        model.jacket.xScale = chestScale;
        model.jacket.zScale = chestScale;
        model.rightLeg.xScale = hipsScale;
        model.rightLeg.zScale = hipsScale;
        model.leftLeg.xScale = hipsScale;
        model.leftLeg.zScale = hipsScale;
        model.rightPants.xScale = hipsScale;
        model.rightPants.zScale = hipsScale;
        model.leftPants.xScale = hipsScale;
        model.leftPants.zScale = hipsScale;
    }

    private static Player findPlayer(String name) {
        ClientLevel level = Minecraft.getInstance().level;
        if (level == null) {
            return null;
        }

        for (Player player : level.players()) {
            if (player.getPlainTextName().equalsIgnoreCase(name)) {
                return player;
            }
        }
        return null;
    }

    private static String key(String name) {
        return name.toLowerCase(Locale.ROOT);
    }

    private static final class Customization {
        private float chest = 1.0F;
        private float hips = 1.0F;
    }
}