kenanku_here

hey i need a plugin to connect my web to minecraft like you have a /link command and then youre minecraft account is linked with the webside.

Kodari AI
KodariFeb 16 at 6:41 pm 12,096 (v2)

I’ll create a web account linking plugin that generates unique codes for players to link their Minecraft account to your website.

WebAccountLinker
Links Minecraft player accounts to a website through a secure code verification system. Players use /link to generate a unique code, which they enter on the website to complete the link. The plugin stores linking data in a MySQL database that the website can access. Features include automatic code expiration, link management commands, and customizable messages. Supports unlinking and relinking accounts.

Plugin created! Here’s what it does:

Features:

  • Players use /link to generate a unique 6-character code valid for 10 minutes

  • Players enter the code on your website to complete the link

  • MySQL database stores link codes and account links

  • Website can query the database to verify codes and complete linking

  • /unlink command to unlink accounts

  • Admin commands to check player link status and reload config

Database Tables:

  1. linked_accounts - Stores UUID to website account mappings

  2. link_codes - Stores active link codes with expiration

Website Integration: Your website should query the link_codes table, and when a user submits a code:

  1. Check if code exists and hasn’t expired

  2. Update the row: UPDATE link_codes SET used = TRUE, website_account_id = ? WHERE code = ?

  3. The plugin automatically detects this and completes the link in-game

Configure database credentials in config.yml before running!

kenanku_here

is it for 1.21.11

Kodari AI
KodariFeb 16 at 6:42 pm 4,974 (v2)

I’ll check the project files to determine what Minecraft version this plugin targets.

Yes, this plugin should work on Minecraft 1.21.1 (note: there’s no 1.21.11 version - likely you meant 1.21.1).

Based on the project files:

  • api-version: 1.13 in plugin.yml (supports 1.13 through current versions)

  • Compiled against Spigot 1.20.1 in build.gradle

  • Uses standard Bukkit/Spigot APIs that are stable across versions

The plugin should be compatible with 1.13 - 1.21.1+ because it:

  • Uses basic API features (commands, listeners, database)

  • Doesn’t use any version-specific features

  • Has api-version set to 1.13 (enables forward compatibility)

However, I notice the plugin doesn’t use XSeries, which means if you add any material/sound/enchantment features later, you’d need to add XSeries for proper cross-version support. For now, the current functionality (linking accounts, database operations) works fine across versions.

Would you like me to update it to explicitly support 1.21.1 or add XSeries for future-proofing?

kenanku_here

i mean the minecraft paper version 1.21.11

Kodari AI
KodariFeb 16 at 6:42 pm 2,636 (v2)

I’ll check the current build.gradle to ensure it’s configured for Paper 1.21.1:

I’ll update the configuration to target Paper 1.21.1:

Updated to Paper API 1.21.1 with Java 21 toolchain and api-version 1.21 in plugin.yml.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
16 841
src/main/java/com/weblinkplugin/WebAccountLinker.java
package com.weblinkplugin;

import com.weblinkplugin.commands.LinkCommand;
import com.weblinkplugin.commands.UnlinkCommand;
import com.weblinkplugin.commands.WebLinkCommand;
import com.weblinkplugin.listeners.PlayerListener;
import com.weblinkplugin.managers.ConfigManager;
import com.weblinkplugin.managers.DatabaseManager;
import com.weblinkplugin.managers.LinkManager;
import com.weblinkplugin.managers.PlayerDataManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class WebAccountLinker extends JavaPlugin {
    
    private ConfigManager configManager;
    private DatabaseManager databaseManager;
    private PlayerDataManager playerDataManager;
    private LinkManager linkManager;
    
    @Override
    public void onEnable() {
        configManager = new ConfigManager(this);
        configManager.loadConfigs();
        
        databaseManager = new DatabaseManager(this);
        if (!databaseManager.connect()) {
            getLogger().severe("Failed to connect to database! Disabling plugin...");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }
        
        databaseManager.createTables();
        
        playerDataManager = new PlayerDataManager(this);
        linkManager = new LinkManager(this);
        
        registerCommands();
        registerListeners();
        
        getLogger().info("WebAccountLinker has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (linkManager != null) {
            linkManager.shutdown();
        }
        
        if (databaseManager != null) {
            databaseManager.disconnect();
        }
        
        getLogger().info("WebAccountLinker has been disabled!");
    }
    
    private void registerCommands() {
        getCommand("link").setExecutor(new LinkCommand(this));
        getCommand("unlink").setExecutor(new UnlinkCommand(this));
        getCommand("weblink").setExecutor(new WebLinkCommand(this));
    }
    
    private void registerListeners() {
        getServer().getPluginManager().registerEvents(new PlayerListener(this), this);
    }
}