Kurusutero
📎 1 file 3,717 chars
📄
pasted-code-1776776398586.txt
txt 196 lines
▶
I want you to create a high-quality Minecraft Paper/Spigot plugin (version 1.21.11) for a medieval roleplay server called Covenant SMP.

This plugin must implement a deep medieval law, crime, kingdom, and roleplay system with strong immersion, clean UI, and no unnecessary chat spam.

🧩 CORE ROLE SYSTEM

Each player has ONE role:

👑 King
Prefix: [KING]
Color: Gold
Controls the kingdom
Can promote/demote Knights
Has access to law commands
🛡️ Knight
Prefix: [KNIGHT]
Color: Blue
Law enforcement
Hunts Rebels
Cannot become Rebel
🧍 Civilian
Prefix: [CIVILIAN]
Color: Gray
Default role
Can become Rebel if committing crimes
🩸 Rebel
Prefix: [REBEL]
Color: Dark Red
Criminal class
Kill-on-sight by law
👀 ROLE VISIBILITY (VERY IMPORTANT)

Roles must be visible:

Above player heads (nametag)
In chat
In tab list

Format examples:

[KING] Username
[KNIGHT] Username
[REBEL] Username
🏰 KINGDOM SYSTEM (BetterTeams Integration)
Integrate with BetterTeams plugin
Detect player’s kingdom/team

Display format:

[KING][Avalon] Username
[KNIGHT][Eldoria] Username
Must NOT break BetterTeams features
Use API if available
🛡️ NEWBIE PROTECTION
Duration: configurable (default 2 hours)
Effects:
Cannot deal damage
Cannot receive damage
Removed if player attacks
Action bar:
"Under protection of the Crown"
⚔️ CRIME SYSTEM (CORE FEATURE)
Becoming a Rebel:
Civilian kills Civilian OR Knight → becomes Rebel
Title (ONLY FOR THAT PLAYER):
"You are now a Rebel"
"Hunted by the law for your crimes"

NO GLOBAL ANNOUNCEMENTS

🚫 ROLE IMMUNITY
King and Knights:
Cannot become Rebels
Always remain lawful
⚖️ JUSTICE SYSTEM
Conviction:

Command:

/convict 

Allowed:

King
Admins

Effect:

Rebel → Civilian

Title:

"You have been convicted"
"Your crimes have been judged"
🔒 JAIL SYSTEM (ADD THIS)
On conviction:
Optional jail time (configurable)
Teleport to jail location
Cannot break/place blocks
Cannot use commands
/setjail command to define jail location
💰 BOUNTY SYSTEM
Rebels automatically gain bounty:
Increase per kill
Increase over time
When a Rebel dies:
Killer receives bounty reward
Display:
Action bar or scoreboard
⚔️ COMBAT SYSTEM
Combat Tag:
Prevent logout during combat
Rebel Cooldown:
Prevent abuse of role switching
📊 SCOREBOARD (SIDEBAR)

Display:

Covenant SMP
Role: 
Kingdom: 
Kills: 
Deaths: 
Bounty: 

👑 KING COMMANDS (IMPORTANT)
/king promote  knight
/king demote 
/king setcolor  

Color command must:

Update chat, tab, nametag instantly
🎨 IMMERSION FEATURES (ADD MORE)
Sound Effects:
Play sound when:
Becoming Rebel
Being convicted
Promotion to Knight
Titles & Action Bars:
Minimal but impactful
🏹 OPTIONAL ADVANCED FEATURES (ADD IF POSSIBLE)
Reputation System:
Good actions → positive reputation
Crimes → negative reputation
Tax System:
King can collect taxes from kingdom members
War Mode:
Kingdom vs Kingdom toggle
Rebel Hideout (Optional):
Rebels can set hidden base
⚙️ CONFIG FILE (config.yml)

Must include:

Role colors
Prefix formats
Messages
Newbie protection duration
Jail toggle
Bounty settings
Scoreboard toggle
Sound effects toggle
🔌 PLUGIN SUPPORT

Must support:

LuckPerms
PlaceholderAPI
BetterTeams (IMPORTANT)
📦 OUTPUT REQUIRED

Provide:

Full Java plugin source code
plugin.yml
config.yml
Setup guide
Build instructions (Maven or Gradle)
🎯 FINAL GOAL

Create a deep medieval RP system where:

Players create stories naturally
Crime has real consequences
Kings feel powerful
Knights enforce law
Rebels create chaos
Kingdom identity is visible
🔥 EXTRA IDEA (OPTIONAL ADD-ON YOU CAN TELL THE AI)

If you want even MORE:

“Public execution system”
“Wanted posters (INVENTORY GUI menu)”
“Knight ranking system”
Kodari AI
KodariApr 21 at 1:13 pm 57,544 (v2)
CovenantSMP
A deep medieval roleplay plugin for Covenant SMP featuring a four-tier role system (King, Knight, Civilian, Rebel), per-player scoreboards with nametag/tab integration, a crime and justice system where civilians become Rebels upon committing crimes, bounty tracking, a full jail system, newbie protection, combat tagging, BetterTeams kingdom display, LuckPerms/PlaceholderAPI integration, and a Wanted Posters GUI. Fully configurable with sounds, role colors, messages, and bounty settings.
  • 29 files total: core managers, listeners, commands, GUI framework, integrations

  • Per-player scoreboards with Score.customName() (Paper 1.21) for live sidebar updates; scoreboard teams on each player’s board for nametag/tab colors

  • BetterTeams via reflection (no compile dependency), Paper AsyncChatEvent renderer for chat formatting, Adventure API throughout


29 files created covering the full medieval RP system: four-tier role system (King/Knight/Civilian/Rebel) with per-player scoreboards using Paper’s Score#customName() for live updates, scoreboard teams on every player’s board for nametag/tab prefix colors, AsyncChatEvent renderer for formatted chat, a crime system that automatically converts Civilians to Rebels on kill, bounty tracking with time-based increase, a configurable jail system with command/block restrictions, newbie protection with action bar display, BetterTeams integration via reflection, LuckPerms prefix sync, PlaceholderAPI (%covenant_role%, %covenant_bounty%, etc.), and a Wanted Posters GUI sorted by bounty showing all online Rebels with their stats as skull items.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
29 1,962
src/main/java/com/covenantSMP/CovenantSMP.java
package com.covenantSMP;

import com.covenantSMP.command.ConvictCommand;
import com.covenantSMP.command.KingCommand;
import com.covenantSMP.command.SetJailCommand;
import com.covenantSMP.integration.BetterTeamsIntegration;
import com.covenantSMP.integration.LuckPermsIntegration;
import com.covenantSMP.integration.PlaceholderAPIIntegration;
import com.covenantSMP.inventory.gui.GUIListener;
import com.covenantSMP.inventory.gui.GUIManager;
import com.covenantSMP.inventory.impl.WantedPostersGUI;
import com.covenantSMP.listener.CombatListener;
import com.covenantSMP.listener.JailListener;
import com.covenantSMP.listener.PlayerListener;
import com.covenantSMP.manager.BountyManager;
import com.covenantSMP.manager.CombatTagManager;
import com.covenantSMP.manager.CovenantScoreboardManager;
import com.covenantSMP.manager.JailManager;
import com.covenantSMP.manager.NewbieProtectionManager;
import com.covenantSMP.manager.PlayerDataManager;
import com.covenantSMP.manager.RoleManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class CovenantSMP extends JavaPlugin {

    private PlayerDataManager playerDataManager;
    private RoleManager roleManager;
    private CovenantScoreboardManager covenantScoreboardManager;
    private BountyManager bountyManager;
    private JailManager jailManager;
    private CombatTagManager combatTagManager;
    private NewbieProtectionManager newbieProtectionManager;
    private GUIManager guiManager;
    private LuckPermsIntegration luckPermsIntegration;
    private BetterTeamsIntegration betterTeamsIntegration;

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

        this.playerDataManager = new PlayerDataManager(this);
        this.jailManager = new JailManager(this);
        this.roleManager = new RoleManager(this);
        this.covenantScoreboardManager = new CovenantScoreboardManager(this);
        this.bountyManager = new BountyManager(this);
        this.combatTagManager = new CombatTagManager(this);
        this.newbieProtectionManager = new NewbieProtectionManager(this);
        this.guiManager = new GUIManager();
        this.luckPermsIntegration = new LuckPermsIntegration(this);
        this.betterTeamsIntegration = new BetterTeamsIntegration(this);

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

        Bukkit.getPluginManager().registerEvents(new PlayerListener(this), this);
        Bukkit.getPluginManager().registerEvents(new CombatListener(this), this);
        Bukkit.getPluginManager().registerEvents(new JailListener(this), this);
        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);

        getCommand("king").setExecutor(new KingCommand(this));
        getCommand("convict").setExecutor(new ConvictCommand(this));
        getCommand("setjail").setExecutor(new SetJailCommand(this));
        getCommand("wantedposters").setExecutor((sender, cmd, label, args) -> {
            if (!(sender instanceof Player player)) {
                sender.sendMessage("Only players can open the wanted posters.");
                return true;
            }
            guiManager.openGUI(new WantedPostersGUI(this), player);
            return true;
        });

        bountyManager.startBountyTask();
        newbieProtectionManager.startActionBarTask();
        startScoreboardUpdateTask();

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

    @Override
    public void onDisable() {
        for (Player player : Bukkit.getOnlinePlayers()) {
            playerDataManager.savePlayer(player.getUniqueId());
        }
        getLogger().info("CovenantSMP has been disabled.");
    }

    private void startScoreboardUpdateTask() {
        Bukkit.getScheduler().runTaskTimer(this, () -> {
            for (Player player : Bukkit.getOnlinePlayers()) {
                covenantScoreboardManager.updateScoreboard(player);
            }
        }, 20L, 60L);
    }
}