roijiofficial

rewrite "Hold my items" mod from modrinth for version 26.3 fabric

Kodari AI
KodariOct 18 at 7:26 am 2
HoldMyItemsRewrite
A Fabric mod for Minecraft 26.3 that lets players store and retrieve their inventory items in a persistent virtual chest. When activated, the mod saves the player's entire inventory to a secure storage location and restores it on demand. Features include a simple keybind to toggle storage, automatic item preservation on death, and a GUI interface for managing stored items. The mod supports multiple storage slots per player, allowing different loadouts for different situations. Items are stored with full NBT data, preserving enchantments, durability, and custom names. The mod integrates with the Fabric API and requires no server-side installation for basic functionality.

Plan: set up a client-only Fabric 26.3 mod, then add a verified first-person arm/item swing animation mixin. This is an independent implementation; it won’t include the original mod’s full animation library or resource-pack animation system.

Created a client-only Fabric 26.3 mod that adds a swing-driven movement to the first-person arm and held item.

This is a clean-room starter, not a full recreation of Hold My Items: it does not include the original’s broader animation set or resource-pack customization.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
6 144
src/client/java/com/kodari/holdmyitems/mixin/FirstPersonHandsAndItemsRendererMixin.java
package com.kodari.holdmyitems.mixin;

import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.renderer.FirstPersonHandsAndItemsRenderer;
import net.minecraft.client.renderer.SubmitNodeCollector;
import net.minecraft.client.renderer.state.level.FirstPersonHandsAndItemsRenderState;
import net.minecraft.client.renderer.state.level.PlayerRenderState;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(FirstPersonHandsAndItemsRenderer.class)
public abstract class FirstPersonHandsAndItemsRendererMixin {
    @Inject(method = "submitArmWithItem", at = @At("HEAD"))
    private void holdmyitems$animateHeldHand(
            final PlayerRenderState playerState,
            final FirstPersonHandsAndItemsRenderState state,
            final float partialTicks,
            final float xRot,
            final InteractionHand hand,
            final float attack,
            final ItemStack itemStack,
            final float inverseArmHeight,
            final PoseStack poseStack,
            final SubmitNodeCollector submitNodeCollector,
            final int lightCoords,
            final CallbackInfo callbackInfo
    ) {
        final float swing = (float) Math.sin(Math.sqrt(attack) * Math.PI);
        final float handDirection = hand == InteractionHand.MAIN_HAND ? 1.0F : -1.0F;

        poseStack.pushPose();
        poseStack.translate(handDirection * swing * 0.045F, swing * 0.075F, -swing * 0.12F);
    }

    @Inject(method = "submitArmWithItem", at = @At("RETURN"))
    private void holdmyitems$restoreHeldHandPose(
            final PlayerRenderState playerState,
            final FirstPersonHandsAndItemsRenderState state,
            final float partialTicks,
            final float xRot,
            final InteractionHand hand,
            final float attack,
            final ItemStack itemStack,
            final float inverseArmHeight,
            final PoseStack poseStack,
            final SubmitNodeCollector submitNodeCollector,
            final int lightCoords,
            final CallbackInfo callbackInfo
    ) {
        poseStack.popPose();
    }
}