I
📎 1 file 4,437 chars
📄
pasted-code-1774968985675.txt
txt 273 lines
▶
Create a PREMIUM, HIGH-QUALITY Minecraft Paper plugin called "CardsSMP".

GOAL:
Recreate a COMPLETE Cards SMP system (abilities, INVENTORY GUI, crafting, admin system) with HIGH POLISH and COMBAT-READY DESIGN.

DO NOT SIMPLIFY ANY SYSTEM.
DO NOT USE GENERIC IMPLEMENTATIONS.
THIS MUST FEEL LIKE A PAID SERVER PLUGIN.

---

CORE SYSTEM:

- Each player can have ONLY ONE active card
- Cards are custom items using PersistentDataContainer (key: "card-type")
- Cards must have:
  - Colored name
  - Detailed lore (passive + active ability)
  - Unique identity

- Players activate abilities using:
/ability 1

---

PLAYER SYSTEM:

/cards
- Opens player INVENTORY GUI
- Shows:
  - Current card
  - Ability description
  - Cooldown status
  - Passive info

---

ADMIN SYSTEM (VERY ADVANCED):

/cards admin

Permission: cards.admin

ADMIN INVENTORY GUI:
- Displays ALL cards in clean grid layout
- Pagination support
- Search filter
- Visual highlight:
  - disabled cards
  - locked cards

CLICK ACTIONS:
- LEFT → give card
- RIGHT → remove card
- SHIFT → view details
- MIDDLE → reset cooldown
- DROP (Q) → force ability trigger

---

ADMIN COMMANDS:

PLAYER:
- /cards give  
- /cards remove 
- /cards set  
- /cards clear 
- /cards check 
- /cards list

COOLDOWN:
- /cards cooldown reset 
- /cards cooldown set  
- /cards cooldown view 

ABILITY:
- /cards ability enable 
- /cards ability disable 
- /cards ability trigger 

HITS:
- /cards hits set  
- /cards hits reset 
- /cards hits view 

CRAFTING:
- /cards craft reset 
- /cards craft enable 
- /cards craft disable 

GLOBAL:
- /cards enable 
- /cards disable 
- /cards reload
- /cards debug

---

PERMISSIONS:

cards.admin
cards.moderator
cards.use

---

ABILITY SYSTEM:

Each card MUST have:

1. PASSIVE (runs constantly using events)
2. ACTIVE (/ability 1)

SUPPORT:
- cooldowns
- durations
- hit counters
- AoE radius
- chance triggers
- custom damage system

---

STRICT MECHANICS (VERY IMPORTANT):

DO NOT SIMPLIFY.

FEATHER:
- Passive:
  - Sword acts like mace
  - Damage = fallDistance scaling
- Active:
  - Dash forward using velocity

FREEZE:
- Passive:
  - Hit counter → freeze enemy
- Active:
  - AoE freeze (slowness + disable movement feel)

SHADOWSTEP:
- Passive:
  - Chance teleport behind enemy
- Active:
  - Controlled teleport ability

SPIDER:
- Passive:
  - Wall climbing (detect block collision)
- Active:
  - Web trap

GLIDE:
- Passive:
  - Slow falling
- Active:
  - Elytra boost

PHASE:
- Passive:
  - Chance ignore collision
- Active:
  - Walk through blocks temporarily

HOP:
- Passive:
  - Reduced fall damage
- Active:
  - Double jump

VINDICATOR:
- Passive:
  - Axe bonus damage
- Active:
  - Rage (strength + speed)

DRAGON:
- Passive:
  - Strength + speed always active
- Active:
  - Fire breath AoE

NETHERITE:
- Passive:
  - Resistance
- Active:
  - Tank mode

SOLITARE:
- Passive:
  - Hit tracking
- Active:
  - Swap positions multiple times

(Implement ALL remaining cards from config EXACTLY)

---

CRAFTING SYSTEM:

- Ritual crafting (NOT vanilla crafting)
- Validate 3x3 structure
- 10-minute ritual
- Particle circle animation
- Sound effects
- Cancel if player leaves area

Use config.yml EXACTLY.

---

VISUAL SYSTEM:

- Particles for EVERY ability
- Sounds on activation
- Action bar:
  - cooldown timer
  - ready status

Match themes:
- Blood → red particles
- Freeze → ice particles
- Conductor → lightning
- Shadowstep → dark particles

---

COMBAT INTEGRATION:

Hook into:
- EntityDamageByEntityEvent
- PlayerMoveEvent
- PlayerInteractEvent

Abilities MUST work during PvP.

---

ADVANCED SYSTEMS:

- CooldownManager
- HitTracker system
- AbilityState system
- Persistent player data

---

BALANCE:

- Only 1 card per player
- No stacking
- Strict cooldowns
- Anti-spam checks

---

CODE STRUCTURE:

- CardManager
- AbilityManager
- CooldownManager
- GUIManager
- EventListeners

---

OUTPUT:

- Full Java plugin source
- plugin.yml
- config.yml
- Setup instructions
- Clean, optimized, modular code
I
📎 1 file 4,437 chars
📄
pasted-code-1774970252589.txt
txt 273 lines
▶
Create a PREMIUM, HIGH-QUALITY Minecraft Paper plugin called "CardsSMP".

GOAL:
Recreate a COMPLETE Cards SMP system (abilities, INVENTORY GUI, crafting, admin system) with HIGH POLISH and COMBAT-READY DESIGN.

DO NOT SIMPLIFY ANY SYSTEM.
DO NOT USE GENERIC IMPLEMENTATIONS.
THIS MUST FEEL LIKE A PAID SERVER PLUGIN.

---

CORE SYSTEM:

- Each player can have ONLY ONE active card
- Cards are custom items using PersistentDataContainer (key: "card-type")
- Cards must have:
  - Colored name
  - Detailed lore (passive + active ability)
  - Unique identity

- Players activate abilities using:
/ability 1

---

PLAYER SYSTEM:

/cards
- Opens player INVENTORY GUI
- Shows:
  - Current card
  - Ability description
  - Cooldown status
  - Passive info

---

ADMIN SYSTEM (VERY ADVANCED):

/cards admin

Permission: cards.admin

ADMIN INVENTORY GUI:
- Displays ALL cards in clean grid layout
- Pagination support
- Search filter
- Visual highlight:
  - disabled cards
  - locked cards

CLICK ACTIONS:
- LEFT → give card
- RIGHT → remove card
- SHIFT → view details
- MIDDLE → reset cooldown
- DROP (Q) → force ability trigger

---

ADMIN COMMANDS:

PLAYER:
- /cards give  
- /cards remove 
- /cards set  
- /cards clear 
- /cards check 
- /cards list

COOLDOWN:
- /cards cooldown reset 
- /cards cooldown set  
- /cards cooldown view 

ABILITY:
- /cards ability enable 
- /cards ability disable 
- /cards ability trigger 

HITS:
- /cards hits set  
- /cards hits reset 
- /cards hits view 

CRAFTING:
- /cards craft reset 
- /cards craft enable 
- /cards craft disable 

GLOBAL:
- /cards enable 
- /cards disable 
- /cards reload
- /cards debug

---

PERMISSIONS:

cards.admin
cards.moderator
cards.use

---

ABILITY SYSTEM:

Each card MUST have:

1. PASSIVE (runs constantly using events)
2. ACTIVE (/ability 1)

SUPPORT:
- cooldowns
- durations
- hit counters
- AoE radius
- chance triggers
- custom damage system

---

STRICT MECHANICS (VERY IMPORTANT):

DO NOT SIMPLIFY.

FEATHER:
- Passive:
  - Sword acts like mace
  - Damage = fallDistance scaling
- Active:
  - Dash forward using velocity

FREEZE:
- Passive:
  - Hit counter → freeze enemy
- Active:
  - AoE freeze (slowness + disable movement feel)

SHADOWSTEP:
- Passive:
  - Chance teleport behind enemy
- Active:
  - Controlled teleport ability

SPIDER:
- Passive:
  - Wall climbing (detect block collision)
- Active:
  - Web trap

GLIDE:
- Passive:
  - Slow falling
- Active:
  - Elytra boost

PHASE:
- Passive:
  - Chance ignore collision
- Active:
  - Walk through blocks temporarily

HOP:
- Passive:
  - Reduced fall damage
- Active:
  - Double jump

VINDICATOR:
- Passive:
  - Axe bonus damage
- Active:
  - Rage (strength + speed)

DRAGON:
- Passive:
  - Strength + speed always active
- Active:
  - Fire breath AoE

NETHERITE:
- Passive:
  - Resistance
- Active:
  - Tank mode

SOLITARE:
- Passive:
  - Hit tracking
- Active:
  - Swap positions multiple times

(Implement ALL remaining cards from config EXACTLY)

---

CRAFTING SYSTEM:

- Ritual crafting (NOT vanilla crafting)
- Validate 3x3 structure
- 10-minute ritual
- Particle circle animation
- Sound effects
- Cancel if player leaves area

Use config.yml EXACTLY.

---

VISUAL SYSTEM:

- Particles for EVERY ability
- Sounds on activation
- Action bar:
  - cooldown timer
  - ready status

Match themes:
- Blood → red particles
- Freeze → ice particles
- Conductor → lightning
- Shadowstep → dark particles

---

COMBAT INTEGRATION:

Hook into:
- EntityDamageByEntityEvent
- PlayerMoveEvent
- PlayerInteractEvent

Abilities MUST work during PvP.

---

ADVANCED SYSTEMS:

- CooldownManager
- HitTracker system
- AbilityState system
- Persistent player data

---

BALANCE:

- Only 1 card per player
- No stacking
- Strict cooldowns
- Anti-spam checks

---

CODE STRUCTURE:

- CardManager
- AbilityManager
- CooldownManager
- GUIManager
- EventListeners

---

OUTPUT:

- Full Java plugin source
- plugin.yml
- config.yml
- Setup instructions
- Clean, optimized, modular code
Kodari AI
KodariMar 31 at 3:32 pm 75,229 (v2)
CardsSMP
A premium Cards SMP plugin featuring 11 unique ability cards with passive and active powers, ritual crafting system, full admin control panel with paginated GUI, per-player cooldown and hit tracking, action bar status display, and comprehensive command suite. Each card delivers distinct combat mechanics including freezing, shadow teleportation, wall climbing, fire breath, phase dodging, and more. Built for competitive PvP servers.

Planning the full architecture before writing any code:

  • 39 files spanning card system, managers, GUI framework, ability implementations, commands, and listeners

  • All cards extend abstract Card base with hook methods dispatched from CardListener

  • CardsSMP main class holds all manager references with @Getter — every plugin.getXManager() call guaranteed to resolve

  • XSeries used for all cross-version Material/Potion/Particle/Sound/Enchantment/Attribute access; MiniMessage for all text via ColorUtil

Now let me fix the unsafe direct Bukkit Particle enum references in GlideCard and HopCard:

Also remove the now-unused org.bukkit.Particle import from HopCard:


39 files created delivering the complete CardsSMP system:

  • 11 fully implemented cards (Feather, Freeze, Shadowstep, Spider, Glide, Phase, Hop, Vindicator, Dragon, Netherite, Solitare) — each with distinct passive event hooks and active abilities with particles and sounds

  • 6 managers (Card, Cooldown, HitTracker, AbilityState, Crafting, PlayerData) with full persistence via playerdata.yml

  • Inventory GUI framework with paginated AdminCardsGUI (LEFT=give, RIGHT=remove, SHIFT=detail view, MIDDLE=reset CD, Q=force trigger), search-by-chat, target player selection, and clean PlayerCardsGUI

  • Ritual crafting — right-click a matching center block surrounded by ring blocks with required items → 10-minute particle circle countdown that cancels if player moves >10 blocks

  • Action bar updates every 10 ticks showing card name + cooldown/ready status

  • Full command tree for /cards (give, remove, set, clear, check, cooldown, ability, hits, craft, enable, disable, reload, debug) and /ability 1 with tab completion

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
39 3,666
src/main/java/com/cardsmp/CardsSMP.java
package com.cardsmp;

import com.cardsmp.card.Card;
import com.cardsmp.card.CardRegistry;
import com.cardsmp.card.CardType;
import com.cardsmp.command.AbilityCommand;
import com.cardsmp.command.CardsCommand;
import com.cardsmp.inventory.gui.GUIListener;
import com.cardsmp.inventory.gui.GUIManager;
import com.cardsmp.listener.CardListener;
import com.cardsmp.listener.CraftingListener;
import com.cardsmp.manager.AbilityStateManager;
import com.cardsmp.manager.CardManager;
import com.cardsmp.manager.CooldownManager;
import com.cardsmp.manager.CraftingManager;
import com.cardsmp.manager.HitTrackerManager;
import com.cardsmp.manager.PlayerDataManager;
import com.cardsmp.util.ColorUtil;
import lombok.Getter;
import net.kyori.adventure.text.Component;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

@Getter
public class CardsSMP extends JavaPlugin {

    private GUIManager guiManager;
    private CardManager cardManager;
    private CooldownManager cooldownManager;
    private HitTrackerManager hitTrackerManager;
    private AbilityStateManager abilityStateManager;
    private CraftingManager craftingManager;
    private PlayerDataManager playerDataManager;
    private CardRegistry cardRegistry;
    private boolean debugMode = false;

    private final Map<UUID, String> adminSearchFilters = new HashMap<>();
    private final Map<UUID, Boolean> awaitingAdminSearch = new HashMap<>();
    private final Map<UUID, Player> adminTargets = new HashMap<>();

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

        this.playerDataManager = new PlayerDataManager(this);
        this.cooldownManager = new CooldownManager();
        this.hitTrackerManager = new HitTrackerManager();
        this.abilityStateManager = new AbilityStateManager();
        this.guiManager = new GUIManager();
        this.cardRegistry = new CardRegistry(this);
        this.cardManager = new CardManager(this);
        this.craftingManager = new CraftingManager(this);

        getServer().getPluginManager().registerEvents(new GUIListener(guiManager), this);
        getServer().getPluginManager().registerEvents(new CardListener(this), this);
        getServer().getPluginManager().registerEvents(new CraftingListener(this), this);

        CardsCommand cardsCmd = new CardsCommand(this);
        getCommand("cards").setExecutor(cardsCmd);
        getCommand("cards").setTabCompleter(cardsCmd);

        AbilityCommand abilityCmd = new AbilityCommand(this);
        getCommand("ability").setExecutor(abilityCmd);
        getCommand("ability").setTabCompleter(abilityCmd);

        startSchedulers();

        getLogger().info("CardsSMP enabled successfully.");
    }

    @Override
    public void onDisable() {
        playerDataManager.saveAll();
        craftingManager.cancelAll();
        getLogger().info("CardsSMP disabled.");
    }

    private void startSchedulers() {
        getServer().getScheduler().runTaskTimer(this, () -> {
            for (Player p : Bukkit.getOnlinePlayers()) {
                updateActionBar(p);
            }
        }, 0L, 10L);

        getServer().getScheduler().runTaskTimer(this, () -> {
            for (Player p : Bukkit.getOnlinePlayers()) {
                CardType type = cardManager.getPlayerCard(p);
                if (type == null) continue;
                if (!abilityStateManager.isEnabled(p.getUniqueId())) continue;
                Card card = cardRegistry.getCard(type);
                if (card != null) card.onPassiveTick(p);
            }
        }, 0L, 40L);
    }

    private void updateActionBar(Player player) {
        CardType type = cardManager.getPlayerCard(player);
        if (type == null) {
            player.sendActionBar(ColorUtil.colorize("<dark_gray>No active card"));
            return;
        }
        if (!abilityStateManager.isEnabled(player.getUniqueId())) {
            Component msg = ColorUtil.colorize(type.getDisplayName() + " <dark_gray>| <red>⊘ Disabled");
            player.sendActionBar(msg);
            return;
        }
        if (cooldownManager.isOnCooldown(player.getUniqueId(), type.getId())) {
            long rem = cooldownManager.getRemainingSeconds(player.getUniqueId(), type.getId());
            Component msg = ColorUtil.colorize(type.getDisplayName() + " <dark_gray>| <red>⏳ " + rem + "s");
            player.sendActionBar(msg);
        } else {
            Component msg = ColorUtil.colorize(type.getDisplayName() + " <dark_gray>| <green>✦ Ready");
            player.sendActionBar(msg);
        }
    }

    public void toggleDebug() {
        debugMode = !debugMode;
    }

    public void debugLog(String message) {
        if (debugMode) getLogger().info("[DEBUG] " + message);
    }
}