ok new mod or macro make script that when i dont have anything in offhand and i look into inventory esc it will give totem that i will have in offhand in like 0.9s so like nothing in off hand esc - totem auto in offhand so basicli it trigger the esc if no totem then it does nothing if something in offhand then do nothing this will make it stop in singleplayer from creepers so pls jar its new so make everything new
KodariAug 6 at 5:39 pm 1
AutoTotemSwap
Automatically places a Totem of Undying into the player's offhand when the inventory is closed and the offhand is empty. Triggers only on inventory close (ESC key) in singleplayer, providing creeper explosion protection without manual swapping. Ignores action if offhand already contains an item.
Create a Fabric 1.21.11 client mod that watches inventory-screen openings.
After 0.9 seconds, move the first Totem of Undying to the empty offhand slot, without replacing an occupied offhand.
Add the complete Gradle project, metadata, source, and required resources.
Created the new Fabric 1.21.11 Auto Totem mod project.
Opens only from the player inventory screen.
Waits approximately 0.9 seconds.
Checks that the offhand is empty.
Finds a Totem of Undying in the inventory.
Moves it into the offhand.
Does nothing if there is no totem or the offhand is occupied.
Includes Gradle setup, Fabric metadata, split client source sets, and Java 21 configuration.
bro it took like 2 sec make it 0,2sec
KodariAug 6 at 5:44 pm 1
Changed the delay from 18 ticks (~0.9 seconds) to 4 ticks (~0.2 seconds).
Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
7 203
src/main/java/com/kodari/autototem/AutoTotem.java
package com.kodari.autototem;
import net.fabricmc.api.ModInitializer;
public class AutoTotem implements ModInitializer {
public static final String MOD_ID = "autototem";
@Override
public void onInitialize() {
}
}