Brayden Adamack

Create a Minecraft Java Edition 1.21.1 Fabric mod that reproduces the relevant abilities of Rolfmao's Upgraded Netherite Creative armor.

The mod must recognize a complete four-piece armor set consisting of Netherite armor with these exact custom names and trims:

Helmet: "Creativerite Helmet", Wayfinder trim, Amethyst material.

Chestplate: "Creativerite Chestplate", Snout trim, Amethyst material.

Leggings: "Creativerite Leggings", Ward trim, Amethyst material.

Boots: "Creativerite Boots", Snout trim, Amethyst material.

Only activate the set abilities when all four pieces match their required names and trim patterns and materials.

When the complete set is equipped, enable player flight and prevent ordinary damage. When any piece is removed or no longer matches, disable the abilities granted by this mod without permanently changing the player's normal settings.

Target Minecraft 1.21.1 and Fabric API. Build the project and provide a compiled, installable .jar, not just source code. Do not add replacement armor items; detect the existing armor.

Kodari AI
KodariOct 14 at 9:37 pm 1
CreativeriteArmorSet
Detects a complete four-piece Netherite armor set with specific custom names, trims, and amethyst materials. When all pieces match, enables player flight and prevents all damage. Automatically disables abilities when any piece is removed or mismatched without permanently altering player settings. Built for Minecraft 1.21.1 with Fabric API, providing a compiled installable jar.
  1. Create the Fabric 1.21.1 project files and mod entry point.

  2. Match all four exact Netherite armor pieces, custom names, and trim data.

  3. Grant and restore flight safely, and cancel damage only while the full set matches.

Created the Fabric 1.21.1 mod. It recognizes only the specified Netherite pieces with their exact names, trim patterns, and Amethyst trim material. The full set grants flight and damage immunity; removing or changing a piece restores the player’s previous flight settings.

To build and download the installable jar in Kodari:

  1. Click Compile in the top bar (on phone: ⋮ → Compile Project).

  2. Click Compile in the window that opens.

  3. When it succeeds, click Download on the build or Download creativerite.jar in the chat.

Install the jar on a Fabric 1.21.1 server with Fabric API.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
5 188
src/main/java/com/kodari/creativerite/CreativeriteMod.java
package com.kodari.creativerite;

import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.entity.event.v1.ServerLivingEntityEvents;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents;
import net.minecraft.component.DataComponentTypes;
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.item.trim.ArmorTrim;
import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.Identifier;
import net.minecraft.registry.RegistryKey;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

public class CreativeriteMod implements ModInitializer {
    private static final Map<UUID, FlightState> ACTIVE_PLAYERS = new HashMap<>();

    private static final Identifier AMETHYST = Identifier.of("minecraft", "amethyst");
    private static final Identifier WAYFINDER = Identifier.of("minecraft", "wayfinder");
    private static final Identifier SNOUT = Identifier.of("minecraft", "snout");
    private static final Identifier WARD = Identifier.of("minecraft", "ward");

    @Override
    public void onInitialize() {
        ServerTickEvents.END_SERVER_TICK.register(server -> {
            for (ServerPlayerEntity player : server.getPlayerManager().getPlayerList()) {
                if (hasCompleteSet(player)) {
                    enableAbilities(player);
                } else {
                    restoreAbilities(player);
                }
            }
        });

        ServerLivingEntityEvents.ALLOW_DAMAGE.register((entity, source, amount) ->
                !(entity instanceof PlayerEntity player && hasCompleteSet(player)));

        ServerPlayConnectionEvents.DISCONNECT.register((handler, server) -> restoreAbilities(handler.player));
    }

    private static boolean hasCompleteSet(PlayerEntity player) {
        return matchesPiece(player.getEquippedStack(EquipmentSlot.HEAD), Items.NETHERITE_HELMET,
                        "Creativerite Helmet", WAYFINDER)
                && matchesPiece(player.getEquippedStack(EquipmentSlot.CHEST), Items.NETHERITE_CHESTPLATE,
                        "Creativerite Chestplate", SNOUT)
                && matchesPiece(player.getEquippedStack(EquipmentSlot.LEGS), Items.NETHERITE_LEGGINGS,
                        "Creativerite Leggings", WARD)
                && matchesPiece(player.getEquippedStack(EquipmentSlot.FEET), Items.NETHERITE_BOOTS,
                        "Creativerite Boots", SNOUT);
    }

    private static boolean matchesPiece(ItemStack stack, Item expectedItem, String expectedName,
                                        Identifier expectedPattern) {
        if (!stack.isOf(expectedItem)) {
            return false;
        }

        var customName = stack.get(DataComponentTypes.CUSTOM_NAME);
        if (customName == null || !customName.getString().equals(expectedName)) {
            return false;
        }

        ArmorTrim trim = stack.get(DataComponentTypes.TRIM);
        return trim != null
                && entryHasId(trim.pattern(), expectedPattern)
                && entryHasId(trim.material(), AMETHYST);
    }

    private static boolean entryHasId(RegistryEntry<?> entry, Identifier expectedId) {
        return entry.getKey().map(RegistryKey::getValue).filter(expectedId::equals).isPresent();
    }

    private static void enableAbilities(ServerPlayerEntity player) {
        UUID playerId = player.getUuid();
        var abilities = player.getAbilities();
        FlightState originalState = ACTIVE_PLAYERS.get(playerId);

        if (originalState == null) {
            ACTIVE_PLAYERS.put(playerId, new FlightState(abilities.allowFlying, abilities.flying));
            abilities.allowFlying = true;
            abilities.flying = true;
            player.sendAbilitiesUpdate();
        } else if (!abilities.allowFlying) {
            abilities.allowFlying = true;
            player.sendAbilitiesUpdate();
        }
    }

    private static void restoreAbilities(ServerPlayerEntity player) {
        FlightState originalState = ACTIVE_PLAYERS.remove(player.getUuid());
        if (originalState == null) {
            return;
        }

        var abilities = player.getAbilities();
        abilities.allowFlying = originalState.allowFlying();
        abilities.flying = originalState.flying();
        player.sendAbilitiesUpdate();
    }

    private record FlightState(boolean allowFlying, boolean flying) {
    }
}