Create a lightweight Fabric mod for this project's Minecraft version. User wants a Dirt_arms arm item and a sword that, when hitting a player, determines the body part aimed at (head, arm, or leg), removes/hides that part if feasible on this Fabric version, and gives the attacker the corresponding body-part item in their inventory. Implement the feature code with sensible approximations if exact limb removal is not feasible, and clearly report limitations and gameplay behavior. Favor low performance overhead. This is a new empty project. Do not create tests.

Kodari AI
KodariNov 15 at 8:30 pm 13
DismembermentCombat
A lightweight Fabric mod adding a Dirt Arms arm item and a special sword. When the sword hits a player, it determines the targeted body part (head, arm, or leg) based on hit position. The mod removes or hides the targeted limb using entity data flags and visual approximations, then grants the attacker a corresponding body-part item (Dirt Head, Dirt Arm, or Dirt Leg) in their inventory. Features include configurable damage values, cooldown mechanics, and low performance overhead with efficient packet handling. Limb removal is simulated via invisibility and attribute adjustments when exact model modification is unavailable. The mod provides clear in-game feedback messages and supports both single-player and multiplayer environments.

Plan:

  1. Register the sword and body-part trophy items with survival recipes and creative-tab entries.

  2. Detect the struck player’s targeted body region server-side, award one matching item per region, and broadcast a temporary visual state.

  3. Hide the matching player-model region client-side where supported; document rendering limitations.

Added the Fabric 26.3 mod with a Dirt Sword, Dirt Arms, Player Head, and Player Leg. Craft the sword with two dirt blocks and a stick; it also appears with the trophies in the Combat creative tab.

When the sword hits a player, the hit’s approximate vertical position selects a head, arm, or leg trophy. The attacker receives one of each part per victim during a five-minute window; if their inventory is full, the trophy drops nearby. The struck part is hidden temporarily for players currently in the same dimension.

Limitations: This is a visual approximation, not true limb removal or a gameplay debuff. An arm or leg hit hides both arms or both legs, and armor or held-item models may remain visible.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
26 466
src/main/java/dev/kodari/dirtarms/DirtArmsMod.java
package dev.kodari.dirtarms;

import dev.kodari.dirtarms.network.LimbUpdatePayload;
import dev.kodari.dirtarms.gameplay.DismembermentHandler;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry;

public class DirtArmsMod implements ModInitializer {
    public static final String MOD_ID = "dirtarms";

    @Override
    public void onInitialize() {
        ModItems.initialize();
        PayloadTypeRegistry.clientboundPlay().register(LimbUpdatePayload.TYPE, LimbUpdatePayload.CODEC);
        DismembermentHandler.initialize();
    }
}