clovicdev

build me a clone of ZedarMC Core plugin

Kodari AI
KodariMay 16 at 10:54 pm 22,612 (v2)

I’ll search for information about ZedarMC Core plugin to understand its features and build a clone.I’ll create a comprehensive SMP core plugin based on ZedarMC’s system with quality levels, dynamic economy, and base management.

ZedarCore
An advanced SMP core plugin featuring a quality-level system for crops, ores, fish, and mob drops that enhances gameplay progression. Players gain quality levels by grinding activities, with higher quality items selling for more. Includes a dynamic shop system with supply-demand pricing that fluctuates based on market activity, and a base management system allowing players to claim and teleport to their starter bases. Full economy integration and persistent data tracking.

Now I’ll build the complete plugin structure with all core features:

Complete ZedarCore plugin created with all features from the original! Includes:

Core Systems:

  • Quality level progression for farming, mining, fishing, and combat

  • Dynamic shop with supply/demand pricing that adjusts based on market activity

  • Base management with auto-generation, teleportation, and cooldowns

Features:

  • XP gain from breaking blocks, fishing, and killing mobs

  • Quality tiers (Common → Legendary) that increase sell prices

  • Shop GUI with buy/sell functionality

  • Price recovery system that slowly returns to base prices

  • Starter base with platform, walls, and chest of supplies

  • Vault economy integration

  • Full data persistence with auto-save

Commands:

  • /quality - View quality levels and progress

  • /shop - Open dynamic shop GUI

  • /base create/home/info - Base management

  • /zedarcore - Admin commands (reload, save, setquality, resetprices)

All data persists to data.yml and prices dynamically adjust based on player trading activity!

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
23 1,701
src/main/java/com/zedarmc/core/ZedarCore.java
package com.zedarmc.core;

import com.zedarmc.core.base.BaseManager;
import com.zedarmc.core.commands.*;
import com.zedarmc.core.data.DataManager;
import com.zedarmc.core.listeners.*;
import com.zedarmc.core.quality.QualityManager;
import com.zedarmc.core.shop.ShopManager;
import lombok.Getter;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class ZedarCore extends JavaPlugin {
    
    private QualityManager qualityManager;
    private ShopManager shopManager;
    private BaseManager baseManager;
    private DataManager dataManager;
    private Economy economy;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        if (!setupEconomy()) {
            getLogger().warning("Vault not found! Economy features will be limited.");
        }
        
        this.dataManager = new DataManager(this);
        this.qualityManager = new QualityManager(this);
        this.shopManager = new ShopManager(this);
        this.baseManager = new BaseManager(this);
        
        dataManager.load();
        
        registerCommands();
        registerListeners();
        
        startAutoSave();
        
        getLogger().info("ZedarCore has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (dataManager != null) {
            dataManager.save();
        }
        
        getLogger().info("ZedarCore has been disabled!");
    }
    
    private boolean setupEconomy() {
        if (getServer().getPluginManager().getPlugin("Vault") == null) {
            return false;
        }
        
        RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
        if (rsp == null) {
            return false;
        }
        
        economy = rsp.getProvider();
        return economy != null;
    }
    
    private void registerCommands() {
        getCommand("quality").setExecutor(new QualityCommand(this));
        getCommand("shop").setExecutor(new ShopCommand(this));
        getCommand("base").setExecutor(new BaseCommand(this));
        getCommand("zedarcore").setExecutor(new AdminCommand(this));
    }
    
    private void registerListeners() {
        Bukkit.getPluginManager().registerEvents(new BlockBreakListener(this), this);
        Bukkit.getPluginManager().registerEvents(new FishingListener(this), this);
        Bukkit.getPluginManager().registerEvents(new EntityDeathListener(this), this);
        Bukkit.getPluginManager().registerEvents(new ShopGUIListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerMoveListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerJoinListener(this), this);
    }
    
    private void startAutoSave() {
        int interval = getConfig().getInt("database.auto-save-interval", 6000);
        Bukkit.getScheduler().runTaskTimerAsynchronously(this, () -> {
            dataManager.save();
        }, interval, interval);
    }
    
    public String getMessage(String path) {
        String prefix = getConfig().getString("messages.prefix", "&8[&6Zedar&eCore&8] &r");
        String message = getConfig().getString("messages." + path, "&cMessage not found: " + path);
        return colorize(prefix + message);
    }
    
    public String getMessageRaw(String path) {
        return colorize(getConfig().getString("messages." + path, "&cMessage not found: " + path));
    }
    
    public String colorize(String text) {
        return text.replace("&", "§");
    }
}