thewixaj

build 1 plugin to send my discord link in chatbox for player with sound if player use /discord command

Kodari AI
KodariMay 8 at 4:04 pm 3,646 (v2)

I’ll create a simple Discord link plugin with a command that sends a configurable message and plays a sound.

DiscordLink
A lightweight plugin that provides players with your Discord server invite link through a simple command. When players use /discord, they receive a customizable clickable message in chat along with a notification sound. Features include fully configurable messages with color support, customizable sound effects, and clickable links that open directly in the player's browser.

Done! Created DiscordLink - a simple plugin that sends your Discord invite link when players use /discord.

Features:

  • /discord command (alias: /dc) sends clickable Discord link

  • Plays notification sound (customizable)

  • Fully configurable messages with color code support

  • Link opens in browser when clicked

Config highlights:

  • Set your Discord invite URL

  • Customize the message and colors

  • Configure sound type, volume, and pitch

  • Option to disable sound

Just edit config.yml to add your actual Discord invite link and customize the message!

thewixaj

so i need reload command to reload my config file and add /store with new category in config.yml

Kodari AI
KodariMay 8 at 4:16 pm 4,575 (v2)

I’ll add a reload command and a /store command with its own config section.

Done! Added:

  • /reload (or /discordlink reload) - Reloads the config file (requires discordlink.reload permission)

  • /store - Sends clickable store link with customizable message and sound

The config now has a separate store-link, store-message, and store-sound section you can customize independently from Discord!

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
7 233
src/main/java/me/discordlink/DiscordLinkPlugin.java
package me.discordlink;

import org.bukkit.plugin.java.JavaPlugin;

public class DiscordLinkPlugin extends JavaPlugin {

    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        DiscordCommand discordCommand = new DiscordCommand(this);
        getCommand("discord").setExecutor(discordCommand);
        
        StoreCommand storeCommand = new StoreCommand(this);
        getCommand("store").setExecutor(storeCommand);
        
        ReloadCommand reloadCommand = new ReloadCommand(this);
        getCommand("reload").setExecutor(reloadCommand);
        
        getLogger().info("DiscordLink has been enabled!");
    }

    @Override
    public void onDisable() {
        getLogger().info("DiscordLink has been disabled!");
    }
}