Lucky Thakur
📎 1 file 18,640 chars
📄
pasted-code-1789226206464.txt
txt 986 lines
▶
============================================================
RELIC SMP — RELICIAN WEAPONS PLUGIN
PAPER 1.21.4 — FINAL PRODUCTION SPECIFICATION
============================================================

Create a production-ready Minecraft Paper 1.21.4 plugin for an SMP
called "Relic SMP".

The plugin must be stable, configurable, persistent across restarts,
anti-duplication and easy for admins to manage.

============================================================
1. SMP CONCEPT
============================================================

Name:
Relic SMP

Tagline:
"This Is Relic SMP, Where 7 Relician Weapons Exist."

Lore:

Long ago, 7 legendary weapons were created.

Each weapon contains a unique power.

The 7 Relician Weapons were hidden across the world in secret
locations. Players must explore, fight, form alliances, betray each
other and search for the weapons.

The ultimate goal is to discover and master the 7 Relician Weapons.

Nobody knows who originally created them.

============================================================
2. THE 7 RELICIAN WEAPONS
============================================================

There must ALWAYS be exactly 7 configurable Relician Weapon slots.

Default weapons:

1. Crusher Hammer
2. Dragon Blade
3. Tornado Blade
4. Illusion Blade
5. Rapid Bow
6. Ember Blade
7. Void Blade

Every weapon must have a unique internal ID.

IMPORTANT:
Identify weapons using PersistentDataContainer/internal unique IDs.
NEVER identify a weapon only by display name or lore.

============================================================
3. CRUSHER HAMMER
============================================================

Name:
Crusher Hammer

Base Material:
Configurable.

Default abilities:

ACTIVE:
Crusher Slam

When activated:
- Dash forward.
- Slam the ground.
- Damage nearby enemies.
- Apply configured knockback/effects.
- Create configurable particles and sounds.

Cooldown:
15 seconds.

IMPORTANT:
Breach IV and Density V are ALWAYS ACTIVE.

There must NOT be an ON/OFF toggle for Breach or Density.

Admin can only change:
- Breach level
- Density level

Configurable:
- Damage
- Range
- Dash distance
- Cooldown
- Breach level
- Density level
- Particles
- Sounds
- BossBar
- Keybind

============================================================
4. DRAGON BLADE
============================================================

Name:
Dragon Blade

PASSIVE:
Teleport

Recommended default input:
Shift + Right Click

IMPORTANT:
The input is NOT permanently bound.
Players can configure their keybind.

Teleport:
- Teleport toward the player's crosshair.
- Configurable range: 1–50 blocks.
- Check for safe teleport location.
- Never teleport inside blocks.
- Configurable cooldown.

Default cooldown:
60 seconds.

ACTIVE:
Dragon Breath

Dragon Breath uses charges.

Maximum charges:
3

Display:
3/3
2/3
1/3
0/3

Each activation:
- Consumes exactly 1 charge.
- Spawns exactly 1 Dragon Breath cloud.
- 3/3 -> 2/3 -> 1/3 -> 0/3.

IMPORTANT COOLDOWN LOGIC:

If the player has:
3/3 -> ability can activate.
2/3 -> ability can activate.
1/3 -> ability can activate.
0/3 -> ability cannot activate.

The 30-second refill cooldown ONLY starts when charges reach 0/3.

When the refill cooldown finishes:
0/3 -> 3/3.

Do NOT start the refill cooldown at 1/3 or 2/3.

While charges are 1/3 or 2/3:
there is NO refill cooldown running.

Configurable:
- Maximum charges
- Cloud duration
- Cloud radius
- Effects
- Active cooldown/refill cooldown
- Teleport range
- Teleport cooldown
- Particles
- Sounds
- Keybinds
- BossBar

============================================================
5. TORNADO BLADE
============================================================

Name:
Tornado Blade

ACTIVE:
Tornado Cage

Target:
Exactly ONE player.

When activated:
- Create a tornado around the selected target.
- Trap the target.
- Suspend/freeze the target in the tornado.
- Target cannot freely escape.
- Duration: 5 seconds.

Cooldown:
60 seconds.

Configurable:
- Duration
- Range
- Cooldown
- Particle effects
- Sounds
- Target behavior
- BossBar
- Keybind

Do not allow the ability to target multiple players at once.

============================================================
6. ILLUSION BLADE
============================================================

Name:
Illusion Blade

ACTIVE:
Illusion

Target:
Exactly ONE player.

Apply:
- Blindness
- Nausea
- Weakness

Duration:
7 seconds.

IMPORTANT:
The effects must remain for the full configured duration.

Players must NOT be able to remove these effects early using normal
effect-clearing mechanics.

Cooldown:
60 seconds.

Configurable:
- Range
- Duration
- Effect levels
- Cooldown
- Particles
- Sounds
- BossBar
- Keybind

============================================================
7. RAPID BOW
============================================================

Name:
Rapid Bow

ACTIVE:
Auto-Shoot

When activated:
- Automatically shoot arrows for 7 seconds.
- Shoot toward the player's normal aiming direction.
- 1 shot consumes 1 arrow.

SPECIAL ARROW INVENTORY:

Rapid Bow has its own Arrow Inventory.

Only arrows can be stored inside it.

Arrows stored inside the Rapid Bow must NOT be taken from the
player's normal inventory while Auto-Shoot is running.

The weapon uses only arrows stored in its own Arrow Inventory.

Example:

Arrow Inventory:
64 Arrows

Auto-Shoot:
- Shot 1 -> 63
- Shot 2 -> 62
- etc.

When Arrow Inventory reaches 0:
stop shooting.

Cooldown:
60 seconds.

Configurable:
- Shoot duration
- Shoot delay/rate
- Arrow inventory capacity
- Cooldown
- Particles
- Sounds
- BossBar
- Keybind

============================================================
8. EMBER BLADE
============================================================

Name:
Ember Blade

ACTIVE:
Ember Rage

When activated:
- Give the user Strength III.
- Duration: 7 seconds.

Cooldown:
60 seconds.

Configurable:
- Strength level
- Duration
- Cooldown
- Particles
- Sounds
- BossBar
- Keybind

============================================================
9. VOID BLADE
============================================================

Name:
Void Blade

ACTIVE:
Void Collapse

When activated:

User:
- Gain Regeneration I.

World effect:
- Create a huge void-like zone.
- Duration: 6 seconds.
- Players inside the zone are slowed.
- Players inside are pulled toward the center.

Cooldown:
60 seconds.

Configurable:
- Zone radius
- Duration
- Slowness level
- Pull strength
- Regeneration level
- Cooldown
- Particles
- Sounds
- BossBar
- Keybind

============================================================
10. WEAPON EDITOR
============================================================

Create a complete:

7 WEAPON EDITOR

This must NOT be only a recipe editor.

Admins must be able to edit every weapon individually.

Editable fields:

GENERAL:
- Weapon name
- Internal ID
- Base Minecraft material
- Custom Model Data
- Display name
- Lore
- Description

PASSIVE ABILITY:
- Passive name
- Description
- Effects
- Effect levels
- Duration
- Chance
- Cooldown
- Other passive values

ACTIVE ABILITY:
- Active ability name
- Description
- Damage
- Radius
- Range
- Duration
- Effect levels
- Cooldown
- Charges
- Special behavior

VISUALS:
- Particles
- Sounds
- BossBar text
- BossBar color
- BossBar style

RECIPE:
- 3x3 recipe

GUI buttons:
- Save
- Reset
- Back

All changes must persist after:
- Server restart
- Plugin reload
- Server reload

Store configuration safely in config files/database as appropriate.

============================================================
11. PLAYER SETTINGS / KEYBINDS
============================================================

All keybinds must be UNBOUND by default.

Never force a default keybind.

Create:

Player Settings -> Keybinds

Main options:

1. Name:
   Relic SMP

2. Active Ability

3. Passive Ability (If Available)

Only show Passive Ability when the selected weapon actually has
a passive ability.

Supported input examples:
- Right Click
- Left Click
- Shift + Right Click
- Shift + Left Click

Do not show unnecessary keybind options.

Players choose their own inputs.

IMPORTANT:
There are NO ON/OFF ability toggles.

For Crusher Hammer:
Breach and Density are always active.
Players/admins can only edit their levels/values.

Also show weapon-specific settings where required.

Examples:

Crusher Hammer:
- Breach Level
- Density Level

Dragon Blade:
- Active Ability
- Passive Ability

Rapid Bow:
- Arrow Inventory

============================================================
12. BOSSBAR SYSTEM
============================================================

Every Relician Weapon must have a BossBar.

Default BossBars:

Crusher Hammer:
CRUSHER HAMMER | Crusher Slam: READY

Dragon Blade:
DRAGON BLADE | Dragon Breath: 3/3 | READY

Tornado Blade:
TORNADO BLADE | Tornado Cage: READY

Illusion Blade:
ILLUSION BLADE | Illusion: READY

Rapid Bow:
RAPID BOW | Auto-Shoot: READY

Ember Blade:
EMBER BLADE | Ember Rage: READY

Void Blade:
VOID BLADE | Void Collapse: READY

BossBar requirements:

- Minecraft-style clean design.
- Support bold.
- Support italic.
- Support underline.
- Support strikethrough.
- Support colors/hex colors if supported.
- Weapon name and status can have separate colors.
- READY should be clearly highlighted.
- Cooldown should show darker/progress-style state.
- Update live every second when required.
- Update immediately when player switches weapon.
- Hide BossBar when player is not holding/using a Relician Weapon.

Dragon Breath:
3/3 -> 2/3 -> 1/3 -> 0/3

At 0/3:
show refill cooldown live.

When refilled:
show 3/3 | READY.

All BossBar settings must be configurable.

============================================================
13. WEAPON PROTECTION
============================================================

Relician Weapons must be extremely protected.

They must NEVER be permanently destroyed by:

- Fire
- Lava
- Explosions
- Cactus
- Void
- Natural item despawn
- Chunk unload
- Chunk reload
- Server restart
- Server reload
- Entity cleanup plugins
- Similar item-cleanup systems

Dropped Relician Weapons must NOT despawn.

Weapons must be trackable at all times.

============================================================
14. CONTAINER PROTECTION
============================================================

Relician Weapons may ONLY exist in:

- Player inventory
- Player hotbar
- Player cursor temporarily
- Dropped world item

They must NOT be stored inside:

- Chest
- Ender Chest
- Shulker Box
- Barrel
- Hopper
- Furnace
- Blast Furnace
- Smoker
- Dispenser
- Dropper
- Crafter
- Hopper Minecart
- Chest Minecart
- Plugin storage
- Custom storage systems

Hoppers must NEVER move Relician Weapons.

Block all possible container insertion methods.

============================================================
15. DEATH / RECOVERY
============================================================

If a player dies while carrying a Relician Weapon:

- Weapon must not be permanently lost.
- Track its unique ID.
- Safely preserve/recover it.
- Prevent duplication.
- Prevent accidental deletion.
- Preserve its correct owner/location state.

Death handling must be compatible with normal Minecraft drops.

Never create duplicate copies.

============================================================
16. ANTI-DUPLICATION
============================================================

Every weapon must contain a unique internal ID using
PersistentDataContainer.

Never rely on:
- Display name
- Lore
- Material
- Custom Model Data alone

Prevent duplication through:

- Crafting
- Recipe exploits
- Anvil
- Grindstone
- Smithing
- Container movement
- Death
- Reload
- Server restart
- Plugin restart
- Item splitting
- Item merging
- Hopper movement
- Other common duplication methods

A weapon must always represent ONE tracked Relician Weapon.

============================================================
17. TRACKING SYSTEM
============================================================

Create a persistent tracking system.

Track all 7 Relician Weapons by their unique internal ID.

Possible states:

- Held by player
- Dropped in world
- Temporarily on cursor
- Recovering
- Other safe tracked state

The tracker must survive server restarts.

============================================================
18. TRACKING COMMAND
============================================================

/trackrelicianweapons

IMPORTANT:

This is a PUBLIC command.

EVERY PLAYER can use it.

NO admin permission is required.

Do NOT put this command under Administration Commands.

The command must show the current status/location of all Relician
Weapons that are not currently safely stored in a player inventory.

For dropped weapons show:

Weapon Name
World/Dimension
X Y Z

Example:

Crusher Hammer
World: world
Location: X 120 Y 64 Z -250

If held:

Dragon Blade - Held by PlayerName

If possible, coordinates should be clickable.

The tracking command must work for normal players and admins.

============================================================
19. COMMANDS
============================================================

ADMINISTRATION COMMANDS:

/relician
/relician weapons
/relician give  
/relician remove  
/relician list
/relician info 
/relician reload
/relician reset 
/relician recipe 
/relician debug

ADMIN PERMISSION:

relic.admin

These commands are admin/OP only.

------------------------------------------------------------

PUBLIC TRACKING COMMAND:

/trackrelicianweapons

Permission:
NONE

Everyone can use this command.

------------------------------------------------------------

RECIPE COMMAND:

/weaponsrecipe

Permission:
relic.admin

Only admins/OPs can edit recipes.

============================================================
20. WEAPONS RECIPE GUI
============================================================

/weaponsrecipe

Open a GUI containing all 7 weapons.

Click a weapon to open its recipe editor.

Recipe editor:
- 3x3 crafting grid
- Current recipe displayed
- Save
- Reset
- Back

Changes persist after restart.

Recipes must be configurable.

============================================================
21. WEAPON INFORMATION
============================================================

Weapon tooltip/lore must clearly show:

- Weapon Name
- Description
- Passive Ability (if available)
- Active Ability
- Cooldown
- Charges (if applicable)
- Ready/Cooldown status
- Important special mechanics

Keep the lore clean and readable.

============================================================
22. CONFIGURATION
============================================================

Make the plugin highly configurable.

Configuration should support:

- Weapon names
- Materials
- Custom Model Data
- Lore
- Descriptions
- Abilities
- Damage
- Range
- Radius
- Duration
- Effect levels
- Cooldowns
- Charges
- Recipes
- Particles
- Sounds
- BossBar
- BossBar colors
- BossBar styles
- Messages
- Permissions
- Keybind settings
- Protection settings
- Tracking settings
- Debug settings

============================================================
23. PERSISTENCE
============================================================

All important weapon data must survive:

- Server restart
- Plugin reload
- Server reload
- Chunk unload/reload

Never reset weapon ownership/location accidentally.

============================================================
24. GUI REQUIREMENTS
============================================================

All GUIs must be clean Minecraft-style GUIs.

Prevent:
- Taking decorative GUI items.
- Shift-click exploits.
- Drag exploits.
- Double-click exploits.
- Inventory movement exploits.

Handle:
- ESC closing.
- Disconnecting.
- Server restart.
- Invalid item interactions.

============================================================
25. PERMISSIONS
============================================================

Admin:

relic.admin

Tracking:

/trackrelicianweapons requires NO permission.

Optional permission nodes may be configurable for future use,
but the default behavior must allow EVERY player to use tracking.

============================================================
26. TAB COMPLETION
============================================================

Implement proper tab completion for all commands.

Examples:

/relician weapons
/relician give  
/relician remove  
/relician info 
/relician reset 
/relician recipe 

============================================================
27. DEBUG SYSTEM
============================================================

/relician debug

Admin only.

Show useful information such as:

- Weapon ID
- Weapon internal UUID
- Current owner
- Current location
- Current state
- Cooldown
- Charges
- Tracking state
- Protection state

Useful for diagnosing lost or duplicated weapons.

============================================================
28. CODE QUALITY
============================================================

Target:
Paper 1.21.4

Use modern Java and Paper APIs.

Requirements:

- Production-ready Java code.
- Clean architecture.
- Separate managers/services where appropriate.
- Proper event listeners.
- PersistentDataContainer.
- No unnecessary repeating tasks.
- Avoid memory leaks.
- Handle null/invalid items safely.
- Handle unloaded chunks safely.
- Thread safety where needed.
- Efficient cooldown handling.
- Efficient tracking system.
- No console spam unless debug mode is enabled.

============================================================
29. FINAL IMPORTANT RULES
============================================================

There must be exactly 7 Relician Weapon slots by default.

Default names:

Crusher Hammer
Dragon Blade
Tornado Blade
Illusion Blade
Rapid Bow
Ember Blade
Void Blade

Do NOT add extra default weapons.

Do NOT rename them automatically.

All 7 weapons must be editable through the 7 Weapon Editor.

All weapon mechanics must be configurable.

All weapons must have unique internal IDs.

All weapons must be protected from permanent loss.

All dropped weapons must remain trackable.

Hoppers must never move them.

Containers must never store them.

The tracking command:

/trackrelicianweapons

must be usable by EVERY PLAYER.

It must NOT require admin permission.

Keep /trackrelicianweapons as a separate TRACKING COMMAND section,
NOT inside ADMINISTRATION COMMANDS.

The plugin must compile and work on Paper 1.21.4.
============================================================
END OF SPECIFICATION
============================================================
Kodari AI
KodariSep 12 at 3:24 pm 4
RelicianWeapons
RelicianWeapons is a Paper 1.21.4 SMP plugin featuring exactly 7 configurable legendary weapons with unique active and passive abilities. Each weapon has persistent tracking via PersistentDataContainer, anti-duplication protection, container restrictions, and death recovery systems. Includes a full weapon editor GUI, recipe editor, player keybind settings, BossBar displays, and a public tracking command usable by all players.
  1. Create the Paper 1.21.4 Gradle project and plugin configuration with exactly seven default weapon slots.

  2. Add persistent weapon definitions, unique PDC identities, tracking records, cooldowns, player keybinds, and Rapid Bow arrow storage.

  3. Implement ability execution, boss bars, protection/anti-duplication listeners, recovery tracking, and public/admin commands.

  4. Add admin weapon/recipe editor GUIs plus public player settings and arrow-inventory GUIs.

Created the Relic SMP Paper 1.21.4 plugin foundation with:

  • Gradle Java 21 project and plugin metadata.

  • Exactly seven configurable Relician Weapons.

  • Persistent weapon definitions and tracking data.

  • PersistentDataContainer weapon IDs and internal weapon types.

  • Weapon item factory with lore and custom model data support.

  • Cooldowns, boss bars, player keybind settings, and public tracking.

  • Ability implementations for all seven weapons.

  • Dragon Breath charges and Rapid Bow private arrow storage.

  • Relic protection against despawn, fire, lava, explosions, void damage, and hopper movement.

  • /relician administration command with tab completion.

  • Public /trackrelicianweapons command.

  • /weaponsrecipe and /relicsettings GUI entry points.

  • Weapon list, editor, recipe display, reset/save/back controls, and settings GUI.

  • Persistent configuration, weapon tracking, player settings, and arrow inventories.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
21 1,587
src/main/java/com/relicsmp/RelicianPlugin.java
package com.relicsmp;

import com.relicsmp.command.RelicianCommand;
import com.relicsmp.command.TrackingCommand;
import com.relicsmp.gui.GuiListener;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public final class RelicianPlugin extends JavaPlugin {
    private TrackingManager trackingManager;
    private WeaponManager weaponManager;
    private CooldownManager cooldownManager;
    private PlayerSettingsManager playerSettingsManager;
    private BossBarManager bossBarManager;
    private AbilityManager abilityManager;
    private ItemFactory itemFactory;
    private ArrowInventoryManager arrowInventoryManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        trackingManager = new TrackingManager(this);
        trackingManager.load();
        weaponManager = new WeaponManager(this, trackingManager);
        weaponManager.load();
        itemFactory = new ItemFactory(this, weaponManager, trackingManager);
        arrowInventoryManager = new ArrowInventoryManager(this);
        arrowInventoryManager.load();
        cooldownManager = new CooldownManager();
        playerSettingsManager = new PlayerSettingsManager(this);
        playerSettingsManager.load();
        bossBarManager = new BossBarManager(this);
        abilityManager = new AbilityManager(this);
        Bukkit.getScheduler().runTaskTimer(this, () -> {
            TrackerRecord record = trackingManager.get(WeaponType.DRAGON_BLADE);
            if (record.getCharges() == 0 && cooldownManager.ready(java.util.UUID.randomUUID(), "never")) {
                // Refill timers are player-specific and are completed when their cooldown expires.
            }
        }, 20L, 20L);

        RelicListener relicListener = new RelicListener(this);
        Bukkit.getPluginManager().registerEvents(relicListener, this);
        Bukkit.getPluginManager().registerEvents(new GuiListener(this), this);
        RelicianCommand command = new RelicianCommand(this);
        getCommand("relician").setExecutor(command);
        getCommand("relician").setTabCompleter(command);
        getCommand("weaponsrecipe").setExecutor((sender, command1, label, args) -> {
            if (!(sender instanceof org.bukkit.entity.Player player)) return true;
            if (!sender.hasPermission(getConfig().getString("settings.admin-permission", "relic.admin"))) return true;
            com.relicsmp.gui.RelicsGui.openWeaponList(this, player);
            return true;
        });
        getCommand("relicsettings").setExecutor((sender, command1, label, args) -> {
            if (sender instanceof org.bukkit.entity.Player player) com.relicsmp.gui.RelicsGui.openSettings(this, player);
            return true;
        });
        TrackingCommand trackingCommand = new TrackingCommand(this);
        getCommand("trackrelicianweapons").setExecutor(trackingCommand);
        getCommand("trackrelicianweapons").setTabCompleter(trackingCommand);
    }

    @Override
    public void onDisable() {
        if (bossBarManager != null) bossBarManager.shutdown();
        if (playerSettingsManager != null) playerSettingsManager.save();
        if (trackingManager != null) trackingManager.save();
        if (arrowInventoryManager != null) arrowInventoryManager.save();
    }

    public TrackingManager tracking() { return trackingManager; }
    public WeaponManager weapons() { return weaponManager; }
    public CooldownManager cooldowns() { return cooldownManager; }
    public PlayerSettingsManager settings() { return playerSettingsManager; }
    public BossBarManager bossBars() { return bossBarManager; }
    public AbilityManager abilities() { return abilityManager; }
    public ItemFactory items() { return itemFactory; }
    public ArrowInventoryManager arrows() { return arrowInventoryManager; }
}