gra.kys
๐Ÿ“Ž 1 file 1,223 chars
๐Ÿ“„
pasted-code-1773223973673.txt
txt 53 lines
โ–ถ
Create a Minecraft Paper plugin for version 1.21+ called PepeEconomy.

The plugin must include an integrated Discord bot using the Java Discord API (JDA).

Requirements:

1. When the plugin starts, it must start a Discord bot using a token from config.yml.
2. The plugin must connect to a MySQL database.
3. Database configuration must be read from config.yml.

Tables:

accounts:
uuid VARCHAR(36) PRIMARY KEY
discord_id VARCHAR(32)
balance INT DEFAULT 0

link_codes:
code VARCHAR(16)
discord_id VARCHAR(32)
expire BIGINT

Minecraft commands:

/pepe link 
/pepe unlink
/pepe balance
/pepe pay  

Discord commands:

/pepe-link
/pepe-balance
/pepe-pay
/pepe-cf

The Discord command /pepe-link must generate a random code and insert it into the link_codes table. The Minecraft command /pepe link  must verify and link the player's UUID to the Discord ID.

Use asynchronous database queries and prepared statements.

Use JDA for Discord integration.

Plugin structure:

PepeEconomy
โ”œ main plugin class
โ”œ database manager
โ”œ economy manager
โ”œ discord manager
โ”œ command handlers

Return the full Java source code including plugin.yml and config.yml.
Kodari AI
KodariMar 11 at 10:16 am 18,254 (v2)

Iโ€™ll create a comprehensive PepeEconomy plugin with Discord integration, MySQL database, and economy system.

PepeEconomy
A Minecraft economy plugin with Discord integration allowing players to link their accounts, manage balances, and perform transactions across both platforms. Features include account linking via temporary codes, balance checking, player-to-player payments, and Discord-based coinflip gambling. Uses MySQL for persistent storage and JDA for Discord bot functionality.

Iโ€™ll create a comprehensive PepeEconomy plugin with Discord bot integration, MySQL database, and a full economy system.

All files created successfully! The PepeEconomy plugin is now complete with:

Core Features:

  • MySQL database with HikariCP connection pooling

  • Async database operations with prepared statements

  • Discord bot integration using JDA

  • Account linking system with temporary codes

  • Full economy system with balances and transfers

Minecraft Commands:

  • /pepe link <code> - Link Discord account

  • /pepe unlink - Unlink Discord account

  • /pepe balance - Check balance

  • /pepe pay <player> <amount> - Pay another player

Discord Commands:

  • /pepe-link - Generate linking code

  • /pepe-balance - Check balance

  • /pepe-pay <user> <amount> - Pay another Discord user

  • /pepe-cf <amount> - Coinflip gambling

Setup Instructions:

  1. Edit config.yml with your Discord bot token, guild ID, and MySQL credentials

  2. Create the MySQL database specified in config

  3. Build with Gradle and place in plugins folder

  4. Restart server - tables will be created automatically

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
13 903
src/main/java/com/example/pepeeconomy/PepeEconomy.java
package com.example.pepeeconomy;

import com.example.pepeeconomy.commands.PepeCommand;
import com.example.pepeeconomy.database.DatabaseManager;
import com.example.pepeeconomy.discord.DiscordManager;
import com.example.pepeeconomy.economy.EconomyManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public final class PepeEconomy extends JavaPlugin {
    
    private DatabaseManager databaseManager;
    private EconomyManager economyManager;
    private DiscordManager discordManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.databaseManager = new DatabaseManager(this);
        databaseManager.connect();
        
        this.economyManager = new EconomyManager(this);
        
        this.discordManager = new DiscordManager(this);
        discordManager.start();
        
        PepeCommand pepeCommand = new PepeCommand(this);
        getCommand("pepe").setExecutor(pepeCommand);
        getCommand("pepe").setTabCompleter(pepeCommand);
        
        getLogger().info("PepeEconomy has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (discordManager != null) {
            discordManager.shutdown();
        }
        
        if (databaseManager != null) {
            databaseManager.disconnect();
        }
        
        getLogger().info("PepeEconomy has been disabled!");
    }
}