ashu__xd
๐Ÿ“Ž 1 file 2,057 chars
๐Ÿ“„
pasted-code-1773849943471.txt
txt 71 lines
โ–ถ
Create a Minecraft Spigot/Paper plugin (Java, latest API 1.21+) with the following features:

Plugin Name: MythicSwordDrops

Core Features:

1. Custom Swords System:
- There are 6 unique custom swords.
- Each sword has:
  - Custom name (colored & formatted)
  - Unique lore
  - Special abilities (like extra damage, effects, etc.)
  - Unbreakable
  - Glowing enchant effect

2. Random Drop System:
- Every 48 hours (2 days), ONLY ONE sword spawns randomly in the world.
- The spawn location must be random but safe (not inside blocks, lava, or void).
- Broadcast a message when the sword drops.

3. BossBar Tracking:
- When a sword spawns:
  - Show coordinates (X, Y, Z) in a BossBar to all players.
- When a player picks up the sword:
  - BossBar updates to show: "Sword claimed by "
- BossBar remains visible for a configurable duration.

4. Claim & Ownership System:
- The player who picks up the sword becomes the owner.
- The sword is bound to that player.

5. Restrictions:
- The sword CANNOT be:
  - Dropped manually
  - Stored in chests, shulkers, ender chest, or any container
- The sword MUST always remain in the player inventory.

6. Death Mechanic:
- If the player holding the sword dies:
  - The sword drops naturally at the death location
  - Ownership is removed
  - Anyone can pick it up again

7. Persistence:
- Sword data and ownership must persist across server restarts.

8. Config File:
- Allow configuration for:
  - Drop interval (default 48 hours)
  - BossBar duration
  - Messages
  - Sword stats

9. Commands:
- /sworddrop spawn โ†’ Force spawn a sword (admin only)
- /sworddrop give   โ†’ Give specific sword
- /sworddrop reload โ†’ Reload config

10. Permissions:
- mythicsword.admin
- mythicsword.use

11. Code Quality:
- Use clean OOP structure
- Separate classes (SwordManager, DropManager, BossBarManager, etc.)
- Use listeners properly (InventoryClickEvent, PlayerDropItemEvent, PlayerDeathEvent, etc.)

12. Compatibility:
- Must support Paper/Spigot 1.21+
- No external dependencies unless necessary
Kodari AI
KodariMar 18 at 4:11 pm 38,059 (v2)

Iโ€™ll create a comprehensive mythic sword drop system with timed spawns, ownership tracking, and boss bar coordination.

MythicSwordDrops
A dynamic sword drop system where unique powerful swords spawn randomly in the world every 48 hours. Players can claim these mythical weapons with special abilities, track them via boss bars, and compete to obtain them. Features ownership mechanics, drop prevention, death handling, and persistent sword tracking across server restarts with full admin controls.

Implementation Plan

  • 6 unique swords with special combat abilities (fire, ice, lightning, lifesteal, poison, shadow)

  • Automated drop system with safe location finding and configurable intervals

  • Boss bar coordination showing spawn coordinates and claim status

  • Ownership system with container prevention and death handling

  • Full persistence with YAML storage

  • Admin commands with permission controls

Let me read the XSeries documentation to ensure correct usage patterns:

Now Iโ€™ll create all the files:

Complete mythic sword drop system created with all features implemented:

  • 6 unique swords with special abilities (fire, ice, lightning, lifesteal, poison, blindness)

  • Automated 48-hour spawn system with safe random locations

  • Boss bar tracking showing coordinates on spawn and claim status

  • Ownership system preventing drops and container storage

  • Death mechanics that reset ownership and allow reclaim

  • Full persistence across restarts

  • Admin commands for spawn, give, and reload

  • XSeries integration for cross-version compatibility

ashu__xd
๐Ÿ“Ž 1 file 3,163 chars
๐Ÿ“„
pasted-code-1773899466165.txt
txt 116 lines
โ–ถ
Create a Minecraft Spigot/Paper plugin (Java, latest API 1.21+) with the following features:

Plugin Name: MythicSwordDrops

Core Features:

1. Custom Swords System:
- There are 6 unique custom swords.
- Each sword must be fully configurable from config.yml:
  - Name (with color codes)
  - Lore
  - Damage multiplier
  - Enchantments
  - Unbreakable option
  - Glow effect toggle

2. Custom Ability System (IMPORTANT):
- Each sword must support customizable abilities via config.yml.
- Abilities should include (config-based toggle + values):
  - Lightning strike on hit
  - Lifesteal (% of damage)
  - Fire effect (duration in seconds)
  - Potion effects (speed, strength, etc.)
  - Knockback boost
  - Cooldown per ability
- Ability triggers:
  - On hit
  - On kill
  - Passive (while holding)
- Developer should design a flexible AbilityManager class for easy expansion.

3. Random Drop System:
- Every 48 hours, ONLY ONE random sword spawns.
- Safe random location (avoid lava, air void, inside blocks).
- Broadcast drop message.

4. BossBar System:
- Show drop coordinates when spawned.
- After claim: show "Claimed by "
- Configurable duration.

5. Ownership System:
- Sword binds to player on pickup.
- Ownership stored persistently.

6. Inventory Restrictions:
- Sword cannot be:
  - Dropped manually
  - Stored in chests, shulkers, ender chest, etc.
- Must always stay in player inventory.

7. Death Mechanic:
- On death:
  - Sword drops at location
  - Ownership resets

8. Auto Destroy System (NEW FEATURE):
- Each sword has a configurable lifetime (in minutes/hours) in config.yml.
- After the timer expires:
  - Sword is automatically removed (destroyed)
  - Broadcast message: " has vanished!"
- Timer should:
  - Start when sword is claimed
  - Persist through server restarts
- Optional: warning before destruction (e.g. 5 minutes remaining via action bar or bossbar)

9. Cooldown System:
- Prevent same player from claiming another sword within X hours (configurable).

10. Config File:
- Fully customizable:
  - Drop interval
  - Sword abilities
  - Sword lifetime
  - Messages
  - BossBar settings

11. Commands:
- /sworddrop spawn โ†’ Force spawn
- /sworddrop give  
- /sworddrop reload
- /sworddrop info โ†’ Show active sword + timer

12. Permissions:
- mythicsword.admin
- mythicsword.use

13. Code Structure:
- Use clean OOP design:
  - SwordManager
  - AbilityManager
  - DropManager
  - BossBarManager
  - TimerManager
- Use listeners:
  - EntityDamageByEntityEvent
  - PlayerDeathEvent
  - InventoryClickEvent
  - PlayerDropItemEvent

14. Compatibility:
- Paper/Spigot 1.21+
- No unnecessary dependencies


3. Radius-Based Spawn System (IMPORTANT FEATURE):
- Sword spawns randomly within a defined X and Z radius.
- Configurable in config.yml:
  - center-x
  - center-z
  - radius-x
  - radius-z
- The spawn location must:
  - Be within the defined rectangular radius (X ยฑ radius-x, Z ยฑ radius-z)
  - Be safe (not inside blocks, lava, or void)
  - Automatically find highest solid block (Y coordinate)
Kodari AI
KodariMar 19 at 5:54 am 29,732 (v2)

Iโ€™ll read all the existing files first to understand the current state, then implement the complete plugin with all requested features.

Iโ€™ll now implement all missing features to complete the plugin. This includes the flexible ability system, auto-destroy timer, cooldown system, radius-based spawning, and the /sworddrop info command.

Analysis:

  • Existing structure is solid but missing key features

  • Need AbilityManager for flexible, config-driven abilities

  • Need TimerManager for auto-destroy and cooldowns

  • Need radius-based spawn system

  • Commands need /sworddrop info subcommand

All features have been implemented! The plugin now includes:

โœ… 6 Custom Swords - Fully configurable from config.yml โœ… Flexible Ability System - AbilityManager with config-driven abilities (hit, kill, passive triggers) โœ… Radius-Based Spawning - Define center coordinates and radius for sword spawns โœ… Auto-Destroy Timer - Swords vanish after configurable lifetime with warnings โœ… Cooldown System - Players canโ€™t claim another sword for X hours โœ… All Commands - spawn, give, reload, and info (shows active sword + timer) โœ… Full Config - All features configurable including abilities, lifetimes, cooldowns, radius โœ… Clean OOP Design - Separate managers for abilities, timers, drops, ownership, etc.

The ability system is now completely flexible - you can add any combination of lightning, lifesteal, fire, potion effects, knockback, area damage, and more through the config file!

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
20 1,773
src/main/java/com/mythicsworddrops/MythicSwordDrops.java
package com.mythicsworddrops;

import com.mythicsworddrops.command.SwordDropCommand;
import com.mythicsworddrops.listener.SwordListener;
import com.mythicsworddrops.manager.AbilityManager;
import com.mythicsworddrops.manager.BossBarManager;
import com.mythicsworddrops.manager.ConfigManager;
import com.mythicsworddrops.manager.DropManager;
import com.mythicsworddrops.manager.OwnershipManager;
import com.mythicsworddrops.manager.SwordManager;
import com.mythicsworddrops.manager.TimerManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class MythicSwordDrops extends JavaPlugin {
    
    private ConfigManager configManager;
    private SwordManager swordManager;
    private DropManager dropManager;
    private BossBarManager bossBarManager;
    private OwnershipManager ownershipManager;
    private AbilityManager abilityManager;
    private TimerManager timerManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.configManager = new ConfigManager(this);
        this.swordManager = new SwordManager(this);
        this.bossBarManager = new BossBarManager(this);
        this.ownershipManager = new OwnershipManager(this);
        this.abilityManager = new AbilityManager(this);
        this.timerManager = new TimerManager(this);
        this.dropManager = new DropManager(this);
        
        Bukkit.getPluginManager().registerEvents(new SwordListener(this), this);
        
        SwordDropCommand commandExecutor = new SwordDropCommand(this);
        getCommand("sworddrop").setExecutor(commandExecutor);
        getCommand("sworddrop").setTabCompleter(commandExecutor);
        
        startPassiveAbilityTask();
        
        getLogger().info("MythicSwordDrops has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (dropManager != null) {
            dropManager.saveData();
        }
        if (ownershipManager != null) {
            ownershipManager.saveData();
        }
        if (timerManager != null) {
            timerManager.shutdown();
        }
        if (bossBarManager != null) {
            bossBarManager.cleanup();
        }
        getLogger().info("MythicSwordDrops has been disabled!");
    }
    
    private void startPassiveAbilityTask() {
        Bukkit.getScheduler().runTaskTimer(this, () -> {
            for (org.bukkit.entity.Player player : Bukkit.getOnlinePlayers()) {
                org.bukkit.inventory.ItemStack mainHand = player.getInventory().getItemInMainHand();
                if (swordManager.isMythicSword(mainHand)) {
                    com.mythicsworddrops.data.SwordType type = swordManager.getSwordType(mainHand);
                    if (type != null) {
                        abilityManager.applyPassiveAbilities(type, player);
                    }
                }
            }
        }, 100L, 100L);
    }
}