xen.dev_xd
📎 1 file 5,666 chars
📄
pasted-code-1784827211073.txt
txt 318 lines
▶
Create a professional Minecraft Paper plugin for Minecraft 1.21.11.

Plugin Name: AnsoWeapon
Main Command: /ansoweapon
Language: Java 21
API: Paper 1.21.11

=================================================
GOAL
=================================================

Create a premium custom weapon plugin inspired by modern PvP servers like RXGlory, but DO NOT copy any code, textures, abilities, or assets. Design everything to be original and unique.

The plugin must be optimized, bug-free, configurable, and ready for production servers.

=================================================
COMMANDS
=================================================

/ansoweapon give  
Gives a custom weapon.

/ansoweapon recipe
Opens a INVENTORY GUI showing every custom weapon recipe.

/ansoweapon craftingchange
Opens an Admin INVENTORY GUI where crafting recipes can be changed in-game.

/ansoweapon reload
Reloads every config without restarting the server.

/ansoweapon list
Shows every available custom weapon.

/ansoweapon info 
Displays weapon information.

Permission:
ansoweapon.admin

=================================================
CRAFTING SYSTEM
=================================================

This is the MOST IMPORTANT feature.

Server owners MUST be able to completely change every weapon crafting recipe.

Requirements:

✔ Enable/Disable recipes
✔ Change recipe completely
✔ Support shaped recipes
✔ Support shapeless recipes
✔ Change ingredients
✔ Change crafting layout
✔ Save automatically
✔ Reload recipes instantly
✔ No server restart required
✔ Recipe INVENTORY GUI
✔ Recipe Preview
✔ Recipe Editor INVENTORY GUI

Crafting data should also be saved inside recipes.yml.

=================================================
CUSTOM WEAPONS
=================================================

Each weapon has:

• Custom Name
• Lore
• Glow
• Unbreakable
• CustomModelData
• Attribute Modifiers
• Configurable Material
• Custom Texture Support
• Sounds
• Particles
• Cooldowns

=================================================
UNIQUE ABILITIES
=================================================

Create completely ORIGINAL abilities.

Example weapons:

Storm Breaker
- Energy Slash
- Blue particles
- Knockback
- 10 second cooldown

Shadow Fang
- Dash forward
- Temporary invisibility
- Critical first hit
- 15 second cooldown

Inferno Blade
- Fire explosion
- Burns nearby enemies
- Flame particles

Frost Reaper
- Freeze enemies
- Slowness
- Snow particles

Thunder Hammer
- Lightning strikes
- Launch enemies upward
- Electric particles

DO NOT COPY RXGlory abilities.
Create better and more unique mechanics.

=================================================
CONFIGURATION
=================================================

Everything must be configurable.

config.yml

weapons.yml

recipes.yml

messages.yml

settings.yml

Editable:

Damage

Cooldown

Range

Particles

Sounds

Messages

Model Data

Materials

Recipes

Enchantments

Permissions

World Blacklist

No hardcoded values.

=================================================
COOLDOWN SYSTEM
=================================================

Display cooldown using:

✔ Action Bar
✔ Boss Bar
✔ Title
✔ Configurable

=================================================
PARTICLES
=================================================

Use modern Paper particles.

Dust

Dust Transition

Electric Spark

Flash

End Rod

Dragon Breath

Sonic Boom

Soul Fire Flame

Trial Spawner

=================================================
INVENTORY GUI
=================================================

Create beautiful inventories.

Weapon Menu

Recipe Menu

Crafting Change Menu

Admin Panel

Weapon Preview

Recipe Preview

=================================================
CRAFTING CHANGE INVENTORY GUI
=================================================

The command

/ansoweapon craftingchange

must open an Admin INVENTORY GUI.

Inside this INVENTORY GUI admins can:

✔ Select any weapon
✔ Edit recipe slots
✔ Change ingredients
✔ Save recipe
✔ Reset recipe
✔ Enable/Disable recipe
✔ Instantly apply changes
✔ Auto-save into recipes.yml

No restart required.

=================================================
PLACEHOLDER API
=================================================

Support PlaceholderAPI.

Examples:

%ansoweapon_weapon%

%ansoweapon_cooldown%

%ansoweapon_kills%

=================================================
COMPATIBILITY
=================================================

Paper 1.21.11

Java 21

PlaceholderAPI

Vault

WorldGuard

MythicMobs

=================================================
PERFORMANCE
=================================================

Support 150+ players.

No lag.

No memory leaks.

No deprecated API.

Clean object-oriented code.

=================================================
PROJECT OUTPUT
=================================================

Generate the COMPLETE IntelliJ IDEA project.

Include:

plugin.yml

config.yml

messages.yml

recipes.yml

weapons.yml

settings.yml

Every Java class

Every listener

Every command

Every INVENTORY GUI

Every manager

Everything should compile successfully with Java 21 and Paper 1.21.11 without any missing classes or TODOs.

The final result should feel like a premium, polished custom weapon plugin with editable crafting recipes through both INVENTORY GUI and config files.
Kodari AI
KodariJul 23 at 5:24 pm 14
AnsoWeapon
An original premium custom weapon plugin for Paper 1.21.11 that provides configurable weapons, unique combat abilities, cooldown displays, editable shaped and shapeless recipes, recipe preview menus, and an in-game administrator recipe editor. Weapon properties, materials, names, lore, attributes, sounds, particles, cooldowns, messages, permissions, and world restrictions are managed through YAML configuration files. The plugin also supports PlaceholderAPI and optional server integrations.
Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
27 1,984
src/main/java/com/ansoweapon/AnsoWeaponPlugin.java
package com.ansoweapon;

import com.ansoweapon.command.AnsoWeaponCommand;
import com.ansoweapon.config.ConfigManager;
import com.ansoweapon.listener.GuiListener;
import com.ansoweapon.listener.WeaponListener;
import com.ansoweapon.manager.AbilityManager;
import com.ansoweapon.manager.CooldownManager;
import com.ansoweapon.manager.RecipeManager;
import com.ansoweapon.manager.WeaponManager;
import com.ansoweapon.placeholder.AnsoPlaceholderExpansion;
import org.bukkit.Bukkit;
import org.bukkit.NamespacedKey;
import org.bukkit.plugin.java.JavaPlugin;

public class AnsoWeaponPlugin extends JavaPlugin {
    private ConfigManager configManager;
    private WeaponManager weaponManager;
    private RecipeManager recipeManager;
    private CooldownManager cooldownManager;
    private AbilityManager abilityManager;

    @Override
    public void onEnable() {
        this.configManager = new ConfigManager(this);
        this.configManager.load();

        this.weaponManager = new WeaponManager(this);
        this.weaponManager.load();

        this.recipeManager = new RecipeManager(this);
        this.recipeManager.load();
        this.recipeManager.registerAll();

        this.cooldownManager = new CooldownManager(this);
        this.abilityManager = new AbilityManager(this);

        AnsoWeaponCommand command = new AnsoWeaponCommand(this);
        getCommand("ansoweapon").setExecutor(command);
        getCommand("ansoweapon").setTabCompleter(command);

        Bukkit.getPluginManager().registerEvents(new WeaponListener(this), this);
        Bukkit.getPluginManager().registerEvents(new GuiListener(this), this);

        if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) {
            new AnsoPlaceholderExpansion(this).register();
        }
    }

    @Override
    public void onDisable() {
        if (recipeManager != null) {
            recipeManager.unregisterAll();
        }
        if (cooldownManager != null) {
            cooldownManager.clear();
        }
    }

    public ConfigManager getConfigManager() {
        return configManager;
    }

    public WeaponManager getWeaponManager() {
        return weaponManager;
    }

    public RecipeManager getRecipeManager() {
        return recipeManager;
    }

    public CooldownManager getCooldownManager() {
        return cooldownManager;
    }

    public AbilityManager getAbilityManager() {
        return abilityManager;
    }

    public NamespacedKey getAbilityManagerKey(String key) {
        return new NamespacedKey(this, "ability_" + key);
    }
}