mimis131124-dotcom

make me a mod that when u press x it opens a guy thaT HAS AAN OPTION TO ENABLE/DISHABLE HACKS 1ST HACK IS I SHOT KILL SPEAR WHEN I ENABLE TI AND SPEAR SOME 1 INSTALTY DIES

Kodari AI
KodariJun 24 at 8:21 pm 11
HackClient
A client-side hack menu mod for Fabric 1.21.11. Press X to open a sleek toggle GUI listing available hacks. First hack: One-Shot Spear — when enabled, hitting any entity with a Trident instantly kills it by dealing massive damage server-side via a mixin hook. More hacks can be added to the toggle screen easily.

Now I have everything I need. Let me plan:

  1. build.gradle + gradle.properties — project setup

  2. fabric.mod.json + mixin JSON

  3. Main mod class (common)

  4. Client mod class (registers keybinding)

  5. HackRegistry — singleton holding hack toggle states

  6. HackMenuScreen — the GUI opened with X

  7. TridentKillMixin — server-side mixin on TridentEntity hit to instantly kill target


Here’s what the mod does:

Press X → opens the Hack Menu overlay (game keeps running, no pause).

Hack Menu shows a dark panel with a blue border and a toggle button for each hack. Click to toggle on/off — button turns green [ON] or red [OFF].

One-Shot Spear — when enabled, any trident you throw that hits a living entity (player, mob, etc.) deals Float.MAX_VALUE damage, killing it instantly. Works via a server-side mixin on TridentEntity.onEntityHit.

The hack state is stored in HackRegistry — a simple static singleton — making it trivial to add more hacks later by just calling hacks.put("Hack Name", false) in the constructor.

mimis131124-dotcom

The compilation failed with this error:

code
Compilation failed with 4 error(s):

ERROR in src/main/java/com/hackclient/mixin/TridentEntityMixin.java at line 12: package org.spongepowered.asm.mixin.callback does not exist
import org.spongepowered.asm.mixin.callback.CallbackInfo;
                                           ^

ERROR in src/main/java/com/hackclient/mixin/TridentEntityMixin.java at line 21: cannot find symbol
    private void onTridentHit(net.minecraft.util.hit.EntityHitResult result, CallbackInfo ci) {
                                                                             ^
  symbol: class CallbackInfo
  location: class TridentEntityMixin

ERROR in   src/main/java/com/hackclient/mixin/TridentEntityMixin.java at line 21: cannot find symbol
      private void onTridentHit(net.minecraft.util.hit.EntityHitResult result, CallbackInfo ci) {
                                                                               ^
  symbol: class CallbackInfo
  location: class TridentEntityMixin

ERROR in   src/main/java/com/hackclient/mixin/TridentEntityMixin.java at line 12: package org.spongepowered.asm.mixin.callback does not exist
  import org.spongepowered.asm.mixin.callback.CallbackInfo;
                                             ^


=== COMPILATION ERROR ANALYSIS ===

MISSING CLASSES:
  - CallbackInfo
ACTION: Create these classes or check imports

FILES TO INVESTIGATE:
  - src/main/java/com/hackclient/mixin/TridentEntityMixin.java
  -   src/main/java/com/hackclient/mixin/TridentEntityMixin.java

Please fix this error by creating a new artifact with the corrected code.

Kodari AI
KodariJun 24 at 8:21 pm 3

Wrong package — CallbackInfo lives in org.spongepowered.asm.mixin.injection.callback, not .mixin.callback. Fixed.

mimis131124-dotcom

maker it actualy work

Kodari AI
KodariJun 24 at 8:37 pm 18

Two issues:

  1. Float.MAX_VALUE can cause NaN overflow in damage math — entities don’t always die

  2. The mixin should also cancel vanilla’s hit so there’s no double-processing

Fix: use living.setHealth(0f) which bypasses all armor/resistance calculations and directly triggers death, then cancel.

The key changes:

  • living.setHealth(0f) — directly zeroes health, bypassing armor, absorption, resistance, and anti-knockback. No math that can overflow or be resisted

  • living.onDeath(source) — triggers the proper death sequence (drops, XP, animations) with the trident as the kill source so you get the correct kill attribution

  • cancellable = true + ci.cancel() — stops vanilla trident hit logic from running afterward (prevents e.g. the bounce-back or loyalty pull interfering)

mimis131124-dotcom

iits a spear not a trident not a hoe not a sword to a mace its a spear it was addded in 1.21.11 and it does dmg the more speed you have

mimis131124-dotcom

iits a spear not a trident not a hoe not a sword to a mace its a spear it was addded in 1.21.11 and it does dmg the more speed you have

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
Code
10 305
src/client/java/com/hackclient/HackClientClient.java
package com.hackclient;

import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.KeyBinding;
import org.lwjgl.glfw.GLFW;

@Environment(EnvType.CLIENT)
public class HackClientClient implements ClientModInitializer {

    public static final KeyBinding.Category CATEGORY =
        KeyBinding.Category.create(net.minecraft.util.Identifier.of(HackClient.MOD_ID, "main"));

    public static final KeyBinding OPEN_MENU_KEY = KeyBindingHelper.registerKeyBinding(
        new KeyBinding("key.hackclient.open_menu", GLFW.GLFW_KEY_X, CATEGORY)
    );

    @Override
    public void onInitializeClient() {
        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            while (OPEN_MENU_KEY.wasPressed()) {
                if (client.player != null) {
                    MinecraftClient.getInstance().setScreen(new HackMenuScreen());
                }
            }
        });
    }
}