ravigamer1210
📎 1 file 1,043 chars
📄
pasted-code-1774965298926.txt
txt 42 lines
▶
Core Features:

Shard Economy:
Each player has a shard balance (stored using UUID)
Data must save automatically (YAML or JSON)
No data loss on restart
Player Commands:
/shards → show your balance
/shards pay → send shards to another player
Also allow alias: /shard pay
Admin / Console Commands:
/shards give
/shards take
/shards set
PlaceholderAPI Support:
%shards_balance% → formatted balance (with commas)
%shards_raw_balance% → raw number (no commas)
Permissions:
shards.use (basic commands)
shards.pay (pay command)
shards.admin (give/take/set)
Safety:
Prevent negative balances
Prevent sending more shards than player has
Proper error messages
Messages:
Clean, colored messages (support & and hex colors)
Configurable messages.yml
Extras:
Tab completion for commands
Sounds on successful transactions
Simple and lightweight (no lag)

Output Required:

Full working plugin code (multiple classes)
plugin.yml
config.yml
messages.yml
PlaceholderAPI expansion class

Make the code beginner-friendly, well-structured, and easy to expand later.
Kodari AI
KodariMar 31 at 1:57 pm 13,161 (v2)

I’ll create a complete shard economy plugin with all the requested features.

ShardsEconomy
A lightweight shard economy plugin with PlaceholderAPI support, configurable messages, and automatic data saving. Players can check balances, send shards to others, and admins can manage player balances. Features UUID-based storage, transaction sounds, and full tab completion.

Complete shard economy plugin created!

✅ Features implemented:

  • UUID-based YAML storage with auto-save

  • Commands: /shards, /shards pay, /shards give/take/set

  • PlaceholderAPI expansion: %shards_balance% and %shards_raw_balance%

  • Permissions: shards.use, shards.pay, shards.admin

  • Full tab completion with smart suggestions

  • Transaction sounds (configurable)

  • Colored messages with hex support (&#FF5555)

  • Number formatting with commas

  • Complete safety checks (prevent negative balances, overspending, self-pay)

  • Configurable messages.yml

  • Reload command for configs

The code is beginner-friendly with clear class separation and ready to expand!

ravigamer1210

their should be nothig fore offline players

ravigamer1210

their should be nothig fore offline players when /shards give player 776 their it give a error like correct usesage offline player something

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
13 872
src/main/java/dev/shards/ShardsPlugin.java
package dev.shards;

import dev.shards.command.ShardsCommand;
import dev.shards.expansion.ShardsExpansion;
import dev.shards.manager.DataManager;
import dev.shards.manager.EconomyManager;
import dev.shards.manager.MessageManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class ShardsPlugin extends JavaPlugin {
    private DataManager dataManager;
    private MessageManager messageManager;
    private EconomyManager economyManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.messageManager = new MessageManager(this);
        this.dataManager = new DataManager(this);
        this.economyManager = new EconomyManager(this);

        getCommand("shards").setExecutor(new ShardsCommand(this));

        if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
            new ShardsExpansion(this).register();
            getLogger().info("PlaceholderAPI integration enabled");
        }

        getLogger().info("ShardsEconomy has been enabled!");
    }

    @Override
    public void onDisable() {
        if (dataManager != null) {
            dataManager.saveAllData();
        }
        getLogger().info("ShardsEconomy has been disabled!");
    }
}