MihneaShaff

make a /marry plugin with a chat placeholder which is empty if not married but if married it shows a heart + a space and when you hover you can see who the player is married to. when players are close like 5 blocks distance, async particles show up. only admins can marry or divorce 2 people. particles can be toggled by the couple. CafeMarry plugin version 1.21.8 paper plugin

Kodari AI
KodariApr 15 at 10:24 pm 10,758 (v2)

I’ll create a marriage plugin with admin-controlled marriages, proximity particles, and chat placeholders with hover text.

CafeMarry
A Paper marriage plugin where admins can marry or divorce players. Features a chat placeholder showing a heart symbol with hover text revealing the spouse name, proximity-based particle effects when married couples are nearby, and toggleable particles. Integrates with PlaceholderAPI for chat integration and uses Paper's Adventure API for rich text components.

All files created! The plugin features:

  • Admin-only /marry <player1> <player2> and /marry divorce <player1> <player2> commands

  • /marry toggle for players to control their particle effects

  • Hover text in chat showing spouse name when hovering over the heart symbol

  • Async particle effects when married couples are within 5 blocks

  • PlaceholderAPI integration with %cafemarry_heart% and %cafemarry_spouse% placeholders

  • Full configuration support with customizable particles and messages

MihneaShaff

%cafemarry_heart% should be a heart as is now but when hovering you can see who is their partner. also implement a sqlite database to store the toggle and married people

Kodari AI
KodariApr 15 at 10:26 pm 9,969 (v2)

I’ll read the existing files to understand the current structure, then implement SQLite database storage and add hover functionality to the heart placeholder.

I’ll implement SQLite database storage and add hover text to the heart placeholder showing the partner’s name.

Implemented SQLite database storage and hover text for the heart placeholder!

Changes made:

  • Created DatabaseManager with SQLite for storing marriages and particle toggles

  • Updated MarriageManager to use the database instead of YAML files

  • Modified %cafemarry_heart% placeholder to return JSON text component with hover showing partner’s name

  • Added sqlite-jdbc dependency and manifest entry

The heart placeholder now returns JSON format that shows the partner’s name on hover (compatible with most modern chat plugins that support JSON text components). All marriage and toggle data is now stored in marriages.db SQLite database.

MihneaShaff

dont listen to chat at all, make all the logic be inside placeholderapi placeholder

Kodari AI
KodariApr 15 at 10:28 pm 3,912 (v2)

I’ll read the current files to understand the chat functionality and move it to PlaceholderAPI placeholders.

I’ll remove the chat listener functionality and keep all logic in PlaceholderAPI placeholders so server admins can use them with their chat plugin of choice.

Chat listener removed. All functionality is now handled through PlaceholderAPI placeholders: %cafemarry_heart% provides the JSON hover heart icon, and %cafemarry_spouse% shows the partner name. Server admins can integrate these with any chat formatting plugin.

MihneaShaff

make sure all is async and lag free

Kodari AI
KodariApr 15 at 10:29 pm 15,865 (v2)

I’ll analyze the plugin and convert all blocking operations to async to ensure it’s lag-free.

I’ll convert all blocking operations to async to ensure zero lag:

All database operations are now fully async using CompletableFuture, particle task runs asynchronously with sync particle spawning, and all blocking I/O is off the main thread for zero lag.

MihneaShaff

use mini message for the placeholder, make the marry message multi line, to marry u should do /marry marry. as for particle use minecraft:cherry_leaves and make it spawn in a small range randomly close to the player and faster

Kodari AI
KodariApr 15 at 10:42 pm 10,754 (v2)

I’ll read all the existing files first to understand the current implementation.

I’ll update the plugin to use MiniMessage for placeholders, make the marry message multi-line, change the command to /marry marry, and use cherry_leaves particles that spawn randomly in a small range around the player at a faster rate.

All changes complete! The plugin now:

  • Uses MiniMessage format for the placeholder (%cafemarry_heart% with hover text)

  • Shows a multi-line marry message with decorative borders

  • Requires /marry marry <player1> <player2> to marry players

  • Spawns minecraft:cherry_leaves particles randomly in a small range (±0.5 blocks) around players at a faster rate (every 5 ticks instead of 10)

MihneaShaff

make a separate colored placeholder that is colored in red, has a heart and says \n married to: name if married, if not just empty

MihneaShaff

make the particles async and fix error

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
12 881
src/main/java/com/cafe/cafemarry/CafeMarry.java
package com.cafe.cafemarry;

import com.cafe.cafemarry.commands.MarriageCommand;
import com.cafe.cafemarry.managers.ConfigManager;
import com.cafe.cafemarry.managers.DatabaseManager;
import com.cafe.cafemarry.managers.MarriageManager;
import com.cafe.cafemarry.placeholders.MarriagePlaceholder;
import com.cafe.cafemarry.tasks.ParticleTask;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public final class CafeMarry extends JavaPlugin {

    private ConfigManager configManager;
    private DatabaseManager databaseManager;
    private MarriageManager marriageManager;
    private MarriagePlaceholder placeholder;
    private ParticleTask particleTask;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.configManager = new ConfigManager(this);
        this.databaseManager = new DatabaseManager(this);
        
        databaseManager.connect();
        
        this.marriageManager = new MarriageManager(this);
        
        marriageManager.loadMarriagesAsync().thenRun(() -> {
            getLogger().info("Marriages loaded successfully!");
        });
        
        getCommand("marry").setExecutor(new MarriageCommand(this));
        
        if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
            this.placeholder = new MarriagePlaceholder(this);
            placeholder.register();
        }
        
        if (configManager.isParticlesEnabled()) {
            this.particleTask = new ParticleTask(this);
            particleTask.runTaskTimerAsynchronously(this, 20L, 5L);
        }
        
        getLogger().info("CafeMarry enabled successfully!");
    }

    @Override
    public void onDisable() {
        if (placeholder != null) {
            placeholder.unregister();
        }
        
        if (particleTask != null) {
            particleTask.cancel();
        }
        
        if (databaseManager != null) {
            databaseManager.disconnect();
        }
        
        getLogger().info("CafeMarry disabled successfully!");
    }

    public void reload() {
        reloadConfig();
        configManager = new ConfigManager(this);
        
        marriageManager.loadMarriagesAsync().thenRun(() -> {
            getLogger().info("Marriages reloaded successfully!");
        });
        
        if (particleTask != null) {
            particleTask.cancel();
        }
        
        if (configManager.isParticlesEnabled()) {
            particleTask = new ParticleTask(this);
            particleTask.runTaskTimerAsynchronously(this, 20L, 5L);
        }
    }
}