evilcuriousyt
📎 1 file 1,864 chars
📄
pasted-code-1771803699285.txt
txt 71 lines
▶
Create a modular Minecraft Paper/Spigot 1.20+ plugin called "LuckSMP-S2".

The plugin must be cleanly coded, optimized, and separated into packages (commands, listeners, managers, utils).

CORE SYSTEM: LUCK SYSTEM
- Each player has a Luck value stored in a database (YAML or SQLite).
- Default Luck: 0
- Max Luck: 1000
- Min Luck: -1000
- /luck command:
    /luck -> Shows player luck
    /luck add  
    /luck remove  
    /luck set  
- Luck affects:
    - Random drop rates
    - Rare loot chance
    - Custom rune crafting success rate
    - Critical hit chance
    - Random events (good or bad)

RANDOM LUCK EVENTS:
- Positive events (high luck):
    - Extra loot drops
    - Temporary strength/speed boost
    - Double mob drops
    - Rare item chance
- Negative events (low luck):
    - Lightning strike chance
    - Blindness effect
    - Random mob spawn
    - Item durability loss

RUNE SYSTEM (Compatible with Luck):
- Custom rune crafting INVENTORY GUI
- Crafting requires minimum Luck
- Failed craft decreases Luck
- Success increases Luck slightly
- Custom runes:
    - Freeze Rune
    - Blind Rune
    - Dash Rune
    - Teleport Rune
Each rune should use PersistentDataContainer.

SEASON 2 FEATURES:
- Daily Luck bonus
- Luck leaderboard
- Luck wipe command (for season reset)
- Config.yml for:
    - Luck event chances
    - Rune success rates
    - Max/Min Luck
    - Event messages

EXTRA:
- ActionBar messages when Luck changes
- PlaceholderAPI support (%luck%)
- Fully reloadable with /lucksmp reload
- Clean OOP structure
- No memory leaks
- Async database saving
- Optimized event listeners

Return:
- Full plugin.yml
- Main class
- All managers
- Example config.yml
- One fully coded example rune
- Example luck event system
Kodari AI
KodariFeb 22 at 11:44 pm 27,460 (v2)

I’ll create a comprehensive luck-based plugin with rune crafting, random events, and GUI systems.

LuckSMP
A comprehensive luck-based progression system for Minecraft survival multiplayer servers. Features dynamic luck values affecting gameplay events, custom rune crafting with GUI interfaces, random positive and negative events based on player luck, daily bonuses, leaderboards, full PlaceholderAPI integration, and season reset capabilities with extensive configuration options.

All files created! The LuckSMP Season 2 plugin is now complete with:

Core Features:

  • Luck system with min/max bounds (-1000 to 1000)

  • Commands: /luck, /luck daily, /luck add/remove/set, /lucksmp reload/wipe/leaderboard

  • YAML database with async saving

  • ActionBar messages for luck changes

Rune System:

  • GUI-based crafting (shift-right-click crafting table)

  • 4 fully implemented runes: Freeze, Blind, Dash, Teleport

  • Success rates based on player luck

  • PersistentDataContainer for rune identification

Event System:

  • Automatic positive events (high luck): extra drops, strength/speed boosts, rare items

  • Automatic negative events (low luck): lightning, blindness, mob spawns, durability loss

  • Configurable chances and requirements

Additional:

  • PlaceholderAPI support (%lucksmp_luck%, %lucksmp_luck_color%, %lucksmp_rank%)

  • Daily luck bonus system with cooldowns

  • Top 10 leaderboard

  • Fully reloadable configuration

  • Clean OOP structure with managers and listeners

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
29 1,949
src/main/java/com/lucksmp/plugin/LuckSMP.java
package com.lucksmp.plugin;

import com.lucksmp.plugin.commands.LuckCommand;
import com.lucksmp.plugin.commands.LuckSMPCommand;
import com.lucksmp.plugin.inventory.gui.GUIListener;
import com.lucksmp.plugin.inventory.gui.GUIManager;
import com.lucksmp.plugin.listeners.LuckEventListener;
import com.lucksmp.plugin.listeners.RuneListener;
import com.lucksmp.plugin.managers.DatabaseManager;
import com.lucksmp.plugin.managers.EventManager;
import com.lucksmp.plugin.managers.LuckManager;
import com.lucksmp.plugin.managers.RuneManager;
import com.lucksmp.plugin.placeholders.LuckPlaceholder;
import com.lucksmp.plugin.runes.impl.BlindRune;
import com.lucksmp.plugin.runes.impl.DashRune;
import com.lucksmp.plugin.runes.impl.FreezeRune;
import com.lucksmp.plugin.runes.impl.TeleportRune;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class LuckSMP extends JavaPlugin {
    
    private DatabaseManager databaseManager;
    private LuckManager luckManager;
    private RuneManager runeManager;
    private EventManager eventManager;
    private GUIManager guiManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.databaseManager = new DatabaseManager(this);
        this.luckManager = new LuckManager(this);
        this.runeManager = new RuneManager(this);
        this.eventManager = new EventManager(this);
        this.guiManager = new GUIManager();
        
        this.databaseManager.loadAllData();
        this.registerRunes();
        this.registerCommands();
        this.registerListeners();
        this.eventManager.startEventTask();
        
        if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
            new LuckPlaceholder(this).register();
            getLogger().info("PlaceholderAPI hook enabled!");
        }
        
        getLogger().info("LuckSMP S2 has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (this.eventManager != null) {
            this.eventManager.stopEventTask();
        }
        if (this.databaseManager != null) {
            this.databaseManager.saveAllData();
        }
        getLogger().info("LuckSMP S2 has been disabled!");
    }
    
    private void registerRunes() {
        this.runeManager.registerRune(new FreezeRune(this));
        this.runeManager.registerRune(new BlindRune(this));
        this.runeManager.registerRune(new DashRune(this));
        this.runeManager.registerRune(new TeleportRune(this));
    }
    
    private void registerCommands() {
        getCommand("luck").setExecutor(new LuckCommand(this));
        getCommand("lucksmp").setExecutor(new LuckSMPCommand(this));
    }
    
    private void registerListeners() {
        Bukkit.getPluginManager().registerEvents(new GUIListener(this.guiManager), this);
        Bukkit.getPluginManager().registerEvents(new RuneListener(this), this);
        Bukkit.getPluginManager().registerEvents(new LuckEventListener(this), this);
    }
    
    public void reloadPlugin() {
        reloadConfig();
        this.eventManager.stopEventTask();
        this.eventManager.startEventTask();
    }
}