deadlyvoid1
📎 1 file 3,238 chars
📄
pasted-code-1782903877522.txt
txt 133 lines
▶
Create a Minecraft 1.21.1 Spigot plugin called **SoulSMP**.

## Core System

* Every player starts with **3 Souls** when they join the server for the first time.
* A player's current Soul count should be stored permanently and survive server restarts.
* The maximum number of Souls a player can have is configurable in the config file (default: 10).
* The minimum number of Souls is 0.

## Death System

* When a player dies, they lose 1 Soul.
* If a player is killed by another player:

  * The killer gains 1 Soul.
  * The victim loses 1 Soul.
* If a player dies from natural causes such as lava, fall damage, mobs, drowning, or explosions:

  * They lose 1 Soul.
  * No player gains a Soul.

## Elimination System

* If a player's Souls reach 0:

  * Instantly kick the player with the message:
    "You have lost all your Souls."
  * Ban the player for a configurable amount of time.
  * Default ban time should be 24 hours.
  * Support permanent bans if configured.

## Soul Recovery

* Add a custom item called **Soul Fragment**.
* Soul Fragments can be obtained from:

  * Custom bosses.
  * Server events.
  * Admin commands.
* Nine Soul Fragments can be crafted into a **Soul Crystal**.
* Using a Soul Crystal grants the player 1 Soul.
* Players cannot exceed the configured maximum Soul limit.

## Commands

* `/souls`

  * Shows the player's current Soul count.
* `/souls check `

  * Shows another player's Soul count.
* `/souls give  `

  * Gives Souls to a player.
* `/souls remove  `

  * Removes Souls from a player.
* `/souls set  `

  * Sets a player's Soul count.
* `/souls reload`

  * Reloads the plugin configuration.

## Permissions

* souls.admin

  * Access to all admin commands.
* souls.check

  * Allows checking other players' Souls.

## User Interface

* Display the player's Soul count in:

  * The tab list.
  * A scoreboard.
  * An optional action bar message.
* Show a title when Souls are gained:

  * "+1 Soul"
* Show a title when Souls are lost:

  * "-1 Soul"
* Play sounds and particles for gaining and losing Souls.

## Config Options

Allow configuration for:

* Starting Souls.
* Maximum Souls.
* Ban duration.
* Messages.
* Sounds.
* Particle effects.
* Scoreboard toggle.
* Action bar toggle.
* Soul Crystal recipe.

## Placeholder Support

Add PlaceholderAPI support:

* `%soulsmp_souls%`
* `%soulsmp_max_souls%`
* `%soulsmp_status%`

## Vault Integration

* Add optional Vault support.
* Allow admins to sell Soul Fragments or Soul Crystals through shop plugins.

## Performance Requirements

* Plugin must be optimized for large SMP servers.
* Avoid memory leaks.
* Use asynchronous saving where appropriate.
* Support Minecraft 1.21.1 Spigot and Paper.

## Nice Extra Features

* Kill streak rewards.
* Daily Soul rewards.
* Bosses dropping Soul Fragments.
* Broadcast messages when players are eliminated.
* Leaderboard showing players with the most Souls.
* Configurable sounds and messages for every event.

The plugin should be clean, configurable, optimized, and suitable for a public SMP server.
Kodari AI
KodariJul 1 at 11:10 am 3

I’ll build SoulSMP — a complete souls-based SMP plugin with all requested features.

SoulSMP
SoulSMP is a souls-based SMP plugin where every player starts with 3 souls. Players lose souls on death and gain them on PvP kills. Elimination at 0 souls triggers configurable bans. Features Soul Fragments crafted into Soul Crystals, tab/scoreboard/actionbar displays, PlaceholderAPI expansions, Vault economy hooks, daily rewards, kill streaks, leaderboards, and full configuration. Optimized for large servers with async SQLite storage.

Let me create all files now.

deadlyvoid1

remove ScoreBoard and Dailt Soul Rewards and make Cmd More better by adding suggestions like when i type Soul Then They will Suggest me Other option

Kodari AI
KodariJul 1 at 11:52 am 4

Now let me apply all the changes. I’ll rewrite the files with major changes and patch the smaller ones.

Now I’ll apply all changes in parallel: remove scoreboard/daily reward, add tab completion to the command, and update everything

The second search was from SoulSMP.java, not SoulCommand.java. Let me fix both files properly.

Now update config.yml and plugin.yml

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
16 1,681
src/main/java/com/soulsmp/SoulSMP.java
package com.soulsmp;

import com.soulsmp.command.SoulCommand;
import com.soulsmp.config.ConfigManager;
import com.soulsmp.crafting.SoulCrystalRecipe;
import com.soulsmp.data.DataManager;
import com.soulsmp.display.DisplayManager;
import com.soulsmp.integration.PlaceholderExpansion;
import com.soulsmp.integration.VaultHook;
import com.soulsmp.listener.DeathListener;
import com.soulsmp.listener.JoinListener;
import com.soulsmp.listener.SoulCrystalListener;
import com.soulsmp.manager.SoulManager;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public class SoulSMP extends JavaPlugin {

    private ConfigManager configManager;
    private DataManager dataManager;
    private SoulManager soulManager;
    private DisplayManager displayManager;
    private VaultHook vaultHook;

    public ConfigManager getConfigManager() {
        return configManager;
    }

    public DataManager getDataManager() {
        return dataManager;
    }

    public SoulManager getSoulManager() {
        return soulManager;
    }

    public DisplayManager getDisplayManager() {
        return displayManager;
    }

    public VaultHook getVaultHook() {
        return vaultHook;
    }

    @Override
    public void onEnable() {
        saveDefaultConfig();

        this.configManager = new ConfigManager(this);
        this.dataManager = new DataManager(this);
        this.soulManager = new SoulManager(this);
        this.displayManager = new DisplayManager(this);

        // Initialize database
        dataManager.initDatabase();
        getLogger().info("Database initialized.");

        // Register listeners
        Bukkit.getPluginManager().registerEvents(new JoinListener(this), this);
        Bukkit.getPluginManager().registerEvents(new DeathListener(this), this);
        Bukkit.getPluginManager().registerEvents(new SoulCrystalListener(this), this);

        // Register command
        SoulCommand soulCommand = new SoulCommand(this);
        getCommand("souls").setExecutor(soulCommand);
        getCommand("souls").setTabCompleter(soulCommand);

        // Register crafting recipe
        new SoulCrystalRecipe(this).register();

        // Start display tasks
        displayManager.startDisplayTasks();

        // Hook PlaceholderAPI
        if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
            new PlaceholderExpansion(this).register();
            getLogger().info("Hooked into PlaceholderAPI.");
        }

        // Hook Vault
        this.vaultHook = new VaultHook(this);

        getLogger().info("SoulSMP v" + getDescription().getVersion() + " enabled!");
    }

    @Override
    public void onDisable() {
        // Save all cached data
        if (soulManager != null) {
            Bukkit.getOnlinePlayers().forEach(player ->
                soulManager.unloadPlayer(player.getUniqueId())
            );
        }
        if (dataManager != null) {
            dataManager.close();
        }
        getLogger().info("SoulSMP disabled.");
    }
}