animeeeee_t0p
📎 1 file 3,672 chars
📄
pasted-code-1782970460624.txt
txt 47 lines
▶
Act as an expert Minecraft Paper/Bukkit plugin developer. Write a highly optimized, complete, and customizable Spigot plugin for version 1.20.1 in Java. The plugin must implement a comprehensive RolePlay system with the features listed below. 

All features, texts, permissions, rankings, and region names must be fully customizable via an external configuration file (config.yml).

### 1. Admin Chat & PM System
- `/ac `: Admin Chat. Messages are sent ONLY to players with a specific admin permission.
- `/pm  `: Accessible only by admins. Sends a private reply to the player. The player must receive the response in the exact format:
  "{message} Have a nice game on EonHorizonRP! Sincerely: administration." (Make this message fully customizable in config.yml with Hex colors).

### 2. Fraction Management System (`/fraction`)
Every subcommand (except leave and open) MUST require a player nickname.
- `/fraction invite `: Invites a player. Allowed only for Leader or Co-Leader (configurable ranks).
- `/fraction open`: Opens recruitment for the fraction (Leader/Co-leader only).
- `/fraction kick `: Dismisses a player from the fraction.
- `/fraction leave`: Leaves the current fraction.
- `/fraction setrank  `: Promotes or demotes a player's rank.
- `/fraction bl `: Adds a player to the fraction's black list.
*Requirement:* Create a separate section in the config to define every fraction, its ranks, permissions, and specific access for each rank.

### 3. Documents & RP Books
- `/checklist`: Opens an inventory/report menu (Checklist).
- `/workbook`: Opens the player's workbook.
- `/studbook`: Opens the student record book. ONLY accessible if the player has a specific "student" role/permission.
- `/pass`: Views your own passport.
- `/pass give`: Issues a passport. Can only be used ONCE per player. Upon creation, the player must fill in Name, Surname, and Gender. Other fields like "Job" and "Marital Status" (Married: Yes/No) must be updated automatically by the system based on player status.
- `/pass changename`: Changes the player's passport name (First/Last name only).
- `/pass `: Requests another player's passport. The target player must see a clickable chat message button: "[ SHOW PASSPORT ]". Clicking it executes `/pass` to show it to the requester.

### 4. Police & Economy
- `/arrest `: Arrests a player. This command MUST only work if the admin/officer is inside a specific WorldGuard region defined in the config (e.g., "prison_zone").
- `/pay  `: Transfers money from one player to another (Integrate with Vault API).

### 5. Medical System (`/med` & `/mes`)
- `/med givecard `: Issues a medical card to a player.
- `/med heal `: Heals a player.
- `/mes sell `: Sells medical supplies to a player.
- `/med card`: Opens your medical card.
- `/med card `: Opens another player's medical card. Allowed ONLY for: Doctors, Leaders, and Co-leaders of ANY fraction EXCEPT criminal fractions (define criminal fractions in config).

### 6. Administration
- `/warn  `: Gives an administrative warning to a player. Accessible only to admins.

### 7. Configuration Requirements
Generate a robust `config.yml` example. Every single text, prefix, rank permission, medical item price, arrest region name, and fraction name must be editable. Use MiniMessage or standard ChatColor formatting for deep text customization.

Provide clean, modular, and well-commented Java code. Split the commands into separate classes using CommandExecutor and TabCompleter.
Kodari AI
KodariJul 2 at 5:42 am 4

I’ll build a comprehensive RolePlay plugin with all requested features.

EonHorizonRolePlay
A comprehensive Minecraft RolePlay system featuring admin communication tools, faction management, passport/document system, police arrest system with WorldGuard integration, Vault-based economy, medical system (cards/healing/supplies), and administrative warning system. All text, permissions, factions, and prices are fully configurable via config.yml with MiniMessage color support.

Let me start building all files from scratch.

I’ll build this systematically — starting with the build config and resources, then core utilities, models, managers, commands, and GUI framework.

</create>

Now the Java source files — starting with the main plugin class, utilities, and models:

</create>

Now the managers:

</create>

Now the inventory framework:

</create>

Now the GUI implementations:

</create>

Now all the commands. Starting with AdminChat and AdminPM:

<path>src/main/java/com/eonhorizon/roleplay/commands/StudbookCommand.java</path>

</create>

Now I need to add the chat listener that handles the passport creation input. I need to add it to the main plugin class or create a listener.

</create>

Now register the ChatListener in the main class. I need to update the main class to register it.

</create>

That’s the complete project. Let me verify the file structure by checking if all created files landed correctly.

The files need to be created via tags. Let me create them properly now.

First, the build configuration:

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
37 3,237
src/main/java/com/eonhorizon/roleplay/EonHorizonRolePlay.java
package com.eonhorizon.roleplay;

import com.eonhorizon.roleplay.commands.*;
import com.eonhorizon.roleplay.inventory.gui.GUIListener;
import com.eonhorizon.roleplay.inventory.gui.GUIManager;
import com.eonhorizon.roleplay.listeners.ChatListener;
import com.eonhorizon.roleplay.managers.*;
import com.eonhorizon.roleplay.util.ConfigManager;
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 final class EonHorizonRolePlay extends JavaPlugin {

    private static EonHorizonRolePlay instance;
    private ConfigManager configManager;
    private FractionManager fractionManager;
    private PassportManager passportManager;
    private MedicalManager medicalManager;
    private WarnManager warnManager;
    private PlayerDataManager playerDataManager;
    private GUIManager guiManager;
    private Economy economy;

    @Override
    public void onEnable() {
        instance = this;

        saveDefaultConfig();
        this.configManager = new ConfigManager(this);

        this.playerDataManager = new PlayerDataManager(this);
        this.fractionManager = new FractionManager(this);
        this.passportManager = new PassportManager(this);
        this.medicalManager = new MedicalManager(this);
        this.warnManager = new WarnManager(this);
        this.guiManager = new GUIManager();

        setupVault();

        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
        Bukkit.getPluginManager().registerEvents(new ChatListener(this), this);
        registerCommands();

        getLogger().info("EonHorizonRolePlay enabled!");
    }

    @Override
    public void onDisable() {
        if (playerDataManager != null) {
            playerDataManager.saveAll();
        }
        if (fractionManager != null) {
            fractionManager.saveFractionData();
        }
        getLogger().info("EonHorizonRolePlay disabled!");
    }

    private void registerCommands() {
        getCommand("ac").setExecutor(new AdminChatCommand(this));
        getCommand("pm").setExecutor(new AdminPMCommand(this));
        getCommand("fraction").setExecutor(new FractionCommand(this));
        getCommand("fraction").setTabCompleter(new FractionCommand(this));
        getCommand("checklist").setExecutor(new ChecklistCommand(this));
        getCommand("workbook").setExecutor(new WorkbookCommand(this));
        getCommand("studbook").setExecutor(new StudbookCommand(this));
        getCommand("pass").setExecutor(new PassCommand(this));
        getCommand("pass").setTabCompleter(new PassCommand(this));
        getCommand("arrest").setExecutor(new ArrestCommand(this));
        getCommand("pay").setExecutor(new PayCommand(this));
        getCommand("med").setExecutor(new MedCommand(this));
        getCommand("med").setTabCompleter(new MedCommand(this));
        getCommand("mes").setExecutor(new MesCommand(this));
        getCommand("mes").setTabCompleter(new MesCommand(this));
        getCommand("warn").setExecutor(new WarnCommand(this));
    }

    private void setupVault() {
        if (Bukkit.getPluginManager().getPlugin("Vault") == null) {
            getLogger().warning("Vault not found — economy features disabled.");
            return;
        }
        RegisteredServiceProvider<Economy> rsp = Bukkit.getServicesManager().getRegistration(Economy.class);
        if (rsp != null) {
            economy = rsp.getProvider();
            getLogger().info("Vault economy hooked.");
        } else {
            getLogger().warning("No economy provider found.");
        }
    }

    public static EonHorizonRolePlay getInstance() {
        return instance;
    }
}