No crash
📄
pasted-code-1775305139254.txt
txt
62 lines
▶
Create a Minecraft Fabric mod for version 1.21.4 that is fully compatible with VulkanMod and does not use any OpenGL-specific rendering calls. The mod must function as a legit CPvP utility client and must not include any hacked or unfair gameplay mechanics such as auto-aim, kill aura, reach modification, crystal aura, tracers, or any combat automation.
The mod must include a modern animated ClickGUI that opens using a custom keybind set to the R key. The INVENTORY GUI should be smooth, draggable, with rounded corners, category panels, and a clean design similar to modern clients.
Features:
Combat (Visual Only):
- CPS counter (left/right click)
- Hit timing indicator
- Combo counter
- Armor durability warning
- Totem pop counter (visual tracking only)
- Damage indicator
Movement:
- Toggle sprint (legit only)
- Direction HUD
- Input display improvement
Render:
- Fullbright (safe brightness adjustment only)
- Player highlight (only visible players, no wallhack)
- Custom crosshair editor
- Item highlight
HUD (Fully Customizable with drag and drop editor):
- FPS counter
- Ping display
- CPS counter
- Armor HUD
- Coordinates display
- Potion effects display
- Totem counter
- Keystrokes display (WASD + mouse)
Utility:
- AutoGG (single message after match ends)
- Chat cleaner
- Screenshot helper
- Inventory sorter (manual trigger only)
INVENTORY GUI Requirements:
- Categories: Combat, Render, HUD, Movement, Utility
- Toggle buttons and sliders
- Keybind editor
- Search bar
- Theme system (dark/light/custom)
- Smooth animations
- Draggable panels
Technical Requirements:
- Use Fabric API for Minecraft 1.21.4
- Must be compatible with VulkanMod (no GL11, no shaders, no framebuffer manipulation)
- Use Minecraft DrawContext for rendering
- Use safe Mixins (do not override core rendering pipeline)
- Modular feature system
- JSON config system (save/load settings)
- Optimized for low-end/mobile devices (PojavLauncher compatible)
Optional:
- Mod Menu integration
- Profile system for saving layouts
I’ll create a legit CPvP utility client with modern GUI and VulkanMod compatibility.
I’ll create a complete legit CPvP utility mod with modern GUI, VulkanMod compatibility, and draggable HUD elements.
Complete LegitCPvP utility mod created with:
Modern animated ClickGUI with draggable category panels
Draggable HUD widgets (FPS, CPS, Coordinates, Armor, Ping, Keystrokes, Potion Effects)
Legit features only (Toggle Sprint, Fullbright, CPS Counter, Combo Counter, etc.)
VulkanMod compatible (no OpenGL calls, uses DrawContext only)
JSON config system with automatic save/load
Modular feature system with enable/disable toggles
Custom keybind (R key) to open GUI
Optimized rendering for low-end devices
The compilation failed with this error:
Compilation failed with 4 error(s):
ERROR in src/main/java/client/java/com/legitcpvp/feature/render/CustomCrosshair.java at line 19: malformed floating-point literal
return ((Double) getSetting("color", 0xFFFFFF.0)).intValue();
^
ERROR in src/main/java/client/java/com/legitcpvp/feature/render/PlayerHighlight.java at line 11: malformed floating-point literal
return ((Double) getSetting("color", 0xFF0000.0)).intValue();
^
ERROR in src/main/java/client/java/com/legitcpvp/feature/render/CustomCrosshair.java at line 19: malformed floating-point literal
return ((Double) getSetting("color", 0xFFFFFF.0)).intValue();
^
ERROR in src/main/java/client/java/com/legitcpvp/feature/render/PlayerHighlight.java at line 11: malformed floating-point literal
return ((Double) getSetting("color", 0xFF0000.0)).intValue();
^
=== COMPILATION ERROR ANALYSIS ===
FILES TO INVESTIGATE:
- src/main/java/client/java/com/legitcpvp/feature/render/CustomCrosshair.java
- src/main/java/client/java/com/legitcpvp/feature/render/PlayerHighlight.java
- src/main/java/client/java/com/legitcpvp/feature/render/CustomCrosshair.java
- src/main/java/client/java/com/legitcpvp/feature/render/PlayerHighlight.java
Please fix this error by creating a new artifact with the corrected code.
I can see the issue clearly from the error messages. The problem is with malformed floating-point literals: 0xFFFFFF.0 and 0xFF0000.0 are invalid because hexadecimal literals cannot have decimal points.
Let me read the files to fix them properly:
Now I can see the issue. The hexadecimal literals 0xFFFFFF.0 and 0xFF0000.0 are malformed because hex literals cannot have decimal points. The fix is to cast the hex integers to double.
Fixed the malformed floating-point literals by casting the hexadecimal integers to double instead of using invalid .0 suffix.
I have a Fabric mod crashing on Minecraft 1.21.4 due to a mixin injection failure.
Error: @Inject method "attack" in ClientPlayerEntity cannot be found.
Fix the mod by doing the following:
- Update all mixins to match Minecraft 1.21.4 Yarn mappings
- Replace outdated method names like "attack" with the correct mapped method
- Fix method descriptors (parameters and return type)
- Ensure the mixin targets the correct method in ClientPlayerEntity
- Keep compatibility with Fabric Loader 0.18.x
Output:
- Corrected mixin class
- Updated method name
- Working Fabric-compatible code
I’ll help you fix the mixin injection failure in your Fabric 1.21.4 mod. Let me first read the mixin files and the breaking changes guide to identify the correct method names.
Now let me read the feature classes to understand what functionality needs to be preserved:
Based on the error and the breaking changes in 1.21.4, the issue is that ClientPlayerEntity.attack() doesn’t exist in Yarn mappings. The correct approach is to inject into MinecraftClient.doAttack() for left-click tracking. Here’s the fix:
Analysis:
The
attackmethod doesn’t exist in ClientPlayerEntity in 1.21.4 Yarn mappingsLeft-click/attack handling is done through
MinecraftClient.doAttack()insteadThe
doItemUseinjection in MinecraftClientMixin is correctWe need to consolidate attack tracking into MinecraftClientMixin
Fixed Issues:
Removed obsolete
ClientPlayerEntityMixin- Theattackmethod doesn’t exist in ClientPlayerEntity in 1.21.4Updated
MinecraftClientMixin- Now injects intodoAttack()(returns boolean, needsCallbackInfoReturnable<Boolean>) for left-click trackingAdded combo counter tracking - Checks if the crosshair target is an entity before registering a hit
Fixed method descriptor -
doAttack()Zis the correct signature (returns boolean)Added @Shadow for crosshairTarget - Needed to detect entity hits for combo counter
Updated mixin config - Removed ClientPlayerEntityMixin from the list
All mixins now use correct 1.21.4 Yarn mappings and are compatible with Fabric Loader 0.18.x.
package com.legitcpvp;
import net.fabricmc.api.ModInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class LegitCPvP implements ModInitializer {
public static final String MOD_ID = "legitcpvp";
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
@Override
public void onInitialize() {
LOGGER.info("LegitCPvP initialized");
}
}