mingming_07
📎 1 file 7,761 chars
📄
pasted-code-1784404829853.txt
txt 502 lines
▶
Minecraft Plugin Development Specification
Plugin Name

Bloodline Legacy

Plugin Type

Minecraft Java Plugin (Spigot/Paper)

Purpose

Create a complete marriage, relationship, and family system plugin with INVENTORY GUI management, family trees, surnames, spouse mechanics, and configurable features.

The plugin must be optimized for multiplayer servers and support PlaceholderAPI.

Main INVENTORY GUI System
Main Command
/marriage

Opening this command should open a fully customizable inventory INVENTORY GUI.

The INVENTORY GUI should contain:

Marriage information
Spouse actions
Family tree access
Surname settings
Couple features
Rewards
Relationship management

All INVENTORY GUI settings must be configurable through:

INVENTORY GUI.yml

INVENTORY GUI customization includes:

Inventory title
Slots
Items
Item names
Lore
Sounds
Click actions
Commands
Marriage System
Marriage Proposal

Command:

/marriage 

Allows one player to propose to another player.

Example:

/marriage Steve

Creates a pending marriage request.

Server Proposal Announcement

When Player1 proposes to Player2:

Broadcast message:

Player1 is proposing to Player2

The message must be configurable.

Accept Proposal

Command:

/marriage accept

When Player2 accepts:

Broadcast:

Player2 said Yes! ❤️ You two are the perfect match. Congrats!

Actions:

Create marriage relationship.
Save marriage data.
Update family database.
Unlock spouse features.
Deny Proposal

Command:

/marriage deny

When Player2 denies:

Broadcast:

Player2 said No! Honestly? Relationships are temporary. Minecraft is eternal. Let's go kill the Dragon.

Actions:

Remove pending proposal.
Do not create relationship.
Marriage Rules
Multiple Marriage Setting

Admin configurable option:

config.yml

marriage:
  allow-multiple-marriages: false

Behavior:

If false:
Player can only have one spouse.
If true:
Player can marry multiple players.
Family Protection System

Players cannot marry:

Children
Parents
Grandchildren
Grandparents
Great-grandchildren
Great-grandparents
Any direct family member

If attempted:

Display:

You cannot marry your family member! Silly!
Spouse Proximity Feature

When two married players are close:

Configurable distance:

Example:

effects:
  spouse-distance: 10

Both players receive:

Vanilla Minecraft villager breeding heart particles above their heads.

Requirements:

Only works between married players.
Must not constantly run heavy checks.
Use optimized scheduled tasks.
Family System
Child Adoption

Command:

/marriage child 

Allows a player to request another online player as their child.

Example:

/marriage child Alex

Creates child request.

Accept Child Request

Command:

/marriage child accept

Creates:

Parent -> Child

relationship.

Deny Child Request

Command:

/marriage child deny

Rejects request.

Disown Child

Command:

/marriage disown 

Removes child relationship.

Leave Parents

Command:

/marriage leaveparents

Removes the player from their parent's family tree.

Family Tree INVENTORY GUI

Command:

/marriage tree

Opens an interactive family tree INVENTORY GUI.

Family Tree Display

Each family member should appear as:

Player head item
Player name
Relationship description

Example:

[PLAYER HEAD]

Steve

Father
Hover Information

When hovering over a family member's head:

Display:

Example:

Name: Steve

Relationship:
Father

Generation:
1

Family:
Direct Relative

Supported relationship labels:

Spouse
Mother
Father
Child
Grandchild
Great-grandchild
Grandparent
Great-grandparent
Sibling
Family Tree Visibility

Every member of the family can view the complete family tree.

Example:

Family:

Steve
 |
Alex
 |
Child

Visibility:

Steve sees Alex and Child.
Alex sees Steve and Child.
Child sees Steve and Alex.
Surname System
Add Surname

Command:

/marriage surname

Allows players to add a surname.

Example:

Before:

Steve

After:

Steve Johnson
Toggle Surname

Command:

/marriage surname toggle

Allows players to enable/disable surname display.

Surname Display Locations

Surname must appear in:

Chat
Player name
Tab list
Scoreboard
PlaceholderAPI Support

Create PlaceholderAPI expansion.

Required placeholder:

%marriage_surname%

Returns:

Johnson

Additional placeholders:

%marriage_partner%
%marriage_status%
%marriage_gender%
%marriage_children%
%marriage_family_size%
Player Commands
Marriage Commands
Command	Description
/marriage 	Send marriage proposal
/marriage accept	Accept proposal
/marriage deny	Deny proposal
/marriage info	View marriage information
/marriage divorce	Divorce spouse
/marriage gender 	Set gender
/marriage chat	Toggle private spouse chat
/marriage sethome	Set couple home
/marriage home	Teleport to couple home
/marriage chest	Open shared chest
/marriage gift	Give held item to spouse
/marriage kiss	Kiss spouse nearby
/marriage tp	Teleport to spouse
/mm 	Private spouse message
/marriage daily	Claim couple rewards
/marriage child 	Adopt child request
/marriage child accept	Accept child request
/marriage child deny	Deny child request
/marriage disown 	Remove child
/marriage leaveparents	Leave family
/marriage tree	Open family tree
Admin Commands
Reload Plugin

Command:

/marriage reload

Permission:

xmarriage.admin

Reloads:

config.yml
messages.yml
INVENTORY GUI.yml
Permissions
Admin Permission
xmarriage.admin

Allows:

Reload command
Administrative controls
Teleport Permission
xmarriage.teleport

Allows:

/marriage tp

Default:

true
Configuration Files
config.yml

Controls:

Enable/disable features
Multiple marriages
Spouse effect distance
Particle effects
Cooldowns
Proposal expiration
Family settings
Rewards
Teleport settings
Storage settings

Example:

marriage:
  allow-multiple-marriages: false

effects:
  hearts-enabled: true
  distance: 10

family:
  max-generation-depth: 10
messages.yml

Contains every player-facing message.

Requirements:

100% customizable
Supports Minecraft color codes
Supports hex colors

Example:

proposal:
  sent: "&d%player% is proposing to %target%"

family:
  blocked: "&cYou cannot marry your family member! Silly!"
INVENTORY GUI.yml

Controls:

All inventory GUIs
Items
Slots
Titles
Sounds
Click actions
Lore
Optimization Requirements

The plugin must be optimized for large servers.

Implementation requirements:

Avoid checking every player every tick.
Use scheduled async tasks where possible.
Cache marriage and family data.
Save data asynchronously.
Prevent memory leaks.
Use efficient database queries.
Support SQLite and MySQL.
Avoid unnecessary INVENTORY GUI rebuilding.
Handle thousands of players efficiently.
Database Structure

Recommended tables:

Players
uuid
username
gender
surname
surname_enabled
Marriage
player_uuid
partner_uuid
created_date
Family
parent_uuid
child_uuid
relationship
generation
Settings
uuid
private_chat_enabled
Final Goal

Create a complete Minecraft RPG/SMP relationship plugin featuring:

✅ Marriage
✅ Proposals
✅ Divorce
✅ Couple mechanics
✅ Family trees
✅ Child adoption
✅ Surnames
✅ PlaceholderAPI
✅ INVENTORY GUI management
✅ Configurable messages
✅ Optimized performance
✅ Database support
✅ Admin controls

The final plugin should feel like a polished social/family system for Minecraft survival servers.
Kodari AI
KodariJul 18 at 8:02 pm 16
BloodlineLegacy
Bloodline Legacy provides a complete social relationship system for Minecraft survival servers. Players can propose, marry, divorce, adopt children, manage family trees, configure surnames, use spouse chat, share homes and chests, exchange gifts, teleport to partners, claim daily couple rewards, and interact through customizable inventory GUIs. The plugin includes configurable marriage rules, family protection, proximity heart effects, SQLite and MySQL storage, asynchronous persistence, optimized relationship checks, PlaceholderAPI support, permissions, reloadable messages, and extensive administrative controls.

Implementation plan:

  1. Create Gradle metadata, plugin descriptors, configuration, messages, and GUI definitions.

  2. Build profile, family, relationship, storage, and database management.

  3. Add marriage commands, spouse chat, GUI framework, menus, and family-tree views.

  4. Add listeners, proximity effects, surname updates, PlaceholderAPI, and plugin bootstrap.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
settings.gradle
Code
28 2,238
src/main/java/com/kodari/bloodlinelegacy/BloodlineLegacy.java
package com.kodari.bloodlinelegacy;

import com.kodari.bloodlinelegacy.command.MarriageCommand;
import com.kodari.bloodlinelegacy.gui.GUIListener;
import com.kodari.bloodlinelegacy.gui.GUIManager;
import com.kodari.bloodlinelegacy.listener.NameManager;
import com.kodari.bloodlinelegacy.listener.RelationshipListener;
import com.kodari.bloodlinelegacy.manager.RelationshipManager;
import com.kodari.bloodlinelegacy.placeholder.BloodlinePlaceholderExpansion;
import com.kodari.bloodlinelegacy.storage.DatabaseManager;
import com.kodari.bloodlinelegacy.task.SpouseEffectTask;
import com.kodari.bloodlinelegacy.util.MessageService;
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;
import java.io.IOException;

public class BloodlineLegacy extends JavaPlugin {
    private MessageService messages;
    private FileConfiguration guiConfig;
    private File guiFile;
    private DatabaseManager database;
    private RelationshipManager relationships;
    private GUIManager guiManager;
    private NameManager names;
    private SpouseEffectTask effectTask;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        saveResource("messages.yml", false);
        saveResource("inventory-gui.yml", false);

        guiFile = new File(getDataFolder(), "inventory-gui.yml");
        guiConfig = YamlConfiguration.loadConfiguration(guiFile);
        messages = new MessageService(this,
                YamlConfiguration.loadConfiguration(new File(getDataFolder(), "messages.yml")));

        database = new DatabaseManager(this);
        database.initialize();

        relationships = new RelationshipManager(this, database, messages);
        relationships.load();
        guiManager = new GUIManager();
        names = new NameManager(relationships);

        MarriageCommand command = new MarriageCommand(this);
        getCommand("marriage").setExecutor(command);
        getCommand("marriage").setTabCompleter(command);
        getCommand("mm").setExecutor(command);
        getCommand("mm").setTabCompleter(command);

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

        effectTask = new SpouseEffectTask(this);
        long interval = Math.max(1L, getConfig().getLong("effects.interval-ticks", 20L));
        effectTask.runTaskTimer(this, interval, interval);

        if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) {
            new BloodlinePlaceholderExpansion(this).register();
        }

        getLogger().info("Bloodline Legacy enabled.");
    }

    @Override
    public void onDisable() {
        if (effectTask != null) {
            effectTask.cancel();
        }
        if (relationships != null) {
            relationships.saveNow();
        }
    }

    public void reloadPlugin() {
        reloadConfig();
        guiConfig = YamlConfiguration.loadConfiguration(guiFile);
        messages.reload(YamlConfiguration.loadConfiguration(new File(getDataFolder(), "messages.yml")));
    }

    public FileConfiguration getGuiConfig() {
        return guiConfig;
    }

    public MessageService getMessages() {
        return messages;
    }

    public RelationshipManager getRelationships() {
        return relationships;
    }

    public GUIManager getGuiManager() {
        return guiManager;
    }

    public NameManager getNames() {
        return names;
    }
}