flekmoon

Use the prompt inside of the .txt file attached to this message to start create the Minecraft cSkyPvP plugin for 1.8.8.

📎 1 file 9,731 chars
📄
pasted-code-1771548560800.txt
txt 248 lines
▶
I want you to create a Minecraft plugin called **cSkyPvP**, compatible with **Spigot 1.8.8** and **Java 8 or higher**. The plugin must include a **prestige-based PvP system**, **customizable killstreak rewards**, a **coin economy**, and **multi-world support**, where all mechanics are restricted to a specific world defined in `config.yml`.

### ✳️ Core Features:

1. Implement a **World Restriction System**: 
- The plugin should only function inside the **world defined in `config.yml`** (e.g., `world: SkyPvP`). None of the plugin's commands or mechanics should trigger outside this world. **EXCEPT FOR THE /skypvp join COMMAND.** (IMPORTANT!!)

2. Implement a **Player Data System**: (IMPORTANT!!)
   - The plugin should save the player’s location data (XYZ + Pitch + Yaw) when they run `/skypvp leave` OR Disconnects from server (PlayerQuitEvent) **WHILE OUT OF COMBAT**, and Load **ONLY** when a player enters the SkyPvP world using `/skypvp join`. Lastly, the other way to save the player’s location data (XYZ + Pitch + Yaw) is when the server is stopping. Basically, when the /stop command is sent, start saving player's data.
   - NOT affect their data or inventory outside of this world.
   - Reset killstreaks on death or void kill.
   - Keep persistent stats like kills, killstreaks, highest killstreak, deaths, coins, prestige in a YML, JSON, or database. (Whichever performs better)
   - Track and persist the following per player only in the SkyPvP world defined in `config.yml`:
     - Statistics
       - kills
       - deaths
       - killstreak (session-based/without dying)
       - highest killstreak
       - prestige
       - coins
     - Inventory Data
       - Inventory contents
       - Armor contents
     - Location Data
       - World, X, Y, Z
	   - Yaw and Pitch

3. Implement a **Coins/Economy System**:
   - Each player has a coin balance stored and accessible.
   - Admin commands to give/take coins.
   - Players can view their balance with `/skypvp coins`.
   - Coins earned by kills can be defined in `config.yml`.

   Example:
   ```yaml
   economy:
     starting-coins: 0
     kill-reward-coins: 5
     death-penalty-coins: 5

4. Implement a **Prestige System**:
   - Based solely on the player's **kills inside the SkyPvP world**.
   - Dynamically assign prestige names based on thresholds defined in `prestiges.yml`.

   Example:
   ```yaml
   Rookie:
     kills-required: 0
     displayed-prefix: "&7[Rookie]"
     rewards:
       commands:
       - "none" ## This will make that no commands will be executed.
       messages:
       - "none" ## This will make that no messages will be executed.
   Fighter:
     kills-required: 50
     displayed-prefix: "&8[Fighter]"
     rewards:
       commands:
       - "give %player% diamond_sword 1"
       messages:
       - "[SkyPvP] &fYou have reached a new prestige: %skypvp_prestige%"

5. Implement a **Killstreak System**:
   - Killstreaks should activate when a player reaches specific kill counts without dying.
   - Each streak should run a command and send a message defined in `killstreaks.yml`. This message will be sent to the **world defined in `config.yml`**

   Example:
   ```yaml
   '3':
     command: "give %player% golden_apple 1"
     message: "[SkyPvP] &bYou have a 3 killstreak!"
   '5':
     command: "give %player% diamond_sword 1"
     message: "[SkyPvP] &bYou have a 5 killstreak!"

6. Implement a **Placeholder System** (PlaceholderAPI Support):
   - These should be available via PlaceholderAPI:
     - `%skypvp_coins%` → Player's current coin balance in the SkyPvP world.
     - `%skypvp_kills%` → Player's kills in the SkyPvP world.
     - `%skypvp_deaths%` → Player's deaths in the SkyPvP world.
     - `%skypvp_prestige%` → Returns the player's current prestige.
     - `%skypvp_killstreak%` → Returns the player's current killstreak.
     - `%skypvp_highestkillstreak%` → Player's **Highest Killstreak** in the SkyPvP world.
     - `%skypvp_kdr%` → Kill/death ratio in the SkyPvP world.

7. Implement a **Kit System**:
   - Given automatically: (IMPORTANT!!)
     - On first join in SkyPvP world. First time joining the world; no previous data from that player.
     - On death (after respawn).
   - Kit items should be soulbound (not droppable -- PlayerDropItemEvent).
   - Kit items defined in `config.yml`.
   - Customizable Material, Amount, Enchantments, and Lore.

   Example:
   ```yaml
   # Material List: https://helpch.at/docs/1.8/org/bukkit/Material.html
   default-kit:
    helmet: "IRON_HELMET:1:0"
    chestplate: "IRON_CHESTPLATE:1:0"
    leggings: "IRON_LEGGINGS:1:0"
    boots: "IRON_BOOTS:1:0"
   items:
    - "IRON_SWORD:1:0"
    - "GOLDEN_APPLE:3:0"
    - "COOKED_BEEF:16:0"

8. Implement a **CombatLog System**:
   - CombatLog: If a player logs out within 15 seconds of tagging someone, they die and drop their inventory. **EXCEPT FOR THE DEFAULT-KIT**
   - Here is a list of example messages for the combat messages:
     - [SkyPvP] You have combat tagged {victim}. Do not logout!
     - [SkyPvP] You are dead! Your enemy {killer} still had {hearts} ❤ hearts remaining.
     - [SkyPvP] You killed {victim} and you still have {hearts} ❤ hearts remaining.
     - [SkyPvP] You are no longer in combat. You may logout.
   - VoidKill: If a player falls below a certain Y-level defined in `config.yml`, "they die" = enter spectator mode for a few seconds defined in `config.yml`, and their last attacker gets the kill. The last attacker gets the kills **ONLY IF**, they player that die on VoidKill was still in Combat with the attacker.
   - After death, players go into spectator for a few seconds before changing to the world's default game mode and AFTER respawning at spawn with their kit (default-kit). There is also an option to define player's game mode after spectator mode. This can be defined in `config.yml`.
   Example:
   ```yaml
   # This will be the player's game mode after respawning.
   default-gamemode: adventure #Here is the list of Game modes available: Survival, Adventure, and Creative.
   
9. Implement a **Permissions System**:
   - These should the available permissions list:
   ** Player/Default Permissions**
   - cskypvp.join
   - cskypvp.leave
   - cskypvp.ct
   - cskypvp.coins
   - cskypvp.coins.check
   - cskypvp.stats
   - cskypvp.stats.check
    
   **Admin Permissions**
   - cskypvp.admin
   - cskypvp.coins.add
   - cskypvp.coins.remove
   - cskypvp.coins.set
   - cskypvp.stats.reset

10. Implement a **Commands System**:
   - These should the available commands list:

SkyPvP Commands
- /skypvp join
* Player will be teleported the to the last location inside the SkyPvP world.

- /skypvp leave
* Player will be teleported when leaving SkyPvP and teleported to the coordinates that were set with the command `/skypvp setlobby`

- /skypvp prestiges
* Show the player the of available prestiges inside of SkyPvP.

- /skypvp coins [player]
* Shows the player the amount of coins they have.

- /skypvp ct
* Shows the player the time left in combat.

- /skypvp stats [player]
* Shows player statistics.


SkyPvP Admin Commands
- /skypvp setlobby
* Player will be teleported after executing the command `/skypvp leave`

- /skypvp setspawn
* Player will be teleported when entering the world FOR THE FIRST TIME AND/OR WHEN THE PLAYER DIES.

- /skypvp reset [player]
* Reset/Deletes ALL PLAYER STATS (e.g. kills, killstreaks, deaths, and prestige) [**NOT THE COINS**]

- /skypvp kills add [player]
* Adds kills to the player's stats

- /skypvp deaths add [player]
* Adds deaths to the player's stats

- /skypvp setprestige [player]
* Set the player's prestige

- /skypvp coins add [player]
* Adds coins to the player's balance

- /skypvp coins remove [player]
* Takes coins from the player's balance

11. **ALL PLUGIN'S MESSAGES SHOULD BE INSIDE OF THE `MESSAGES.YML`

Technical Requirements:
- Use only APIs and features available in Spigot 1.8.8.

- Fully compatible with Java 8 and above.

- Use UUID for saving player data, not player names.

- Data can be stored in YAML files (flatfile per player or central).

- All plugin logic must check that the player is in the correct SkyPvP world.

- Avoid using deprecated or unused code.

- Every listener, command, utility, and config should be:

  - Properly registered.

  - Fully functional.

  - Double-checked for correctness—no unused classes, methods, or variables.

  - Correctly formatted and commented for future maintainability.

- Please generate the entire plugin in Java:

  - All classes (main, listeners, command executors, utils)

  - Register all listeners and commands in onEnable

  - Load all configs on startup and reloadable if possible

  - Include comments explaining the purpose of each file and method

  - Be sure everything is used properly and nothing is left unused or broken


Initial Development Plan (PLAN.md)

1. Set up Maven project structure and plugin.yml.

2. Implement core systems (World restriction, Player Data, etc.).

3. Create config.yml, messages.yml, killstreaks.yml, and prestiges.yml.

3. Implement kill/death tracking + killstreak logic.

4. Create kit system with inventory lock and respawn handling.

5. Add Combat log + void kill detector.

6. Add PlaceholderAPI hook. PlaceholderAPI 2.11.6

7. Add commands + permissions handling.

8. Implement admin tools (add/reset stats, coins, etc.).

9. Validate file loading, null safety, and world checking.

10. Finalize plugin, test functionality in 1.8.8 and higher.
flekmoon

Use the prompt inside of the .txt file attached to this message to start create the Minecraft cSkyPvP plugin for 1.8.8.

📎 1 file 9,731 chars
📄
cSkyPvP Prompt.txt
txt 248 lines
▶
I want you to create a Minecraft plugin called **cSkyPvP**, compatible with **Spigot 1.8.8** and **Java 8 or higher**. The plugin must include a **prestige-based PvP system**, **customizable killstreak rewards**, a **coin economy**, and **multi-world support**, where all mechanics are restricted to a specific world defined in `config.yml`.

### ✳️ Core Features:

1. Implement a **World Restriction System**: 
- The plugin should only function inside the **world defined in `config.yml`** (e.g., `world: SkyPvP`). None of the plugin's commands or mechanics should trigger outside this world. **EXCEPT FOR THE /skypvp join COMMAND.** (IMPORTANT!!)

2. Implement a **Player Data System**: (IMPORTANT!!)
   - The plugin should save the player’s location data (XYZ + Pitch + Yaw) when they run `/skypvp leave` OR Disconnects from server (PlayerQuitEvent) **WHILE OUT OF COMBAT**, and Load **ONLY** when a player enters the SkyPvP world using `/skypvp join`. Lastly, the other way to save the player’s location data (XYZ + Pitch + Yaw) is when the server is stopping. Basically, when the /stop command is sent, start saving player's data.
   - NOT affect their data or inventory outside of this world.
   - Reset killstreaks on death or void kill.
   - Keep persistent stats like kills, killstreaks, highest killstreak, deaths, coins, prestige in a YML, JSON, or database. (Whichever performs better)
   - Track and persist the following per player only in the SkyPvP world defined in `config.yml`:
     - Statistics
       - kills
       - deaths
       - killstreak (session-based/without dying)
       - highest killstreak
       - prestige
       - coins
     - Inventory Data
       - Inventory contents
       - Armor contents
     - Location Data
       - World, X, Y, Z
	   - Yaw and Pitch

3. Implement a **Coins/Economy System**:
   - Each player has a coin balance stored and accessible.
   - Admin commands to give/take coins.
   - Players can view their balance with `/skypvp coins`.
   - Coins earned by kills can be defined in `config.yml`.

   Example:
   ```yaml
   economy:
     starting-coins: 0
     kill-reward-coins: 5
     death-penalty-coins: 5

4. Implement a **Prestige System**:
   - Based solely on the player's **kills inside the SkyPvP world**.
   - Dynamically assign prestige names based on thresholds defined in `prestiges.yml`.

   Example:
   ```yaml
   Rookie:
     kills-required: 0
     displayed-prefix: "&7[Rookie]"
     rewards:
       commands:
       - "none" ## This will make that no commands will be executed.
       messages:
       - "none" ## This will make that no messages will be executed.
   Fighter:
     kills-required: 50
     displayed-prefix: "&8[Fighter]"
     rewards:
       commands:
       - "give %player% diamond_sword 1"
       messages:
       - "[SkyPvP] &fYou have reached a new prestige: %skypvp_prestige%"

5. Implement a **Killstreak System**:
   - Killstreaks should activate when a player reaches specific kill counts without dying.
   - Each streak should run a command and send a message defined in `killstreaks.yml`. This message will be sent to the **world defined in `config.yml`**

   Example:
   ```yaml
   '3':
     command: "give %player% golden_apple 1"
     message: "[SkyPvP] &bYou have a 3 killstreak!"
   '5':
     command: "give %player% diamond_sword 1"
     message: "[SkyPvP] &bYou have a 5 killstreak!"

6. Implement a **Placeholder System** (PlaceholderAPI Support):
   - These should be available via PlaceholderAPI:
     - `%skypvp_coins%` → Player's current coin balance in the SkyPvP world.
     - `%skypvp_kills%` → Player's kills in the SkyPvP world.
     - `%skypvp_deaths%` → Player's deaths in the SkyPvP world.
     - `%skypvp_prestige%` → Returns the player's current prestige.
     - `%skypvp_killstreak%` → Returns the player's current killstreak.
     - `%skypvp_highestkillstreak%` → Player's **Highest Killstreak** in the SkyPvP world.
     - `%skypvp_kdr%` → Kill/death ratio in the SkyPvP world.

7. Implement a **Kit System**:
   - Given automatically: (IMPORTANT!!)
     - On first join in SkyPvP world. First time joining the world; no previous data from that player.
     - On death (after respawn).
   - Kit items should be soulbound (not droppable -- PlayerDropItemEvent).
   - Kit items defined in `config.yml`.
   - Customizable Material, Amount, Enchantments, and Lore.

   Example:
   ```yaml
   # Material List: https://helpch.at/docs/1.8/org/bukkit/Material.html
   default-kit:
    helmet: "IRON_HELMET:1:0"
    chestplate: "IRON_CHESTPLATE:1:0"
    leggings: "IRON_LEGGINGS:1:0"
    boots: "IRON_BOOTS:1:0"
   items:
    - "IRON_SWORD:1:0"
    - "GOLDEN_APPLE:3:0"
    - "COOKED_BEEF:16:0"

8. Implement a **CombatLog System**:
   - CombatLog: If a player logs out within 15 seconds of tagging someone, they die and drop their inventory. **EXCEPT FOR THE DEFAULT-KIT**
   - Here is a list of example messages for the combat messages:
     - [SkyPvP] You have combat tagged {victim}. Do not logout!
     - [SkyPvP] You are dead! Your enemy {killer} still had {hearts} ❤ hearts remaining.
     - [SkyPvP] You killed {victim} and you still have {hearts} ❤ hearts remaining.
     - [SkyPvP] You are no longer in combat. You may logout.
   - VoidKill: If a player falls below a certain Y-level defined in `config.yml`, "they die" = enter spectator mode for a few seconds defined in `config.yml`, and their last attacker gets the kill. The last attacker gets the kills **ONLY IF**, they player that die on VoidKill was still in Combat with the attacker.
   - After death, players go into spectator for a few seconds before changing to the world's default game mode and AFTER respawning at spawn with their kit (default-kit). There is also an option to define player's game mode after spectator mode. This can be defined in `config.yml`.
   Example:
   ```yaml
   # This will be the player's game mode after respawning.
   default-gamemode: adventure #Here is the list of Game modes available: Survival, Adventure, and Creative.
   
9. Implement a **Permissions System**:
   - These should the available permissions list:
   ** Player/Default Permissions**
   - cskypvp.join
   - cskypvp.leave
   - cskypvp.ct
   - cskypvp.coins
   - cskypvp.coins.check
   - cskypvp.stats
   - cskypvp.stats.check
    
   **Admin Permissions**
   - cskypvp.admin
   - cskypvp.coins.add
   - cskypvp.coins.remove
   - cskypvp.coins.set
   - cskypvp.stats.reset

10. Implement a **Commands System**:
   - These should the available commands list:

SkyPvP Commands
- /skypvp join
* Player will be teleported the to the last location inside the SkyPvP world.

- /skypvp leave
* Player will be teleported when leaving SkyPvP and teleported to the coordinates that were set with the command `/skypvp setlobby`

- /skypvp prestiges
* Show the player the of available prestiges inside of SkyPvP.

- /skypvp coins [player]
* Shows the player the amount of coins they have.

- /skypvp ct
* Shows the player the time left in combat.

- /skypvp stats [player]
* Shows player statistics.


SkyPvP Admin Commands
- /skypvp setlobby
* Player will be teleported after executing the command `/skypvp leave`

- /skypvp setspawn
* Player will be teleported when entering the world FOR THE FIRST TIME AND/OR WHEN THE PLAYER DIES.

- /skypvp reset [player]
* Reset/Deletes ALL PLAYER STATS (e.g. kills, killstreaks, deaths, and prestige) [**NOT THE COINS**]

- /skypvp kills add [player]
* Adds kills to the player's stats

- /skypvp deaths add [player]
* Adds deaths to the player's stats

- /skypvp setprestige [player]
* Set the player's prestige

- /skypvp coins add [player]
* Adds coins to the player's balance

- /skypvp coins remove [player]
* Takes coins from the player's balance

11. **ALL PLUGIN'S MESSAGES SHOULD BE INSIDE OF THE `MESSAGES.YML`

Technical Requirements:
- Use only APIs and features available in Spigot 1.8.8.

- Fully compatible with Java 8 and above.

- Use UUID for saving player data, not player names.

- Data can be stored in YAML files (flatfile per player or central).

- All plugin logic must check that the player is in the correct SkyPvP world.

- Avoid using deprecated or unused code.

- Every listener, command, utility, and config should be:

  - Properly registered.

  - Fully functional.

  - Double-checked for correctness—no unused classes, methods, or variables.

  - Correctly formatted and commented for future maintainability.

- Please generate the entire plugin in Java:

  - All classes (main, listeners, command executors, utils)

  - Register all listeners and commands in onEnable

  - Load all configs on startup and reloadable if possible

  - Include comments explaining the purpose of each file and method

  - Be sure everything is used properly and nothing is left unused or broken


Initial Development Plan (PLAN.md)

1. Set up Maven project structure and plugin.yml.

2. Implement core systems (World restriction, Player Data, etc.).

3. Create config.yml, messages.yml, killstreaks.yml, and prestiges.yml.

3. Implement kill/death tracking + killstreak logic.

4. Create kit system with inventory lock and respawn handling.

5. Add Combat log + void kill detector.

6. Add PlaceholderAPI hook. PlaceholderAPI 2.11.6

7. Add commands + permissions handling.

8. Implement admin tools (add/reset stats, coins, etc.).

9. Validate file loading, null safety, and world checking.

10. Finalize plugin, test functionality in 1.8.8 and higher.
Kodari AI
KodariFeb 20 at 12:59 am 31,582 (v2)

I’ll create a comprehensive cSkyPvP plugin for 1.8.8 with all the requested features.

CSkyPvP
A prestige-based PvP system for Minecraft 1.8.8+ featuring world-restricted combat mechanics, killstreak rewards, coin economy, combat logging, void kill detection, customizable kit system, and PlaceholderAPI integration. Players progress through prestige tiers based on kills, earn coins from combat, and receive rewards for killstreaks. Includes comprehensive admin tools for managing player stats and economy.

Analysis

  • Creating a multi-world PvP plugin with prestige system, combat logging, and economy

  • Using subcommand architecture for organized command handling

  • Implementing manager pattern for data, combat, kits, prestiges, and killstreaks

  • PlaceholderAPI integration for external plugin support

All files created successfully! The cSkyPvP plugin is now complete with all core features including world restriction, player data persistence, combat logging, killstreaks, prestige system, economy, kit management, and PlaceholderAPI integration for Spigot 1.8.8+.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
37 2,495
src/main/java/com/cskypvp/CSkyPvP.java
package com.cskypvp;

import com.cskypvp.commands.SkyPvPCommand;
import com.cskypvp.hooks.PlaceholderAPIHook;
import com.cskypvp.listeners.*;
import com.cskypvp.managers.*;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;

@Getter
public class CSkyPvP extends JavaPlugin {
    
    private DataManager dataManager;
    private CombatManager combatManager;
    private KitManager kitManager;
    private PrestigeManager prestigeManager;
    private KillstreakManager killstreakManager;
    private EconomyManager economyManager;
    
    private FileConfiguration messagesConfig;
    private FileConfiguration killstreaksConfig;
    private FileConfiguration prestigesConfig;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        loadConfigs();
        
        dataManager = new DataManager(this);
        combatManager = new CombatManager(this);
        kitManager = new KitManager(this);
        prestigeManager = new PrestigeManager(this);
        killstreakManager = new KillstreakManager(this);
        economyManager = new EconomyManager(this);
        
        registerCommands();
        registerListeners();
        
        if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
            new PlaceholderAPIHook(this).register();
            getLogger().info("PlaceholderAPI hook registered!");
        }
        
        getLogger().info("CSkyPvP has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (dataManager != null) {
            dataManager.saveAllData();
        }
        
        if (combatManager != null) {
            combatManager.shutdown();
        }
        
        getLogger().info("CSkyPvP has been disabled!");
    }
    
    private void loadConfigs() {
        File messagesFile = new File(getDataFolder(), "messages.yml");
        if (!messagesFile.exists()) {
            saveResource("messages.yml", false);
        }
        messagesConfig = YamlConfiguration.loadConfiguration(messagesFile);
        
        File killstreaksFile = new File(getDataFolder(), "killstreaks.yml");
        if (!killstreaksFile.exists()) {
            saveResource("killstreaks.yml", false);
        }
        killstreaksConfig = YamlConfiguration.loadConfiguration(killstreaksFile);
        
        File prestigesFile = new File(getDataFolder(), "prestiges.yml");
        if (!prestigesFile.exists()) {
            saveResource("prestiges.yml", false);
        }
        prestigesConfig = YamlConfiguration.loadConfiguration(prestigesFile);
    }
    
    private void registerCommands() {
        getCommand("skypvp").setExecutor(new SkyPvPCommand(this));
    }
    
    private void registerListeners() {
        Bukkit.getPluginManager().registerEvents(new PlayerJoinListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerQuitListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerDeathListener(this), this);
        Bukkit.getPluginManager().registerEvents(new EntityDamageByEntityListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerDropItemListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerMoveListener(this), this);
    }
    
    public void reloadConfigs() {
        reloadConfig();
        loadConfigs();
    }
    
    public String getSkyPvPWorld() {
        return getConfig().getString("world", "world_skypvp");
    }
}