SmartCrosshair

Codexe Enginev1.0

Create a lightweight, client-side Fabric mod for Minecraft 26.3 named **SmartCrosshair**. Use the Minecraft 26.3-compatible Fabric Loader, Fabric API, and Java toolchain. The mod must work entirely on the client: do not add server-side requirements, networking, commands, permissions, configuration files, or external integrations. ### Crosshair behavior - Replace the vanilla crosshair with a crisp, centered neon-green plus sign. - Change it to bright red when the player’s current crosshair target is a living entity that is a mob or another player and is within 3.0 blocks of melee reach. - Keep it neon green when targeting blocks, non-living entities, no target, or a living entity outside that range. Do not change vanilla attack reach or targeting behavior. - Use the game’s normal crosshair targeting result so the indicator matches what the player is actually aiming at. Calculate distance from the player’s eye position to the targeted entity’s bounding box (minimum distance to the box), rather than to its center. - Update the color immediately as the target changes. Handle null player/world state, first-person rendering, and world transitions safely; avoid stale red state. - Respect the normal HUD visibility and crosshair visibility rules, including hiding the crosshair when the game hides the HUD or the player is in a mode where vanilla would not show it. ### Rendering - Render a symmetrical plus sign using clean, integer-aligned rectangles or vertices, with no texture dependency, blur, or unnecessary allocations per frame. - Make the arm lengths, thickness, center gap, green color, and red color straightforward constants in a dedicated renderer class. Use a subtle dark outline or shadow for readability while preserving the crisp neon appearance. - Avoid duplicate vanilla crosshairs by canceling or replacing the vanilla crosshair render at the appropriate Fabric rendering hook for Minecraft 26.3. - Preserve other HUD elements and rendering state: restore any modified shader, blend, depth, or color state after drawing. ### Architecture and deliverables Use a clear minimal structure, for example: - `SmartCrosshairClient` — client initializer and render-hook registration. - `SmartCrosshairRenderer` — visibility checks, target classification, distance evaluation, and drawing. - `fabric.mod.json` — client-only mod metadata and entrypoint. - Gradle build files and any required resources. Provide complete, buildable source code with no placeholder methods. Keep the implementation lightweight, avoid tick polling if target state can be evaluated safely at render time, and document any Minecraft 26.3-specific Fabric rendering API assumptions in code comments. Include concise build and installation instructions for a Fabric client.

5 views0 upvotes

The code of this project is kept private by its owner.

You can see its files on the left. Want something like it? Describe it to Codexe and try it on a free test server.

Make one with Codexe