_ivy_tic
šŸ“Ž 2 files 3,310 chars
šŸ“„
pasted-code-1775229685461.txt
txt 1 lines
ā–¶
Create a Card SMP plugin for Minecraft using the Paper or Spigot API for Minecraft 1.20+ where players can obtain special ability cards that give permanent buffs. Cards should exist in four rarities (Common, Rare, Epic, Legendary) with configurable drop chances and should appear as custom items (for example Nether Stars) with colored names and lore explaining the ability. Players can right-click a card to equip it, but only one card can be active at a time, and equipping a new one removes the previous effects. Example cards include Warrior (+4 hearts, Strength I, Resistance I), Speedster (Speed II, Jump Boost I), Tank (+8 hearts, Resistance II, Slowness I), Vampire (life-steal on hit), Fire Card (fire resistance and attacks ignite enemies), and Lucky Card (better mob drops and higher card drop chance). Cards should drop from mobs with configurable probabilities (e.g., Zombies 2%, Skeletons 2%, Endermen 5%, Wither 100%) and also be obtainable via commands. The plugin must include commands like /cards give, /cards remove, /cards list, /cards reload, and /card to open a INVENTORY GUI showing collected cards where players can click to equip them. Player data should be saved using UUID-based YAML files storing active cards and owned cards, and the plugin should include configurable values in config.yml for drop rates, potion effects, and card stats. Add permissions (cards.admin, cards.use), particle and sound effects for equipping cards, cooldown protection to prevent spam equipping, and a clean plugin structure with managers for cards, abilities, INVENTORY GUI, configs, and event listeners optimized for multiplayer SMP performance.
šŸ“„
pasted-code-1775229688220.txt
txt 1 lines
ā–¶
Create a Card SMP plugin for Minecraft using the Paper or Spigot API for Minecraft 1.20+ where players can obtain special ability cards that give permanent buffs. Cards should exist in four rarities (Common, Rare, Epic, Legendary) with configurable drop chances and should appear as custom items (for example Nether Stars) with colored names and lore explaining the ability. Players can right-click a card to equip it, but only one card can be active at a time, and equipping a new one removes the previous effects. Example cards include Warrior (+4 hearts, Strength I, Resistance I), Speedster (Speed II, Jump Boost I), Tank (+8 hearts, Resistance II, Slowness I), Vampire (life-steal on hit), Fire Card (fire resistance and attacks ignite enemies), and Lucky Card (better mob drops and higher card drop chance). Cards should drop from mobs with configurable probabilities (e.g., Zombies 2%, Skeletons 2%, Endermen 5%, Wither 100%) and also be obtainable via commands. The plugin must include commands like /cards give, /cards remove, /cards list, /cards reload, and /card to open a INVENTORY GUI showing collected cards where players can click to equip them. Player data should be saved using UUID-based YAML files storing active cards and owned cards, and the plugin should include configurable values in config.yml for drop rates, potion effects, and card stats. Add permissions (cards.admin, cards.use), particle and sound effects for equipping cards, cooldown protection to prevent spam equipping, and a clean plugin structure with managers for cards, abilities, INVENTORY GUI, configs, and event listeners optimized for multiplayer SMP performance.
Kodari AI
KodariApr 3 at 3:24 pm 21,813 (v2)

I’ll create a comprehensive Card SMP plugin with a GUI-based card collection system, special abilities, and configurable drop rates.

CardSMP
A feature-rich ability card system for SMP servers where players collect and equip cards that grant permanent buffs. Features four rarity tiers (Common, Rare, Epic, Legendary), unique abilities like Warrior, Speedster, Tank, Vampire, Fire, and Lucky cards. Cards drop from mobs with configurable rates and can be managed through an interactive GUI. Includes life-steal, fire attacks, bonus loot, health boosts, and potion effects. Complete with admin commands, UUID-based data persistence, and optimized multiplayer performance.

All files created! The CardSMP plugin is now complete with:

  • 6 unique cards (Warrior, Speedster, Tank, Vampire, Fire, Lucky) with configurable rarities and effects

  • GUI-based card collection system where players can view and equip their cards

  • Mob drop system with configurable drop rates and lucky card multiplier

  • Special abilities: life-steal (Vampire), fire attacks (Fire), enhanced loot (Lucky)

  • Health modification system using XAttribute for cross-version compatibility

  • Commands: /cards give/remove/list/reload and /card to open GUI

  • Cooldown protection to prevent spam equipping

  • UUID-based YAML data persistence for player cards and active status

  • Particle and sound effects when equipping cards

  • Permissions system (cards.admin, cards.use)

  • Complete event handling for equipping via right-click or GUI

The plugin uses XSeries for full 1.8-1.20+ compatibility and includes a clean manager-based architecture optimized for multiplayer SMP servers.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
22 1,507
src/main/java/com/cardsmp/plugin/CardSMPPlugin.java
package com.cardsmp.plugin;

import com.cardsmp.plugin.ability.AbilityManager;
import com.cardsmp.plugin.card.CardManager;
import com.cardsmp.plugin.command.CardCommand;
import com.cardsmp.plugin.command.CardsCommand;
import com.cardsmp.plugin.data.DataManager;
import com.cardsmp.plugin.inventory.gui.GUIListener;
import com.cardsmp.plugin.inventory.gui.GUIManager;
import com.cardsmp.plugin.listener.CardEquipListener;
import com.cardsmp.plugin.listener.MobDeathListener;
import com.cardsmp.plugin.listener.PlayerJoinListener;
import com.cardsmp.plugin.listener.SpecialAbilityListener;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class CardSMPPlugin extends JavaPlugin {
    private CardManager cardManager;
    private DataManager dataManager;
    private AbilityManager abilityManager;
    private GUIManager guiManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.cardManager = new CardManager(this);
        this.dataManager = new DataManager(this);
        this.abilityManager = new AbilityManager(this);
        this.guiManager = new GUIManager();
        
        this.cardManager.loadCards();
        
        registerCommands();
        registerListeners();
        
        getLogger().info("CardSMP has been enabled!");
    }

    @Override
    public void onDisable() {
        Bukkit.getOnlinePlayers().forEach(player -> {
            this.dataManager.savePlayerData(this.dataManager.getPlayerData(player.getUniqueId()));
        });
        
        getLogger().info("CardSMP has been disabled!");
    }

    private void registerCommands() {
        getCommand("cards").setExecutor(new CardsCommand(this));
        getCommand("card").setExecutor(new CardCommand(this));
    }

    private void registerListeners() {
        Bukkit.getPluginManager().registerEvents(new GUIListener(this.guiManager), this);
        Bukkit.getPluginManager().registerEvents(new CardEquipListener(this), this);
        Bukkit.getPluginManager().registerEvents(new MobDeathListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerJoinListener(this), this);
        Bukkit.getPluginManager().registerEvents(new SpecialAbilityListener(this), this);
    }

    public void reload() {
        reloadConfig();
        this.cardManager.loadCards();
    }
}