Sasky

i need this mod for java 1.21.11 compatible with fabric 0.18.3 , create a mod that gives a red circle above your crosshair when you're above a player by 1.5 to 5 blocks but only if you have an elytra equipped, also, give a sound like a light notblock sound when i equip any chestplate, i need to hear it clearly

Kodari AI
KodariNov 14 at 8:23 pm 2
ElytraTargetingRadar
Client-side Fabric mod for Minecraft 1.21.11 that renders a red circle above the crosshair when the player is flying with an elytra equipped and is positioned 1.5 to 5 blocks above another player. Also plays a distinct, clearly audible note block sound whenever any chestplate is equipped, providing immediate audio feedback for armor changes.
  • Configure a Fabric 1.21.11 client-only mod targeting Loader 0.18.3.

  • Show a red marker only while the crosshair targets a player 1.5–5 blocks below and an elytra is equipped.

  • Play a clear note-block chime when a chestplate is equipped.

Created the client-side Fabric mod for Minecraft 1.21.11, targeting Fabric Loader 0.18.3. It shows a red circle above the crosshair when you’re wearing an elytra and aiming at a player 1.5–5 blocks below, and plays a clear note-block chime when you equip a chestplate.

Switch to Fabric mod for Minecraft 1.21.11

Sasky

okay so, i need the circle to be bigger and that is visible from 1.5 to 8 blocks, and also i need you to make understandable even if im swapping chestplate in milliseconds that i have chestplate equipped or no

Kodari AI
KodariNov 14 at 8:37 pm 2
  1. Increase the marker size and extend its vertical range to 1.5–8 blocks.

  2. Give chestplate equip and removal distinct, clearly audible feedback that still works during rapid swaps.

Updated the mod: the red marker is larger and appears when the targeted player is 1.5–8 blocks below you, while you’re wearing an elytra. Chestplate changes now give distinct sounds—bright chime when equipped, low note when removed—and show an 1.8-second status message so rapid swaps are easier to track.

Switch to Fabric mod for Minecraft 1.21.11

Sasky

i like the mod, but i dont like the chestplate sound, so i would remove it completely and just keep the elytra's

Kodari AI
KodariNov 14 at 9:58 pm 1

I’ll remove the chestplate sounds and the temporary chestplate status display, leaving the elytra-only marker unchanged.

[Generation stopped]

Sasky

wait, dont remove the texts, only remove the chestplate sound we added

Kodari AI
KodariNov 14 at 9:59 pm 1

Removed the chestplate sounds only. The “CHESTPLATE EQUIPPED” / “NO CHESTPLATE” status text remains.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
5 173
src/client/java/com/kodari/elytraindicator/ElytraIndicatorClient.java
package com.kodari.elytraindicator;

import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.rendering.v1.hud.HudElementRegistry;
import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.util.Identifier;
import net.minecraft.util.hit.EntityHitResult;

public final class ElytraIndicatorClient implements ClientModInitializer {
    private static final String MOD_ID = "elytra_indicator";
    private static boolean chestSlotTracked;
    private static boolean lastChestplateEquipped;
    private static long chestStatusUntil;
    private static boolean showIndicator;
    private static MinecraftClient client;

    @Override
    public void onInitializeClient() {
        ClientTickEvents.END_CLIENT_TICK.register(minecraftClient -> {
            client = minecraftClient;

            if (minecraftClient.player == null) {
                chestSlotTracked = false;
                lastChestplateEquipped = false;
                chestStatusUntil = 0;
                showIndicator = false;
                return;
            }

            ItemStack chestStack = minecraftClient.player.getEquippedStack(EquipmentSlot.CHEST);
            Item chestItem = chestStack.getItem();
            boolean hasChestplate = chestItem != Items.AIR && !chestStack.isOf(Items.ELYTRA);

            if (chestSlotTracked
                    && hasChestplate != lastChestplateEquipped) {
                chestStatusUntil = System.currentTimeMillis() + 1800L;
            }

            lastChestplateEquipped = hasChestplate;
            chestSlotTracked = true;
            showIndicator = shouldShowIndicator(minecraftClient, chestStack);
        });

        HudElementRegistry.addLast(Identifier.of(MOD_ID, "player_indicator"), (context, tickCounter) -> {
            if (!showIndicator || client == null) {
                return;
            }

            int centerX = context.getScaledWindowWidth() / 2;
            int top = context.getScaledWindowHeight() / 2 - 21;
            int color = 0xFFFF2020;
            context.fill(centerX - 4, top, centerX + 4, top + 3, color);
            context.fill(centerX - 6, top + 3, centerX + 6, top + 6, color);
            context.fill(centerX - 7, top + 6, centerX + 7, top + 9, color);
            context.fill(centerX - 6, top + 9, centerX + 6, top + 12, color);
            context.fill(centerX - 4, top + 12, centerX + 4, top + 15, color);
        });

        HudElementRegistry.addLast(Identifier.of(MOD_ID, "chestplate_status"), (context, tickCounter) -> {
            if (client == null || System.currentTimeMillis() >= chestStatusUntil) {
                return;
            }

            String status = lastChestplateEquipped ? "CHESTPLATE EQUIPPED" : "NO CHESTPLATE";
            int x = (context.getScaledWindowWidth() - client.textRenderer.getWidth(status)) / 2;
            int y = context.getScaledWindowHeight() / 2 + 12;
            int color = lastChestplateEquipped ? 0xFF55FF55 : 0xFFFF5555;
            context.drawText(client.textRenderer, status, x, y, color, true);
        });
    }

    private static boolean shouldShowIndicator(MinecraftClient client, ItemStack chestStack) {
        if (!chestStack.isOf(Items.ELYTRA)
                || !(client.crosshairTarget instanceof EntityHitResult hit)
                || !(hit.getEntity() instanceof PlayerEntity target)
                || target == client.player) {
            return false;
        }

        double heightDifference = client.player.getY() - target.getY();
        return heightDifference >= 1.5 && heightDifference <= 8.0;
    }
}