make a minecraft fabric 1.21.11 mod that sends message/command only if i pop my totem and don't have any more totems in my inventory. The commands should be this. 1 - "/team sethome" 2 - "/team warp trap kasun123" I made this mod before with kodari ai but there were some problems. The mod works but you need to fix these. The mod sometimes doesn't run those commnds when I pop my totem even if there aren't any totems in my inventory. And also can you add a debug in chat that shows how many totems I have left when I pop a totem. It should be called "TotemCount" and it should only be shown to me in chat. Not to other player. Make it colorfull. (Not just one color)
Add a client-side totem-pop hook that identifies only the local player.
Wait for inventory synchronization, then count every remaining totem slot.
Show a colorful local
TotemCountmessage and send both commands only at zero.Create the Fabric 1.21.11 Gradle project and client mixin configuration.
Created TotemCount for Fabric 1.21.11.
Detects only your own totem pops client-side.
Waits briefly for inventory synchronization, then counts all remaining totems.
Shows a colorful private
TotemCountchat message.Runs
/team sethomeand/team warp trap kasun123only when your count is zero.
The compilation failed with this error:
Compilation failed with 4 error(s):
ERROR in src/main/java/client/java/com/kodari/totemcount/TotemPopTracker.java at line 48: cannot find symbol
player.sendChatCommand("team sethome");
^
symbol: method sendChatCommand(String)
location: variable player of type ClientPlayerEntity
ERROR in src/main/java/client/java/com/kodari/totemcount/TotemPopTracker.java at line 49: cannot find symbol
player.sendChatCommand("team warp trap kasun123");
^
symbol: method sendChatCommand(String)
location: variable player of type ClientPlayerEntity
ERROR in src/main/java/client/java/com/kodari/totemcount/TotemPopTracker.java at line 48: cannot find symbol
player.sendChatCommand("team sethome");
^
symbol: method sendChatCommand(String)
location: variable player of type ClientPlayerEntity
ERROR in src/main/java/client/java/com/kodari/totemcount/TotemPopTracker.java at line 49: cannot find symbol
player.sendChatCommand("team warp trap kasun123");
^
symbol: method sendChatCommand(String)
location: variable player of type ClientPlayerEntity
=== COMPILATION ERROR ANALYSIS ===
MISSING METHODS:
- sendChatCommand(String)
ACTION: Check method names and signatures
FILES TO INVESTIGATE:
- src/main/java/client/java/com/kodari/totemcount/TotemPopTracker.java
- src/main/java/client/java/com/kodari/totemcount/TotemPopTracker.java
Please fix this error by creating a new artifact with the corrected code.
Use the client play network handler to send each command.
Preserve the delayed inventory check and local-only debug message.
Fixed the command calls in TotemPopTracker.
Commands now send through MinecraftClient.getNetworkHandler().sendChatCommand(...), which is the correct client-side API for Fabric 1.21.11.
The game lags sometimes when i use the mod. Especially when I open my inventory. It makes the CPU rate really high. Can you fix it?
Keep the delayed check, so inventory synchronization remains reliable.
Cache the inventory and each stack during the one-shot count.
Avoid carrying a pending check across a disconnected or replaced player.
Reduced the totem-count work to a single cached-inventory scan after each pop, rather than repeatedly resolving inventory and stack accessors. Pending checks are also discarded immediately if you disconnect, preventing stale work.
package com.kodari.totemcount;
import net.fabricmc.api.ClientModInitializer;
public class TotemCountClient implements ClientModInitializer {
@Override
public void onInitializeClient() {
TotemPopTracker.initialize();
}
}