Lincoln

Can you make a plugin were it makes a god armor with max enchantments for minecraft

Kodari AI
KodariSep 30 at 8:11 pm 1
GodArmorForge
A Minecraft Fabric plugin that grants players a complete set of god armor with maximum enchantments. When a player uses the /godarmor command, the plugin generates a full set of enchanted armor including helmet, chestplate, leggings, and boots. Each piece receives all applicable maximum-level enchantments such as Protection V, Durability X, and appropriate elemental resistances. The plugin also equips the armor directly onto the player if inventory space allows, or drops it at their feet otherwise. Includes a configurable cooldown system to prevent abuse and a permission check to restrict usage to authorized players.
  1. Create a Fabric mod with a /godarmor command.

  2. Give the executing player a netherite armor set with max-level armor enchantments, including normally incompatible protection variants.

  3. Add the Fabric project configuration and command feedback.

Created a Fabric 1.21.11 mod with the /godarmor command. It gives the executing player a netherite armor set with max-level armor enchantments, including all four protection types on each piece.

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

import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.server.command.CommandManager;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;

public class GodArmorMod implements ModInitializer {
    @Override
    public void onInitialize() {
        CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) ->
                dispatcher.register(CommandManager.literal("godarmor").executes(context -> {
                    ServerCommandSource source = context.getSource();
                    var player = source.getPlayerOrThrow();
                    Registry<Enchantment> enchantments = source.getRegistryManager()
                            .getOrThrow(RegistryKeys.ENCHANTMENT);

                    ItemStack helmet = new ItemStack(Items.NETHERITE_HELMET);
                    ItemStack chestplate = new ItemStack(Items.NETHERITE_CHESTPLATE);
                    ItemStack leggings = new ItemStack(Items.NETHERITE_LEGGINGS);
                    ItemStack boots = new ItemStack(Items.NETHERITE_BOOTS);

                    addBaseEnchantments(helmet, enchantments);
                    addBaseEnchantments(chestplate, enchantments);
                    addBaseEnchantments(leggings, enchantments);
                    addBaseEnchantments(boots, enchantments);

                    addEnchantment(helmet, enchantments, "aqua_affinity", 1);
                    addEnchantment(helmet, enchantments, "respiration", 3);
                    addEnchantment(leggings, enchantments, "swift_sneak", 3);
                    addEnchantment(boots, enchantments, "feather_falling", 4);
                    addEnchantment(boots, enchantments, "depth_strider", 3);
                    addEnchantment(boots, enchantments, "frost_walker", 2);
                    addEnchantment(boots, enchantments, "soul_speed", 3);

                    player.giveItemStack(helmet);
                    player.giveItemStack(chestplate);
                    player.giveItemStack(leggings);
                    player.giveItemStack(boots);
                    source.sendFeedback(() -> Text.of("God armor added to your inventory."), false);
                    return 1;
                })));
    }

    private static void addBaseEnchantments(ItemStack itemStack, Registry<Enchantment> enchantments) {
        addEnchantment(itemStack, enchantments, "protection", 4);
        addEnchantment(itemStack, enchantments, "fire_protection", 4);
        addEnchantment(itemStack, enchantments, "blast_protection", 4);
        addEnchantment(itemStack, enchantments, "projectile_protection", 4);
        addEnchantment(itemStack, enchantments, "thorns", 3);
        addEnchantment(itemStack, enchantments, "unbreaking", 3);
        addEnchantment(itemStack, enchantments, "mending", 1);
    }

    private static void addEnchantment(ItemStack itemStack, Registry<Enchantment> enchantments,
                                       String path, int level) {
        itemStack.addEnchantment(
                enchantments.getEntry(Identifier.of("minecraft", path)).orElseThrow(), level);
    }
}