blazeofpower
📎 1 file 3,393 chars
📄
pasted-code-1782569015950.txt
txt 150 lines
▶
Create a Minecraft Java 1.21.1 Paper plugin (not a datapack) with the following features. The code should be clean, optimized, configurable, and use the Paper API.

Custom Weapons
1. PicMace
A custom weapon that combines a Pickaxe and a Mace.
Uses the mace attack mechanics, including:
Fall damage bonus.
Smash attack.
All vanilla mace properties.
Can mine blocks like a pickaxe.
Can only receive enchantments that a normal mace can receive.
Display Name: PicMace
Give it a custom model data value for resource pack support.
2. Flame Sword
Display Name: Flame Sword
Every successful hit on a mob or player gives the wielder:
Strength III
Duration: 30 seconds
Refreshes the timer on every hit.
Give it a custom model data value for resource pack support.
Random Crafting Recipes

Neither weapon should have a fixed recipe.

Instead:

Every server startup generates a new random shaped crafting recipe for each weapon.
Recipes should only use reasonable vanilla items.
Save the generated recipes in a config file so they remain the same until the next regeneration.
Add an admin command:

/weaponrecipes regenerate

This creates new random recipes.

Players can view the recipes using:

/weaponrecipes

Crafting Ritual

When a player successfully crafts either custom weapon:

The weapon is NOT immediately given.
Instead:
The crafted item disappears from the crafting table.
A 5-minute ritual begins.

During the ritual:

The player must stay within 5 blocks of the crafting location.
If they move too far:
The ritual is cancelled.
The ingredients are lost.
If they die:
Ritual is cancelled.
If they disconnect:
Ritual is cancelled.
Global Announcement

As soon as the ritual begins:

Broadcast to every online player:

" is forging a legendary weapon!"

Every 30 seconds, broadcast:

Player name
Current XYZ coordinates
Time remaining

Example:

Steve is forging a legendary weapon!
Coordinates: X: 124 Y: 68 Z: -352
Time Remaining: 3:30

Ritual Effects

While waiting:

Flame particles
Smoke particles
Lightning particles (visual only)
End rod particles
Sounds every few seconds
Action bar countdown
Boss bar showing progress

The player cannot:

Drop items
Open containers
Start another ritual
Completion

After exactly 5 minutes:

Play a large particle effect.
Strike visual lightning.
Play the Ender Dragon death sound.
Give the player the crafted weapon.
Broadcast:

" has successfully forged a legendary weapon!"

Configuration

Create a config.yml allowing customization of:

Ritual duration
Broadcast interval
Allowed movement radius
Potion effect strength
Potion effect duration
Messages
Sounds
Particles
Boss bar color
Boss bar title
Commands

/weaponrecipes

Shows the current random recipes.

/weaponrecipes regenerate

Regenerates recipes (requires permission).

/ritual cancel

Cancels your ritual.
Permissions
legendaryweapons.admin
legendaryweapons.viewrecipes
Technical Requirements
Minecraft 1.21.1
Paper API
Maven project
Java 21
Proper package structure
No deprecated API usage
Async tasks where appropriate
Fully commented code
No memory leaks
Plugin should compile without errors.

The final result should feel like a polished, production-quality Paper plugin with balanced gameplay and smooth performance.
Kodari AI
KodariJun 27 at 2:06 pm 1
LegendaryWeapons
A Paper plugin for Minecraft 1.21.1 featuring two legendary craftable weapons: PicMace (pickaxe-mace hybrid) and Flame Sword (applies Strength on hit). Each server start generates random shaped recipes visible via /weaponrecipes. Crafting initiates a 5-minute forging ritual with particle effects, boss bar, broadcasts, and movement constraints. Fully configurable via config.yml with Paper API and MiniMessage.

I’ll create this 15-file plugin. Starting with build files, resources, then Java sources bottom-up.

[Generation stopped]

blazeofpower

continue

Kodari AI
KodariJun 27 at 2:10 pm 2
LegendaryWeapons
A Paper plugin for Minecraft 1.21.1 adding two legendary craftable weapons: PicMace (pickaxe-mace hybrid) and Flame Sword (applies Strength III on hit). Each server restart generates random shaped recipes viewable via /weaponrecipes. Crafting triggers a 5-minute forging ritual with particles, boss bar, action bar, broadcasts, and movement/death/disconnect cancellation. Fully configurable with MiniMessage, Maven build, Java 21.
Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
14 1,736
src/main/java/com/legendaryweapons/LegendaryWeapons.java
package com.legendaryweapons;

import com.legendaryweapons.command.RitualCommand;
import com.legendaryweapons.command.WeaponRecipesCommand;
import com.legendaryweapons.config.ConfigManager;
import com.legendaryweapons.listener.CraftListener;
import com.legendaryweapons.listener.RitualListener;
import com.legendaryweapons.listener.WeaponListener;
import com.legendaryweapons.manager.RecipeManager;
import com.legendaryweapons.manager.RitualManager;
import org.bukkit.plugin.java.JavaPlugin;

/**
 * Main plugin class for LegendaryWeapons.
 * Initializes configuration, recipe generation, ritual management,
 * and registers all event listeners and commands.
 */
public final class LegendaryWeapons extends JavaPlugin {

    private ConfigManager configManager;
    private RecipeManager recipeManager;
    private RitualManager ritualManager;

    @Override
    public void onEnable() {
        // Initialize configuration
        configManager = new ConfigManager(this);
        configManager.loadConfig();

        // Initialize managers
        recipeManager = new RecipeManager(this, configManager);
        recipeManager.initialize();

        ritualManager = new RitualManager(this, configManager);

        // Register event listeners
        getServer().getPluginManager().registerEvents(
                new CraftListener(this, configManager, recipeManager, ritualManager), this);
        getServer().getPluginManager().registerEvents(
                new WeaponListener(configManager, recipeManager), this);
        getServer().getPluginManager().registerEvents(
                new RitualListener(configManager, ritualManager), this);

        // Register commands
        WeaponRecipesCommand weaponRecipesCommand = new WeaponRecipesCommand(this, configManager, recipeManager);
        getCommand("weaponrecipes").setExecutor(weaponRecipesCommand);
        getCommand("weaponrecipes").setTabCompleter(weaponRecipesCommand);

        RitualCommand ritualCommand = new RitualCommand(configManager, ritualManager);
        getCommand("ritual").setExecutor(ritualCommand);
        getCommand("ritual").setTabCompleter(ritualCommand);

        getLogger().info("LegendaryWeapons has been enabled!");
    }

    @Override
    public void onDisable() {
        // Cancel all active rituals to prevent orphaned tasks
        if (ritualManager != null) {
            ritualManager.cancelAll();
        }

        // Remove custom recipes so they don't persist across reloads
        if (recipeManager != null) {
            recipeManager.unregisterRecipes();
        }

        getLogger().info("LegendaryWeapons has been disabled.");
    }

    public ConfigManager getConfigManager() {
        return configManager;
    }

    public RecipeManager getRecipeManager() {
        return recipeManager;
    }

    public RitualManager getRitualManager() {
        return ritualManager;
    }
}