samuraidarkness_
📎 1 file 8,841 chars
📄
pasted-code-1783722356446.txt
txt 74 lines
▶
Act as an expert Minecraft Java developer specializing in high-performance Paper/Spigot plugin development. I need a custom weapons plugin built explicitly for Minecraft version 1.21.11 (Mounts of Mayhem update drop).

DEVELOPMENT STANDARD FOR KODARI AI:
- Target Version: Minecraft 1.21.11 / Paper API 1.21.11.
- Framework: Use fully unobfuscated Mojang runtime mappings. Account for GameRules being a native Vanilla registry with snake_case lookups.
- Item Base: Every single custom weapon listed below must be instantiated using Material.NETHERITE_SWORD as its base item type.
- Item Data: Utilize the strict 1.21.11 Data Component API natively (absolutely NO legacy NBT tags or old deprecated Material/Attribute methods). Apply Custom Model Data and weapon tags cleanly using PersistentDataContainer and modern Component APIs.

DYNAMIC CRAFTING & CONFIG REQUIREMENTS:
1. Every weapon must have a fully customizable shaped crafting recipe registered via config.yml.
2. In config.yml, use a clear matrix string format (e.g., Row 1: "AAA", Row 2: "ABA", Row 3: "ACA") with an ingredient character map (e.g., 'A' = NETHERITE_INGOT).
3. SINGLE-USE CRAFTING LIMIT: A player can only craft each specific custom weapon EXACTLY ONCE. Track this craft history per player using PersistentDataContainer on the player data or flatfile/YAML storage.
4. ADMIN RESET COMMAND: Implement an admin command `/resetcraft  ` (Permission: `customweapons.admin`) that clears the player's craft history for that weapon, letting them craft it again.

CONTROL SCHEME LAYOUT:
Each weapon has exactly 3 distinct active abilities and 1 clear hover lore layout. The abilities are bound to:
- Ability 1: Shift + Right-Click (30-second cooldown)
- Ability 2: Shift + Left-Click (30-second cooldown)
- Ability 3 [ULTIMATE]: Shift + Swap to Offhand Key (F by default) (60-second cooldown)

HOVER LORE REQUIREMENTS:
Every weapon must feature a highly styled, custom-colored hover lore layout using MiniMessage ( tags) that instantly displays upon mouse-over, closely mimicking the aesthetic seen on Altar SMP and Kings SMP. Each ability description should display its respective keybind triggers and current cooldown status.

WEAPON LINEUP SPECIFICATIONS:

1. Error Blade (Base: NETHERITE_SWORD, Custom Model Data: 1001)
   - Theme/Lore Visuals: Dark purple and magenta glitch effect formatting ( and ).
   - PASSIVE ABILITY (No Cooldown): "Glitch Critical" - Uses EntityDamageByEntityEvent (checking event.isCritical()). Tracks a per-player consecutive critical hit counter. Every 3rd critical hit landed automatically inflicts Withering, Nausea, and Poison on the target entity.
   - Ability 1 (Shift+RC): "Glitch Step" - Teleports the user 8 blocks forward. Inflicts Nausea and Blindness for 10 seconds on any entity passed through. [30s Cooldown]
   - Ability 2 (Shift+LC): "Data Corruption" - Hits a target and instantly scrambles their hotbar slots randomly. There is no status effect duration on this strike—it is an instantaneous, one-off execution. [30s Cooldown]
   - Ability 3 (Shift+Offhand): "Server Timeout" - Freezes all entities in place within a 5-block radius for 2.5 seconds (disabling movement and attacks). [60s Cooldown]

2. LifeSteal Blade (Base: NETHERITE_SWORD, Custom Model Data: 1002)
   - Theme/Lore Visuals: Dark crimson and blood red formatting ( and ).
   - PASSIVE LIFE STEAL RULE (No Cooldown): When a user kills another player using this specific sword, the target permanently loses 2 full hearts (4.0 generic max health attribute points) and the killer instantly gains those 2 full hearts added to their permanent max health.
   - Ability 1 (Shift+RC): "Siphon Strike" - Deals 3 hearts of raw, un-mitigatable damage to the target and restores 3 hearts to the user. [30s Cooldown]
   - Ability 2 (Shift+LC): "Heart Bleed" - Inflicts severe Wither on the target for 6 seconds. If the target dies while under this effect, the user permanently gains an additional 1 extra max heart (Capped at an overall plugin ceiling of 10 extra hearts; all bonus stats reset to default upon user death). [30s Cooldown]
   - Ability 3 (Shift+Offhand): "Blood Shield" - Consumes 2 hearts of the user's current health to instantly grant 4 hearts of Absorption and Resistance II for 10 seconds. [60s Cooldown]

3. Abyssal Anchor (Base: NETHERITE_SWORD, Custom Model Data: 1003)
   - Theme/Lore Visuals: Deep void blue and pitch black formatting ( and ).
   - Ability 1 (Shift+RC): "Void Pull" - Summons a gravitational vortex 10 blocks away, pulling all nearby players to its exact epicenter. [30s Cooldown]
   - Ability 2 (Shift+LC): "Density Crash" - Slams the ground, dealing heavy knockback and Slowness IV to nearby enemies for 4 seconds. [30s Cooldown]
   - Ability 3 (Shift+Offhand): "Pocket Dimension" - Sends the user into the void for 3 seconds, making them invisible, completely invincible, and unable to attack for a strategic escape. [60s Cooldown]

4. Solar Flare (Base: NETHERITE_SWORD, Custom Model Data: 1004)
   - Theme/Lore Visuals: Vivid fiery orange, gold, and red formatting (, , and ).
   - Ability 1 (Shift+RC): "Overheat" - Launches a rapid fireball projectile that detonates on impact, breaking player shields and applying AoE fire damage. [30s Cooldown]
   - Ability 2 (Shift+LC): "Combustion Trail" - Spawns a trail of fire blocks beneath the player for 5 seconds. Grants the user Speed II and ignites any enemy stepping on the trail. [30s Cooldown]
   - Ability 3 (Shift+Offhand): "Supernova" - Charges for 1 second, then radiates a high-damage fire blast around the user, launching them high into the air with complete immunity to the resulting fall damage. [60s Cooldown]

5. Monarch’s Crest (Base: NETHERITE_SWORD, Custom Model Data: 1005)
   - Theme/Lore Visuals: Royal yellow, gold, and clean white formatting (, , and ).
   - Ability 1 (Shift+RC): "Royal Decree" - Applies Weakness II and the Glowing effect to all enemies within an 8-block radius for 7 seconds. [30s Cooldown]
   - Ability 2 (Shift+LC): "King’s Gambit" - Forces the user's very next strike to deal double damage. If the user misses their attack window within 3 seconds, they suffer 2 hearts of self-inflicted backlash damage. [30s Cooldown]
   - Ability 3 (Shift+Offhand): "Sovereignty" - Spawns 2 aggressive spectral guards (custom-geared Zombies or Iron Golems) that fight alongside the user for 15 seconds before vanishing. [60s Cooldown]

6. Chrono Dagger (Base: NETHERITE_SWORD, Custom Model Data: 1006)
   - Theme/Lore Visuals: Futuristic cyan, light blue, and gray formatting (, , and ).
   - Ability 1 (Shift+RC): "Rewind" - Records the player's exact location and health. After 4 seconds, teleports them back to that saved state with the recorded health total. [30s Cooldown]
   - Ability 2 (Shift+LC): "Stasis Strike" - Strikes an enemy to trap them inside a temporal bubble for 3 seconds. The target becomes immune to outside damage but cannot move or access items. [30s Cooldown]
   - Ability 3 (Shift+Offhand): "Time Warp" - Instantly resets the active cooldown counters for Ability 1 and Ability 2 on this specific weapon. [60s Cooldown]

7. Dragon Blade (Base: NETHERITE_SWORD, Custom Model Data: 1007)
   - Theme/Lore Visuals: Mythic dark red, purple, and gold formatting (, , and ).
   - Ability 1 (Shift+RC): "Dragon Breath" - Shoots a localized cone of Ender Dragon breath (purple particle AoE cloud) forward 6 blocks, dealing continuous magic damage and applying Poison II to targets caught in it for 4 seconds. [30s Cooldown]
   - Ability 2 (Shift+LC): "Tail Whip" - Deals a 360-degree sweep attack pushing back all surrounding enemies within 4 blocks with heavy structural knockback. [30s Cooldown]
   - Ability 3 (Shift+Offhand): "Ender Flight" - Instantly grants the player the ability to glide (triggers elytra flight state natively) and manifests dragon particle trails under their feet for 6 seconds, giving them a fast aerial repositioning maneuver. [60s Cooldown]

TECHNICAL SPECIFICATIONS FOR GENERATION:
- Implement via PlayerInteractEvent, EntityDamageByEntityEvent, PlayerDeathEvent, CraftItemEvent (to intercept and cancel crafting if the player has reached their 1-time limit), and PlayerSwapHandItemsEvent.
- Verify that players are shifting (`player.isSneaking()`) before resolving active abilities.
- Include a robust cooldown mapping tracking player UUIDs and specific weapon abilities. 
- If an ability is on cooldown when a player tries to use it, intercept the event and display a remaining time countdown cleanly on their action bar using MiniMessage components.
Kodari AI
KodariJul 10 at 10:29 pm 17
CustomWeapons
A configurable Paper 1.21.11 custom weapons plugin that adds seven Netherite Sword weapons with unique passive effects, three cooldown-based abilities, styled MiniMessage lore, and dynamic shaped recipes. It enforces a one-time crafting limit per weapon, stores craft history on player data, provides an administrator reset command, and manages combat effects, health progression, temporary entities, movement control, projectiles, flight, stasis, and persistent weapon statistics with version-native APIs.
  1. Create the Gradle project and Paper plugin metadata.

  2. Add weapon definitions, item/component creation, cooldowns, and craft-history management.

  3. Implement all seven weapons, passive effects, ability bindings, combat state, and cleanup.

  4. Add the reset command and fully configurable recipes/lore settings.

A Paper 1.21.11 custom weapons plugin that adds seven Netherite Sword-based weapons with configurable shaped recipes, styled MiniMessage lore, one-time player crafting limits, administrator craft resets, cooldown-driven keybind abilities, passive combat effects, temporary entities and status states, persistent LifeSteal health progression, and configurable combat interactions. It supports Error Blade, LifeSteal Blade, Abyssal Anchor, Solar Flare, Monarch’s Crest, Chrono Dagger, and Dragon Blade with dedicated active abilities, ultimates, and cleanup handling.

Created CustomWeapons, a Paper 1.21.11 plugin with:

  • Seven configurable Netherite Sword weapons

  • MiniMessage-styled lore and native custom model data components

  • Configurable shaped recipes

  • One-time crafting limits with /resetcraft

  • Cooldown-based ability controls

  • Passive combat effects

  • LifeSteal health progression

  • Temporary freezing, stasis, guards, fire trails, flight, and combat states

  • Persistent player data and cleanup handling

samuraidarkness_

add a custom command to view and get the weapons to view the command is /weapons view it will show all weapons in a chest INVENTORY GUI and to get the weapons we will need to do /weapons give [player name

Kodari AI
KodariJul 10 at 11:43 pm 2
  1. Add /weapons view with a chest GUI listing every weapon.

  2. Add /weapons give <player> with weapon selection and admin permission handling.

  3. Register the command and GUI interaction without affecting existing crafting or ability logic.

[Generation stopped]

samuraidarkness_

add a custom command to view and get the weapons to view the command is /weapons view it will show all weapons in a chest INVENTORY GUI and to get the weapons we will need to do /weapons give [player name] [weapon name]

Kodari AI
KodariJul 10 at 11:44 pm 13
  1. Inspect the existing weapon registry, item factory, plugin entrypoint, and command metadata.

  2. Add /weapons view with a chest GUI containing every weapon.

  3. Add /weapons give <player> <weapon> with permission checks and weapon-name parsing.

  4. Register the command and GUI click handling without changing crafting or ability behavior.

The command is registered as a public viewing command, while /weapons give is restricted to customweapons.admin; the GUI is read-only and displays all seven configured weapon items.

Implemented:

  • /weapons view

    • Opens a 9-slot chest GUI.

    • Displays all configured weapons.

    • Prevents item movement or taking items from the menu.

  • /weapons give <player> <weapon>

    • Gives the selected custom weapon to an online player.

    • Requires customweapons.admin.

    • Supports weapon IDs such as:

      • error_blade

      • lifesteal_blade

      • abyssal_anchor

      • solar_flare

      • monarchs_crest

      • chrono_dagger

      • dragon_blade

  • Added tab completion for subcommands, online players, and weapon IDs.

  • Registered the command and GUI listener in the plugin startup.

  • Updated plugin.yml command registration.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
14 1,402
src/main/java/com/kodari/customweapons/CustomWeaponsPlugin.java
package com.kodari.customweapons;

import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.RecipeChoice;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.EnumMap;
import java.util.Map;

public class CustomWeaponsPlugin extends JavaPlugin {
    private final Map<WeaponType, WeaponDefinition> definitions = new EnumMap<>(WeaponType.class);
    private WeaponItemFactory itemFactory;
    private CooldownManager cooldownManager;
    private PlayerStateManager playerStateManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        loadDefinitions();

        itemFactory = new WeaponItemFactory(this, definitions);
        cooldownManager = new CooldownManager();
        playerStateManager = new PlayerStateManager(this);

        registerRecipes();
        getServer().getPluginManager().registerEvents(
                new WeaponListener(this, itemFactory, cooldownManager, playerStateManager),
                this
        );

        if (getCommand("resetcraft") != null) {
            getCommand("resetcraft").setExecutor(new ResetCraftCommand(playerStateManager));
        }
        if (getCommand("resetcraft") != null) {
            getCommand("resetcraft").setExecutor(new ResetCraftCommand(playerStateManager));
        }
        if (getCommand("resetcraft") != null) {
            getCommand("resetcraft").setExecutor(new ResetCraftCommand(playerStateManager));
        }
        if (getCommand("weapons") != null) {
            WeaponsCommand weaponsCommand = new WeaponsCommand(this, definitions, itemFactory);
            getCommand("weapons").setExecutor(weaponsCommand);
            getCommand("weapons").setTabCompleter(weaponsCommand);
            getServer().getPluginManager().registerEvents(weaponsCommand, this);
        }
    }

    @Override
    public void onDisable() {
        if (playerStateManager != null) {
            playerStateManager.save();
        }
    }

    private void loadDefinitions() {
        for (WeaponType type : WeaponType.values()) {
            String path = "weapons." + type.id();
            definitions.put(type, new WeaponDefinition(
                    type,
                    getConfig().getString(path + ".display-name", "<white>" + type.id()),
                    getConfig().getInt(path + ".model-data", 1000),
                    getConfig().getStringList(path + ".lore")
            ));
        }
    }

    private void registerRecipes() {
        for (WeaponType type : WeaponType.values()) {
            String path = "weapons." + type.id() + ".recipe";
            ConfigurationSection section = getConfig().getConfigurationSection(path);
            if (section == null) {
                continue;
            }

            ItemStack result = itemFactory.create(type);
            ShapedRecipe recipe = new ShapedRecipe(new NamespacedKey(this, "craft_" + type.id()), result);
            recipe.shape(section.getStringList("shape").toArray(new String[0]));

            ConfigurationSection ingredients = section.getConfigurationSection("ingredients");
            if (ingredients == null) {
                continue;
            }

            for (String key : ingredients.getKeys(false)) {
                Material material = Material.matchMaterial(ingredients.getString(key, ""));
                if (material == null || key.length() != 1) {
                    throw new IllegalArgumentException("Invalid ingredient for " + type.id() + ": " + key);
                }
                recipe.setIngredient(key.charAt(0), new RecipeChoice.MaterialChoice(material));
            }
            getServer().addRecipe(recipe);
        }
    }
}