urday_68

Create a plugin where players can type /trust (username) to send a trust request to another player, and if the request is accepted, both players become a duo and one of them is asked to choose a duo name that will appear on the leaderboard as their streak name; the duo gains a daily streak that increases over time, and when they reach 1000 days, they become the “King of the SMP” with operator-like privileges, but if either player types /betrayed, the duo is broken and the streak resets, while admins can also customize or edit streak values, and the current streak should be visible in the player list (TAB menu).

Kodari AI
KodariMay 8 at 11:29 am 15,353 (v2)

I’ll create a comprehensive trust-based duo system with daily streaks, leaderboards, and TAB integration.

TrustDuoStreaks
A trust-based duo system where players form partnerships with daily streaks. Players send trust requests, choose a duo name, and build streaks together. Reaching 1000 days grants "King of the SMP" privileges with operator-like permissions. Duos can be broken with /betrayed, resetting progress. Features leaderboards, TAB integration showing current streaks, and admin tools for streak management.

Now I’ll build the complete plugin with all necessary components:

Perfect! I’ve created TrustDuoStreaks, a comprehensive trust-based duo system with the following features:

Core Features:

✅ /trust <player> - Send trust requests with 60-second expiration
✅ /trustaccept / /trustdeny - Accept or deny requests
✅ Duo name selection (30-second prompt after accepting)
✅ Daily streak system that increments every 24 hours when either player logs in
✅ /betrayed - Break duo with confirmation (resets streak)
✅ /duo info - View duo details
✅ /duo top - Leaderboard showing top 10 duos

TAB Integration:

✅ Shows [XYZd] format for regular duos
✅ Shows [KING] format when reaching 1000 days

King of the SMP (1000 days):

✅ Grants operator-like permissions (configurable in config.yml)
✅ Both players receive king status
✅ Permissions removed if streak drops below 1000 or duo breaks

Admin Commands:

✅ /duoadmin setstreak <player> <days> - Manually set streak
✅ /duoadmin breakduo <player> - Force break a duo
✅ /duoadmin reload - Reload configuration

Technical Details:

  • Persistent data storage in duos.yml

  • Automatic streak checking every minute

  • Color-coded messages throughout

  • Prevents double-duo situations

  • Request timeout handling

  • King permissions automatically granted/removed

The plugin is ready to compile and deploy!

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
17 1,116
src/main/java/com/trustduostreaks/TrustDuoStreaks.java
package com.trustduostreaks;

import com.trustduostreaks.command.*;
import com.trustduostreaks.listener.PlayerListener;
import com.trustduostreaks.manager.DataManager;
import com.trustduostreaks.manager.DuoManager;
import com.trustduostreaks.manager.StreakManager;
import com.trustduostreaks.manager.TabManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class TrustDuoStreaks extends JavaPlugin {

    private DuoManager duoManager;
    private StreakManager streakManager;
    private DataManager dataManager;
    private TabManager tabManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.dataManager = new DataManager(this);
        this.duoManager = new DuoManager(this);
        this.streakManager = new StreakManager(this);
        this.tabManager = new TabManager(this);
        
        dataManager.loadDuos();
        
        registerCommands();
        registerListeners();
        
        streakManager.startStreakCheckTask();
        
        getLogger().info("TrustDuoStreaks has been enabled!");
    }

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

    private void registerCommands() {
        getCommand("trust").setExecutor(new TrustCommand(this));
        getCommand("trustaccept").setExecutor(new TrustAcceptCommand(this));
        getCommand("trustdeny").setExecutor(new TrustDenyCommand(this));
        getCommand("betrayed").setExecutor(new BetrayedCommand(this));
        getCommand("duo").setExecutor(new DuoCommand(this));
        getCommand("duoadmin").setExecutor(new DuoAdminCommand(this));
    }

    private void registerListeners() {
        getServer().getPluginManager().registerEvents(new PlayerListener(this), this);
    }

    public void reload() {
        reloadConfig();
        dataManager.loadDuos();
        tabManager.updateAllPlayers();
    }
}